⛳️ 1. Create a private network
docker network create --subnet=168.66.6.0/24 db-network [root@docker ~]# docker network inspect db-network --查看网络信息

docker pull registry.cn-shanghai.aliyuncs.com/techerwang/oracle:ora12c_12201

docker run -itd --name jemora1221 -h jemora1221
–net=db-network --ip 168.66.6.34
-p 1526:1521 -p 3396:3389
–privileged=true
registry.cn-shanghai.aliyuncs.com/techerwang/oracle:ora12c_12201 init

[root@jeames ~]# docker exec -it jemora1221 bash
[root@jemora1221 /]# su - oracle
[oracle@jemora1221 ~]$ sqlplus / as sysdba
SYS@jem> startup
SYS@jem> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 JEMPDB MOUNTED
alter pluggable database JEMPDB open;
SYS@jem> select con_id,dbid,NAME,OPEN_MODE from v$pdbs;
SYS@jem> alter session set container=JEMPDB;
SYS@jem> create user jemmes identified by jemmes
SYS@jem> GRANT DBA to jemmes ;
✨ 2.4 Monitoring startup[oracle@jemora1221 ~]$ cd $ORACLE_HOME/network
[oracle@jemora1221 network]$ cd admin
## 配置TNS,后续连接数据库
[oracle@jemora1221 admin]$ vi tnsnames.ora
JEMPDB =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = jemora1221)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = JEMPDB)
)
)
## 监听启动
lsnrctl start
lsnrctl status

docker run -d --name mysql8027 -h mysql8027 -p 3418:3306
–net=db-network --ip 168.66.6.35
-v /etc/mysql/mysql8027/conf:/etc/mysql/conf.d
-e MYSQL_ROOT_PASSWORD=jeames -e TZ=Asia/Shanghai
mysql:8.0.27
View container[root@jeames ~]# docker ps --format “table {<!--{cke_protected}{C}%3C!%2D%2D%20%2D%2D%3E-->{.ID}}\t{<!--{cke_protected}{C}%3C!%2D%2D%20%2D%2D%3E-->{.Names}}\t{<!--{cke_protected}{C}%3C!%2D%2D%20%2D%2D%3E-->{.Status}}”
CONTAINER ID NAMES STATUS
043d1652404d jemora1221 Up 7 minutes
dc2989508b67 mysql8027 Up 23 seconds
7e6a53d71017 centos7.8 Up 20 minutes
##✨ 3.2 Parameter settings
cat > /etc/mysql/mysql8027/conf/my.cnf << “EOF” [mysqld] default-time-zone = ‘+8:00' log_timestamps = SYSTEM skip-name-resolve log-bin server_id=80273418 character_set_server=utf8mb4 default_authentication_plugin=mysql_native_password EOF
✨ 3.3 Log in to MySQL
mysql -uroot -pjeames -h 168.66.6.35 create database jemdb;
⛳️ 4. Migrate kettle from Oracle to MySQL
✨4.1 Deploy kettle
Kettle is a foreign open source ETL tool written in pure Java and can run on Window, Linux, and Unix.Kettle’s Chinese name is Kettle. MATT, the main programmer of the project, hopes to use various The data is put into a pot and then streamed out in a specified format. Kettle is an ETL toolset that allows you to manage data from different databases by providing a graphical user environment to describe what you want to do, rather than how you want to do it. There are two kinds of script files in Kettle, transformation and job. Transformation completes the basic transformation of data, and job completes the control of the entire workflow.Composition of kettle

Install AVA JDK
After downloading the jdk installation package, open the file and start the installation


[1]JAVA_HOME: The path to the Java installation just now, mine is: C:\Program Files\Java\jdk1.8.0_231[2]CLASSPATH:.; %JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar;
[3] Configure environment variable Path
Double-click Path and add "%JAVA_HOME%\bin"; add "%JAVA_HOME%" \jre\bin".
Win R key pops up the run window, enter cmd, press Enter to run
Enter "java -version" and "javac" respectively to test. If the following content is displayed, the configuration is successful
Download the kettle installation package
Here we choose version 7.1
##After the download is complete, extract it to any path, open the folder and find Spoon .bat, create a desktop shortcut, open 

Database driver package download
MySQL JDBC driver download
The file suffix .tar.gz is a compressed package for Linux/IOS; the suffix .zip is a compressed package under Windows.Download according to the system selection.
Download this version: mysql-connector-java-5.1.49-bin.jar
Oracle JDBC driver download
Database connection
Go to File-> New Transformation. After creating the new transformation, create a DB connection in the main object tree on the left to connect to the database


