| oracle 主机 | pdb | |
|---|---|---|
| 源端 | 192.168.5.128 | pdb2 |
| 目标端 | 192.168.5.129 | pdb2dg |
前提条件:
1.源库必须处于归档模式
archive log list;
2.源库需要同步的pdb必须open。
1. 目标库创建REMOTE_RECOVERY_FILE_DEST参数文件,并设置参数
mkdir -p /tmp/fixfpdbalter system set REMOTE_RECOVERY_FILE_DEST='/tmp/fixfpdb';
2.目标库执行duplicate 同步
duplicate pluggable database fixfpdb as dupfixfpdb to orcl from active database nofilenamecheck;[oracle@19c_cdb ~]$ rman target sys/Oracle123@192.168.5.128:1521/orcl auxiliary sys/Oracle123Recovery Manager: Release 19.0.0.0.0 - Production on Thu Apr 22 01:30:58 2021Version 19.3.0.0.0Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.connected to target database: ORCL (DBID=1575995925)connected to auxiliary database: ORCL (DBID=1575995925)RMAN> duplicate pluggable database fixfpdb as dupfixfpdb to orcl from active database nofilenamecheck;Starting Duplicate PDB at 22-APR-21using target database control file instead of recovery catalogallocated channel: ORA_AUX_DISK_1channel ORA_AUX_DISK_1: SID=382 device type=DISKcurrent log archivedduplicating Online logs to Oracle Managed File (OMF) locationduplicating Datafiles to Oracle Managed File (OMF) locationcontents of Memory Script:{set newname for clone datafile 16 to new;set newname for clone datafile 17 to new;set newname for clone datafile 18 to new;set newname for clone datafile 20 to new;restorefrom nonsparse clone foreign pluggable database"FIXFPDB"from service '192.168.5.128:1521/orcl' ;}executing Memory Scriptexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEStarting restore at 22-APR-21using channel ORA_AUX_DISK_1channel ORA_AUX_DISK_1: starting datafile backup set restorechannel ORA_AUX_DISK_1: using network backup set from service 192.168.5.128:1521/orclchannel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup setchannel ORA_AUX_DISK_1: restoring foreign file 16 to /u01/oracle/oradata/ORCL/AF79DD4522FD0E17E0538105A8C043BD/datafile/o1_mf_system_tovst3j1_.dbfchannel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:08channel ORA_AUX_DISK_1: starting datafile backup set restorechannel ORA_AUX_DISK_1: using network backup set from service 192.168.5.128:1521/orclchannel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup setchannel ORA_AUX_DISK_1: restoring foreign file 17 to /u01/oracle/oradata/ORCL/AF79DD4522FD0E17E0538105A8C043BD/datafile/o1_mf_sysaux_rfvst3j8_.dbfchannel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:07channel ORA_AUX_DISK_1: starting datafile backup set restorechannel ORA_AUX_DISK_1: using network backup set from service 192.168.5.128:1521/orclchannel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup setchannel ORA_AUX_DISK_1: restoring foreign file 18 to /u01/oracle/oradata/ORCL/AF79DD4522FD0E17E0538105A8C043BD/datafile/o1_mf_undotbs1_1evst3jg_.dbfchannel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:03channel ORA_AUX_DISK_1: starting datafile backup set restorechannel ORA_AUX_DISK_1: using network backup set from service 192.168.5.128:1521/orclchannel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup setchannel ORA_AUX_DISK_1: restoring foreign file 20 to /u01/oracle/oradata/ORCL/AF79DD4522FD0E17E0538105A8C043BD/datafile/o1_mf_fixf_qpvst3jj_.dbfchannel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:35Finished restore at 22-APR-21current log archivedcontents of Memory Script:{set archivelog destination to '/tmp/fixfpdb';restore clone force from service '192.168.5.128:1521/orcl'foreign archivelog from scn 3467857;}executing Memory Scriptexecuting command: SET ARCHIVELOG DESTINATIONStarting restore at 22-APR-21using channel ORA_AUX_DISK_1channel ORA_AUX_DISK_1: starting archived log restore to user-specified destinationarchived log destination=/tmp/fixfpdbchannel ORA_AUX_DISK_1: using network backup set from service 192.168.5.128:1521/orclchannel ORA_AUX_DISK_1: restoring archived logarchived log thread=1 sequence=24channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:02channel ORA_AUX_DISK_1: starting archived log restore to user-specified destinationarchived log destination=/tmp/fixfpdbchannel ORA_AUX_DISK_1: using network backup set from service 192.168.5.128:1521/orclchannel ORA_AUX_DISK_1: restoring archived logarchived log thread=1 sequence=25channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01Finished restore at 22-APR-21Performing import of metadata...Finished Duplicate PDB at 22-APR-21
3.查看已同步的pdb
sqlplus / as sysdbaSQL> show pdbsCON_ID CON_NAME OPEN MODE RESTRICTED---------- ------------------------------ ---------- ----------2 PDB$SEED READ ONLY NO3 ORCLPDB MOUNTED4 PDB1 MOUNTED5 DUPFIXFPDB READ WRITE NO6 PDB3DG MOUNTED10 NOCDB MOUNTED
