技術分享 記一次19c本地端克隆pdb到目標端
首先確認目標端與本地端數(shù)據(jù)庫版本一致
$ORACLE_HOME/OPatch/opatch lspatches
1、設置目標端恢復文件存放位置,
alter system set remote_recovery_file_dest='ASM磁盤或文件系統(tǒng)';
2、tns文件添加連接串
cd $ORACLE_HOME/network/admin
vim tnsnames.ora
可以直接把本地端與目標端的連接串互相復制,注意tnsping檢查通信
3、目標端進入rman
rman target sys/oracle_4U@orcl auxiliary sys/oracle_4U@orclcdb
4、活動復制
duplicate pluggable database PDB1 to orclcdb from active database;
duplicate pluggable database PDB2 to orclcdb from active database;
duplicate pluggable database PDB3 to orclcdb from active database;
duplicate pluggable database PDB4 to orclcdb from active database;
5、檢查pdb能否正常關閉與啟動
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
----------
------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 PDB1 READ WRITE YES
SQL> alter session set container=PDB1;
Session altered.
SQL>alter pluggable database PDB1 close;
SQL>alter pluggable database PDB1 open;
6、PDB保存打開狀態(tài),下次重啟CDB,自動啟動PDB
alter pluggable databse all save state;