## 创建测试表
SYS@jem> conn jemmes/jemmes@JEMPDB
@/home/oracle/demo_ora_create.sql
@/home/oracle/demo_ora_insert.sql
create table flower(
id varchar2(32) default sys_guid() primary key,
flower_name varchar2(200),
color varchar2(100),
origin varchar2(200),
moral varchar2(200),
create_time timestamp default sysdate,
update_time timestamp
);
JEMMES@JEMPDB> insert into flower(flower_name) values('dd');
--oracle所有表
JEMMES@JEMPDB> select * from tab;
--迁移前相关检查
col TABLE_NAME format a30
SELECT a.table_name,a.num_rows FROM dba_tables a where a.OWNER='JEMMES' ;
select object_type,count(*) from dba_objects where owner='JEMMES' group by object_type;
select object_type,status,count(*) from dba_objects where owner='JEMMES' group by object_type,status;
select sum(bytes)/1024/1024 from dba_segments where owner='JEMMES';
✨4.3 Migrate Oracle to MySQL
Copy multiple tables







##✨4.4 MySQL data verification after migration
The above is the detailed content of How to migrate Docker containers from Oracle to MySQL. For more information, please follow other related articles on the PHP Chinese website!
MySQL: Essential Skills for Beginners to MasterApr 18, 2025 am 12:24 AMMySQL is suitable for beginners to learn database skills. 1. Install MySQL server and client tools. 2. Understand basic SQL queries, such as SELECT. 3. Master data operations: create tables, insert, update, and delete data. 4. Learn advanced skills: subquery and window functions. 5. Debugging and optimization: Check syntax, use indexes, avoid SELECT*, and use LIMIT.
MySQL: Structured Data and Relational DatabasesApr 18, 2025 am 12:22 AMMySQL efficiently manages structured data through table structure and SQL query, and implements inter-table relationships through foreign keys. 1. Define the data format and type when creating a table. 2. Use foreign keys to establish relationships between tables. 3. Improve performance through indexing and query optimization. 4. Regularly backup and monitor databases to ensure data security and performance optimization.
MySQL: Key Features and Capabilities ExplainedApr 18, 2025 am 12:17 AMMySQL is an open source relational database management system that is widely used in Web development. Its key features include: 1. Supports multiple storage engines, such as InnoDB and MyISAM, suitable for different scenarios; 2. Provides master-slave replication functions to facilitate load balancing and data backup; 3. Improve query efficiency through query optimization and index use.
The Purpose of SQL: Interacting with MySQL DatabasesApr 18, 2025 am 12:12 AMSQL is used to interact with MySQL database to realize data addition, deletion, modification, inspection and database design. 1) SQL performs data operations through SELECT, INSERT, UPDATE, DELETE statements; 2) Use CREATE, ALTER, DROP statements for database design and management; 3) Complex queries and data analysis are implemented through SQL to improve business decision-making efficiency.
MySQL for Beginners: Getting Started with Database ManagementApr 18, 2025 am 12:10 AMThe basic operations of MySQL include creating databases, tables, and using SQL to perform CRUD operations on data. 1. Create a database: CREATEDATABASEmy_first_db; 2. Create a table: CREATETABLEbooks(idINTAUTO_INCREMENTPRIMARYKEY, titleVARCHAR(100)NOTNULL, authorVARCHAR(100)NOTNULL, published_yearINT); 3. Insert data: INSERTINTObooks(title, author, published_year)VA
MySQL's Role: Databases in Web ApplicationsApr 17, 2025 am 12:23 AMThe main role of MySQL in web applications is to store and manage data. 1.MySQL efficiently processes user information, product catalogs, transaction records and other data. 2. Through SQL query, developers can extract information from the database to generate dynamic content. 3.MySQL works based on the client-server model to ensure acceptable query speed.
MySQL: Building Your First DatabaseApr 17, 2025 am 12:22 AMThe steps to build a MySQL database include: 1. Create a database and table, 2. Insert data, and 3. Conduct queries. First, use the CREATEDATABASE and CREATETABLE statements to create the database and table, then use the INSERTINTO statement to insert the data, and finally use the SELECT statement to query the data.
MySQL: A Beginner-Friendly Approach to Data StorageApr 17, 2025 am 12:21 AMMySQL is suitable for beginners because it is easy to use and powerful. 1.MySQL is a relational database, and uses SQL for CRUD operations. 2. It is simple to install and requires the root user password to be configured. 3. Use INSERT, UPDATE, DELETE, and SELECT to perform data operations. 4. ORDERBY, WHERE and JOIN can be used for complex queries. 5. Debugging requires checking the syntax and use EXPLAIN to analyze the query. 6. Optimization suggestions include using indexes, choosing the right data type and good programming habits.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

SublimeText3 English version
Recommended: Win version, supports code prompts!

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment







