oracle11g2oracle11g && oracle11g2oracle19c

最近在搞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
View Code

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;
View Code

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
View Code

 

 导入到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
View Code

 

 查看数据:

11g211g-expdp/impdp

原文地址:https://www.cnblogs.com/daxiong1314/p/13403104.html