目錄
- ?? 1. 創(chuàng)建專用網(wǎng)絡
- ?? 2. Oracle 12C部署
- ? 2.1 鏡像下載
- ? 2.2 容器創(chuàng)建
- ? 2.3 創(chuàng)建業(yè)務用戶
- ? 2.4 監(jiān)聽啟動
- ?? 3. MySQL8部署
- ? 3.1 容器創(chuàng)建
- ? 3.2 參數(shù)設置
- ? 3.3 登陸MySQL
- ?? 4. kettle遷移Oracle到MySQL
- ?4.1 部署kettle
- ?4.2 Oracle端數(shù)據(jù)校驗
- ?4.3 遷移Oracle到MySQL
- ?4.4 遷移后MySQL數(shù)據(jù)驗證
前言 Kettle是開源的 【TEL】 工具,JVAV編寫,可以運行在多個平臺,使用時有圖形界面、命令腳本,還可以二次開發(fā)。用于數(shù)據(jù)抽取、轉(zhuǎn)存等,非常方便
?? 1. 創(chuàng)建專用網(wǎng)絡
docker network create --subnet=168.66.6.0/24 db-network [root@docker ~]# docker network inspect db-network --查看網(wǎng)絡信息
?? 2. Oracle 12C部署
? 2.1 鏡像下載
docker pull registry.cn-shanghai.aliyuncs.com/techerwang/oracle:ora12c_12201
? 2.2 容器創(chuàng)建
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
? 2.3 創(chuàng)建業(yè)務用戶
[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 監(jiān)聽啟動
[oracle@jemora1221 ~]$ cd $ORACLE_HOME/network [oracle@jemora1221 network]$ cd admin ## 配置TNS,后續(xù)連接數(shù)據(jù)庫 [oracle@jemora1221 admin]$ vi tnsnames.ora JEMPDB = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = jemora1221)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = JEMPDB) ) ) ## 監(jiān)聽啟動 lsnrctl start lsnrctl status
?? 3. MySQL8部署
? 3.1 容器創(chuàng)建
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
查看容器
[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 參數(shù)設置
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 登陸MySQL
mysql -uroot -pjeames -h 168.66.6.35 create database jemdb;
?? 4. kettle遷移Oracle到MySQL
?4.1 部署kettle
Kettle是一款國外開源的ETL工具,純java編寫,可以在Window、Linux、Unix上運行.
Kettle 中文名稱叫水壺,該項目的主程序員MATT 希望把各種數(shù)據(jù)放到一個壺里,然后以一種指定的格式流出。Kettle這個ETL工具集,它允許你管理來自不同數(shù)據(jù)庫的數(shù)據(jù),通過提供一個圖形化的用戶環(huán)境來描述你想做什么,而不是你想怎么做。Kettle中有兩種腳本文件,transformation和job,transformation完成針對數(shù)據(jù)的基礎轉(zhuǎn)換,job則完成整個工作流的控制。