如下:
[oracle@dbserver85 admin]$ rman target "'sys/oracle_4U@cdb1 as sysdba'" auxiliary "'sys/oracle_4U@cdb2 as sysdba'"
Recovery Manager: Release 19.0.0.0.0 - Production on Sun Nov 28 16:51:21 2021
Version 19.12.0.0.0
Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.
connected to target database: CDB1 (DBID=1062262966)
connected to auxiliary database: CDB2 (DBID=836885595)
RMAN> duplicate pluggable database pdb2 to cdb2 from active database;
Starting Duplicate PDB at 28-NOV-21
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=147 device type=DISK
current log archived
duplicating Online logs to Oracle Managed File (OMF) location
duplicating Datafiles to Oracle Managed File (OMF) location
current log archived
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate PDB command at 11/28/2021 16:51:42
RMAN-05501: aborting duplication of target database
RMAN-06136: Oracle error from auxiliary database: ORA-17627: ORA-12154: TNS:could not resolve the connect identifier specified
ORA-17629: Cannot connect to the remote database server
RMAN> exit
原因:
要在目的地 cdb2 所在机器创建到 源端 cdb1 的连接串
CDB1 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.133.122)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = cdb1)
)
)
创建这个连接串后,再去执行,就可以了。
[oracle@dbserver85 admin]$ rman target "'sys/oracle_4U@cdb1 as sysdba'" auxiliary "'sys/oracle_4U@cdb2 as sysdba'"
Recovery Manager: Release 19.0.0.0.0 - Production on Sun Nov 28 16:53:55 2021
Version 19.12.0.0.0
Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.
connected to target database: CDB1 (DBID=1062262966)
connected to auxiliary database: CDB2 (DBID=836885595)
RMAN> duplicate pluggable database pdb2 to cdb2 from active database;
Starting Duplicate PDB at 28-NOV-21
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=146 device type=DISK
current log archived
duplicating Online logs to Oracle Managed File (OMF) location
duplicating Datafiles to Oracle Managed File (OMF) location
current log archived
contents of Memory Script:
{
set newname for clone datafile 99 to new;
set newname for clone datafile 100 to new;
set newname for clone datafile 101 to new;
restore
from nonsparse clone foreign pluggable database
"PDB2"
from service 'cdb1' ;
}
executing Memory Script
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
Starting restore at 28-NOV-21
using channel ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service cdb1
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring foreign file 99 to /home/oracle/CDB2/D1D4F603653C542AE0537A85A8C0FB65/datafile/o1_mf_system_a60fap9r_.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:07
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service cdb1
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring foreign file 100 to /home/oracle/CDB2/D1D4F603653C542AE0537A85A8C0FB65/datafile/o1_mf_sysaux_i10fapa2_.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:07
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service cdb1
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring foreign file 101 to /home/oracle/CDB2/D1D4F603653C542AE0537A85A8C0FB65/datafile/o1_mf_undotbs1_a30fapa9_.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:03
Finished restore at 28-NOV-21
contents of Memory Script:
{
set archivelog destination to '/u01/app/oracle';
restore clone force from service 'cdb1'
foreign archivelog from scn 6322720;
}
executing Memory Script
executing command: SET ARCHIVELOG DESTINATION
Starting restore at 28-NOV-21
using channel ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: starting archived log restore to user-specified destination
archived log destination=/u01/app/oracle
channel ORA_AUX_DISK_1: using network backup set from service cdb1
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=59
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_AUX_DISK_1: starting archived log restore to user-specified destination
archived log destination=/u01/app/oracle
channel ORA_AUX_DISK_1: using network backup set from service cdb1
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=60
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_AUX_DISK_1: starting archived log restore to user-specified destination
archived log destination=/u01/app/oracle
channel ORA_AUX_DISK_1: using network backup set from service cdb1
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=61
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
Finished restore at 28-NOV-21
Performing import of metadata...
Finished Duplicate PDB at 28-NOV-21
RMAN>
|