--源库开启归档或者read only SQL> alter pluggable database open read only;
--目标库创建源库的dblink,这里使用的tns:srm_test需要提前创建好 SQL> conn /as sysdba; SQL> create public database link srmtest_dblink connect to srm identified by xxxx using 'srm_test';
--于是执行,果然打开了 SQL> alter pluggable database srm_pro open read only instances = all;
刷新
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
--于是执行,果然打开了 SQL> alter pluggable database srm_pro open read only instances = all;
--测试刷新,现在源库新建一张表,然后到目标库刷新,再查询目标库是否同步数据 SQL> conn xx/xxx@srm_test; SQL> create table t1(c1 number);insert into t1 values(123); SQL> desc t1; select * from t1; --查看新建的表
--目标库进行刷新 SQL> alter pluggable database srm_pro close immediate instances = all; SQL> alter session set container = srm_pro; SQL> alter pluggable database refresh; SQL> alter pluggable database open read only; SQL> conn xxx/xxxx@srm_pro; SQL> desc t1;select * from t1; --已经查询到在源库新建的测试数据表t1