最近在搞oracle 數據庫遷移,全量增量。好久沒有搞oracle了,東西忘的差不多,感覺還是整理一下,以后可以直接使用。
oralce 11g 全量增量到 異地oralce 11g 和 oralce 19c 腳本。
使用三種方式,exp,expdp,rman。
oracle11g2oracle11g
11g211g-環境如下
本來想兩邊都2G 內存,奈何沒錢買好電腦。
11g211g-創建用戶
兩邊同時創建oracle用戶daxiong1,daxiong2,daxiong3步驟一樣,只列舉一個用戶(daxiong1)

[oracle@master ~]$ ./oracle_script/bin/create_oracle_user.sh -u daxiong1 -p daxiong1 Oracle user [ daxiong1 ] created successfully!!! [oracle@master ~]$ sqlplus daxiong1/daxiong1 ======================================= [oracle@slave ~]$ ./oracle_script/bin/create_oracle_user.sh -u daxiong1 -p daxiong1 Oracle user [ daxiong1 ] created successfully!!! [oracle@slave ~]$ sqlplus daxiong1/daxiong1
11g211g-造數
master端造一些數據:

--創建測試表 create table t1( id int, name varchar(100) ); --插入幾條數據 insert into t1 values(1,'小一'); insert into t1 values(2,'小二'); insert into t1 values(3,'小三'); insert into t1 values(4,'小四'); insert into t1 values(9,'小五'); --查看一下 select * from t1;
11g211g-exp/imp
master上導出daxiong1,daxiong2用戶數據:
在slave上還原daxiong1,和daxiong2 用戶數據
現在master上測試一下:
導入數據:

./oracle11g_exp_imp.sh -t imp -u daxiong1,daxiong2 -d /home/oracle/oracle_script/data/20200731 -f daxiong1_095113.dmp
導入到slave-查看slave用戶(daxiong1和daxiong2)是否有t1表
導入到slave-打包到slave:
導入到slave-數據導入:

./oracle11g_exp_imp.sh -t imp -u daxiong1,daxiong2 -d /home/oracle/oracle_script/data/20200731 -f daxiong1_095113.dmp
查看數據: