Source DB - Dup2 (target)
Target DB - Dup5 (auxiliary)
Server - oel6-node01
Here we will first make sure that we don’t have any backup of database before starting this demo.
[oracle@oel6-node01 dbs]$ . oraenv
ORACLE_SID = [testdb] ? dup2
The Oracle base remains unchanged with value /u01/app/oracle
[oracle@oel6-node01 dbs]$ rman target /
Recovery Manager: Release 12.1.0.2.0 - Production on Tue May 5 14:25:08 2020
Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved.
connected to target database: DUP2 (DBID=3004224068)
RMAN> list backup summary;
using target database control file instead of recovery catalog
List of Backups
===============
Key TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag
------- -- -- - ----------- --------------- ------- ------- ---------- ---
1 B F A DISK 05-MAY-20 1 1 NO TAG20200505T125558
RMAN> delete backup;
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=69 device type=DISK
List of Backup Pieces
BP Key BS Key Pc# Cp# Status Device Type Piece Name
------- ------- --- --- ----------- ----------- ----------
1 1 1 1 AVAILABLE DISK /u01/app/oracle/fast_recovery_area/DUP2/autobackup/2020_05_05/o1_mf_s_1039611358_hc2588hf_.bkp
Do you really want to delete the above objects (enter YES or NO)? yes
deleted backup piece
backup piece handle=/u01/app/oracle/fast_recovery_area/DUP2/autobackup/2020_05_05/o1_mf_s_1039611358_hc2588hf_.bkp RECID=1 STAMP=1039611360
Deleted 1 objects
RMAN> list backup summary;
specification does not match any backup in the repository
Create a temporary pfile for new database dup5
[oracle@oel6-node01 dbs]$ cat initdup5.ora
*.db_name='dup5'
*.db_block_size=8192
*.remote_login_passwordfile='exclusive'
*.db_create_file_dest='/u01/app/oracle/oradata/'
*.db_recovery_file_dest='/u01/app/oracle/fast_recovery_area'
*.db_recovery_file_dest_size=5G
*.compatible='12.1.0.2.0'
*.enable_pluggable_database=true
Note
enable_pluggable_database – this parameter should be used if its a multi tenant database
compatible parameter should be of same value as of source database.
Add dup5 entry oratab
[oracle@oel6-node01 dbs]$ cat /etc/oratab
testdb:/u01/app/oracle/product/12.1.0.2/db_3:Y
dup2:/u01/app/oracle/product/12.1.0.2/db_3:N
dup5:/u01/app/oracle/product/12.1.0.2/db_3:N
Start dup5 in nomount statge
[oracle@oel6-node01 dbs]$ . oraenv
ORACLE_SID = [dup2] ? dup5
The Oracle base remains unchanged with value /u01/app/oracle
[oracle@oel6-node01 dbs]$ sqlplus
SQL*Plus: Release 12.1.0.2.0 Production on Tue May 5 14:31:02 2020
Copyright (c) 1982, 2014, Oracle. All rights reserved.
Enter user-name: /as sysdba
Connected to an idle instance.
SQL> startup nomount pfile=/u01/app/oracle/product/12.1.0.2/db_3/dbs/initdup5.ora
ORACLE instance started.
Total System Global Area 272629760 bytes
Fixed Size 2923336 bytes
Variable Size 213910712 bytes
Database Buffers 50331648 bytes
Redo Buffers 5464064 bytes
SQL>
Add dup2 and dup5 tns entry
[oracle@oel6-node01 admin]$ cat tnsnames.ora
# tnsnames.ora Network Configuration File: /u01/app/oracle/product/12.1.0.2/db_3/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
TESTDB =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = oel6-node01.localdomain)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = testdb.localdomain)
)
)
DUP2 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = oel6-node01.localdomain)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME =dup2)
)
)
DUP5 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = oel6-node01.localdomain)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME =dup5)
)
)
Create dup2, dup5 password file
[oracle@oel6-node01 ~]$ orapwd file=/u01/app/oracle/product/12.1.0.2/db_3/dbs/orapwdup2 password=oracle entries=10
[oracle@oel6-node01 admin]$ orapwd file=/u01/app/oracle/product/12.1.0.2/db_3/dbs/orapwdup5 password=oracle entries=10
Verify services (Dup2,dup5) are listed in listener status
[oracle@oel6-node01 admin]$ lsnrctl status
LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 05-MAY-2020 14:51:25
Copyright (c) 1991, 2014, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=oel6-node01.localdomain)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 12.1.0.2.0 - Production
Start Date 05-MAY-2020 12:09:37
Uptime 0 days 2 hr. 41 min. 47 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/12.1.0.2/db_3/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/oel6-node01/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oel6-node01.localdomain)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=oel6-node01.localdomain)(PORT=5500))(Security=(my_wallet_directory=/u01/app/oracle/admin/testdb/xdb_wallet))(Presentation=HTTP)(Session=RAW))
Services Summary...
Service "DUP2" has 1 instance(s).
Instance "dup2", status READY, has 1 handler(s) for this service...
Service "dup5" has 1 instance(s).
Instance "dup5", status BLOCKED, has 1 handler(s) for this service...
Service "pdb" has 1 instance(s).
Instance "dup2", status READY, has 1 handler(s) for this service...
Service "pdb.localdomain" has 1 instance(s).
Instance "testdb", status READY, has 1 handler(s) for this service...
Service "testdb.localdomain" has 1 instance(s).
Instance "testdb", status READY, has 1 handler(s) for this service...
Service "testdbXDB.localdomain" has 1 instance(s).
Instance "testdb", status READY, has 1 handler(s) for this service...
The command completed successfully
Start duplicate if you see this error
[oracle@oel6-node01 admin]$ rman TARGET sys/oracle@dup2 AUXILIARY sys/oracle@dup5
Recovery Manager: Release 12.1.0.2.0 - Production on Tue May 5 14:53:22 2020
Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved.
connected to target database: DUP2 (DBID=3004224068)
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00554: initialization of internal recovery manager package failed
RMAN-04006: error from auxiliary database: ORA-12528: TNS:listener: all appropriate instances are blocking new connections
Reason is that the dup5 is in blocked state
[oracle@oel6-node01 admin]$ lsnrctl status
LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 05-MAY-2020 14:51:25
Copyright (c) 1991, 2014, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=oel6-node01.localdomain)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 12.1.0.2.0 - Production
Start Date 05-MAY-2020 12:09:37
Uptime 0 days 2 hr. 41 min. 47 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/12.1.0.2/db_3/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/oel6-node01/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oel6-node01.localdomain)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=oel6-node01.localdomain)(PORT=5500))(Security=(my_wallet_directory=/u01/app/oracle/admin/testdb/xdb_wallet))(Presentation=HTTP)(Session=RAW))
Services Summary...
Service "DUP2" has 1 instance(s).
Instance "dup2", status READY, has 1 handler(s) for this service...
Service "dup5" has 1 instance(s).
Instance "dup5", status BLOCKED, has 1 handler(s) for this service...
Service "pdb" has 1 instance(s).
Instance "dup2", status READY, has 1 handler(s) for this service...
Service "pdb.localdomain" has 1 instance(s).
Instance "testdb", status READY, has 1 handler(s) for this service...
Service "testdb.localdomain" has 1 instance(s).
Instance "testdb", status READY, has 1 handler(s) for this service...
Service "testdbXDB.localdomain" has 1 instance(s).
Instance "testdb", status READY, has 1 handler(s) for this service...
The command completed successfully
So you need to add static listener for dup5 entry and reload the listener
[oracle@oel6-node01 admin]$ cat listener.ora
# listener.ora Network Configuration File: /u01/app/oracle/product/12.1.0.2/db_3/network/admin/listener.ora
# Generated by Oracle configuration tools.
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = oel6-node01.localdomain)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
)
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = dup5)
(ORACLE_HOME = /u01/app/oracle/product/12.1.0.2/db_3)
(SID_NAME = dup5)
)
)
Notice the dup5 service stautus is now UNKNOWN
[oracle@oel6-node01 admin]$ lsnrctl reload
LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 05-MAY-2020 14:57:51
Copyright (c) 1991, 2014, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=oel6-node01.localdomain)(PORT=1521)))
The command completed successfully
[oracle@oel6-node01 admin]$ lsnrctl status
LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 05-MAY-2020 14:58:05
Copyright (c) 1991, 2014, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=oel6-node01.localdomain)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 12.1.0.2.0 - Production
Start Date 05-MAY-2020 12:09:37
Uptime 0 days 2 hr. 48 min. 27 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/12.1.0.2/db_3/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/oel6-node01/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oel6-node01.localdomain)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=oel6-node01.localdomain)(PORT=5500))(Security=(my_wallet_directory=/u01/app/oracle/admin/testdb/xdb_wallet))(Presentation=HTTP)(Session=RAW))
Services Summary...
Service "DUP2" has 1 instance(s).
Instance "dup2", status READY, has 1 handler(s) for this service...
Service "dup5" has 2 instance(s).
Instance "dup5", status UNKNOWN, has 1 handler(s) for this service...
Instance "dup5", status BLOCKED, has 1 handler(s) for this service...
Service "pdb" has 1 instance(s).
Instance "dup2", status READY, has 1 handler(s) for this service...
Service "pdb.localdomain" has 1 instance(s).
Instance "testdb", status READY, has 1 handler(s) for this service...
Service "testdb.localdomain" has 1 instance(s).
Instance "testdb", status READY, has 1 handler(s) for this service...
Service "testdbXDB.localdomain" has 1 instance(s).
Instance "testdb", status READY, has 1 handler(s) for this service...
The command completed successfully
Now run the duplicate
[oracle@oel6-node01 dbs]$ rman TARGET sys/oracle@dup2 AUXILIARY sys/oracle@dup5
Recovery Manager: Release 12.1.0.2.0 - Production on Tue May 5 15:06:46 2020
Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved.
connected to target database: DUP2 (DBID=3004224068)
connected to auxiliary database: DUP5 (not mounted)
RMAN> DUPLICATE DATABASE TO DUP5 FROM ACTIVE DATABASE;
Starting Duplicate Db at 05-MAY-20
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=22 device type=DISK
current log archived
contents of Memory Script:
{
sql clone "create spfile from memory";
}
executing Memory Script
sql statement: create spfile from memory
contents of Memory Script:
{
shutdown clone immediate;
startup clone nomount;
}
executing Memory Script
Oracle instance shut down
connected to auxiliary database (not started)
Oracle instance started
Total System Global Area 272629760 bytes
Fixed Size 2923336 bytes
Variable Size 213910712 bytes
Database Buffers 50331648 bytes
Redo Buffers 5464064 bytes
contents of Memory Script:
{
sql clone "alter system set control_files =
''/u01/app/oracle/oradata/DUP5/controlfile/o1_mf_hc2dyh49_.ctl'', ''/u01/app/oracle/fast_recovery_area/DUP5/controlfile/o1_mf_hc2dyh4m_.ctl'' comment=
''Set by RMAN'' scope=spfile";
sql clone "alter system set db_name =
''DUP2'' comment=
''Modified by RMAN duplicate'' scope=spfile";
sql clone "alter system set db_unique_name =
''DUP5'' comment=
''Modified by RMAN duplicate'' scope=spfile";
shutdown clone immediate;
startup clone force nomount
restore clone from service 'dup2' primary controlfile;
alter clone database mount;
}
executing Memory Script
sql statement: alter system set control_files = ''/u01/app/oracle/oradata/DUP5/controlfile/o1_mf_hc2dyh49_.ctl'', ''/u01/app/oracle/fast_recovery_area/DUP5/controlfile/o1_mf_hc2dyh4m_.ctl'' comment= ''Set by RMAN'' scope=spfile
sql statement: alter system set db_name = ''DUP2'' comment= ''Modified by RMAN duplicate'' scope=spfile
sql statement: alter system set db_unique_name = ''DUP5'' comment= ''Modified by RMAN duplicate'' scope=spfile
Oracle instance shut down
Oracle instance started
Total System Global Area 272629760 bytes
Fixed Size 2923336 bytes
Variable Size 213910712 bytes
Database Buffers 50331648 bytes
Redo Buffers 5464064 bytes
Starting restore at 05-MAY-20
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=21 device type=DISK
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service dup2
channel ORA_AUX_DISK_1: restoring control file
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:03
output file name=/u01/app/oracle/oradata/DUP5/controlfile/o1_mf_hc2dyh49_.ctl
output file name=/u01/app/oracle/fast_recovery_area/DUP5/controlfile/o1_mf_hc2dyh4m_.ctl
Finished restore at 05-MAY-20
database mounted
contents of Memory Script:
{
set newname for clone datafile 1 to new;
set newname for clone datafile 3 to new;
set newname for clone datafile 4 to new;
set newname for clone datafile 5 to new;
set newname for clone datafile 6 to new;
set newname for clone datafile 7 to new;
set newname for clone datafile 8 to new;
set newname for clone datafile 9 to new;
set newname for clone datafile 10 to new;
set newname for clone datafile 11 to new;
restore
from service 'dup2' clone database
;
sql 'alter system archive log current';
}
executing Memory Script
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
Starting restore at 05-MAY-20
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 dup2
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00001 to /u01/app/oracle/oradata/DUP5/datafile/o1_mf_system_%u_.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:36
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service dup2
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00003 to /u01/app/oracle/oradata/DUP5/datafile/o1_mf_sysaux_%u_.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:26
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service dup2
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00004 to /u01/app/oracle/oradata/DUP5/datafile/o1_mf_undotbs1_%u_.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:08
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service dup2
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00005 to /u01/app/oracle/oradata/DUP5/datafile/o1_mf_system_%u_.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:15
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service dup2
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00006 to /u01/app/oracle/oradata/DUP5/datafile/o1_mf_users_%u_.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:02
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service dup2
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00007 to /u01/app/oracle/oradata/DUP5/datafile/o1_mf_sysaux_%u_.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:25
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service dup2
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00008 to /u01/app/oracle/oradata/DUP5/datafile/o1_mf_system_%u_.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:15
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service dup2
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00009 to /u01/app/oracle/oradata/DUP5/datafile/o1_mf_sysaux_%u_.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:25
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service dup2
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00010 to /u01/app/oracle/oradata/DUP5/datafile/o1_mf_users_%u_.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service dup2
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00011 to /u01/app/oracle/oradata/DUP5/datafile/o1_mf_example_%u_.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:45
Finished restore at 05-MAY-20
sql statement: alter system archive log current
current log archived
contents of Memory Script:
{
restore clone force from service 'dup2'
archivelog from scn 1779703;
switch clone datafile all;
}
executing Memory Script
Starting restore at 05-MAY-20
using channel ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: starting archived log restore to default destination
channel ORA_AUX_DISK_1: using network backup set from service dup2
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=5
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_AUX_DISK_1: starting archived log restore to default destination
channel ORA_AUX_DISK_1: using network backup set from service dup2
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=6
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
Finished restore at 05-MAY-20
datafile 1 switched to datafile copy
input datafile copy RECID=18 STAMP=1039619471 file name=/u01/app/oracle/oradata/DUP5/datafile/o1_mf_system_hc2dzg8d_.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=19 STAMP=1039619471 file name=/u01/app/oracle/oradata/DUP5/datafile/o1_mf_sysaux_hc2f0lt2_.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=20 STAMP=1039619472 file name=/u01/app/oracle/oradata/DUP5/datafile/o1_mf_undotbs1_hc2f1dv0_.dbf
datafile 5 switched to datafile copy
input datafile copy RECID=21 STAMP=1039619472 file name=/u01/app/oracle/oradata/DUP5/datafile/o1_mf_system_hc2f1n78_.dbf
datafile 6 switched to datafile copy
input datafile copy RECID=22 STAMP=1039619472 file name=/u01/app/oracle/oradata/DUP5/datafile/o1_mf_users_hc2f2348_.dbf
datafile 7 switched to datafile copy
input datafile copy RECID=23 STAMP=1039619472 file name=/u01/app/oracle/oradata/DUP5/datafile/o1_mf_sysaux_hc2f24s2_.dbf
datafile 8 switched to datafile copy
input datafile copy RECID=24 STAMP=1039619472 file name=/u01/app/oracle/oradata/DUP5/datafile/o1_mf_system_hc2f2y5q_.dbf
datafile 9 switched to datafile copy
input datafile copy RECID=25 STAMP=1039619472 file name=/u01/app/oracle/oradata/DUP5/datafile/o1_mf_sysaux_hc2f3g3x_.dbf
datafile 10 switched to datafile copy
input datafile copy RECID=26 STAMP=1039619472 file name=/u01/app/oracle/oradata/DUP5/datafile/o1_mf_users_hc2f46qd_.dbf
datafile 11 switched to datafile copy
input datafile copy RECID=27 STAMP=1039619472 file name=/u01/app/oracle/oradata/DUP5/datafile/o1_mf_example_hc2f48rs_.dbf
contents of Memory Script:
{
set until scn 1779963;
recover
clone database
delete archivelog
;
}
executing Memory Script
executing command: SET until clause
Starting recover at 05-MAY-20
using channel ORA_AUX_DISK_1
starting media recovery
archived log for thread 1 with sequence 5 is already on disk as file /u01/app/oracle/fast_recovery_area/DUP5/archivelog/2020_05_05/o1_mf_1_5_hc2f5oq8_.arc
archived log for thread 1 with sequence 6 is already on disk as file /u01/app/oracle/fast_recovery_area/DUP5/archivelog/2020_05_05/o1_mf_1_6_hc2f5ps2_.arc
archived log file name=/u01/app/oracle/fast_recovery_area/DUP5/archivelog/2020_05_05/o1_mf_1_5_hc2f5oq8_.arc thread=1 sequence=5
archived log file name=/u01/app/oracle/fast_recovery_area/DUP5/archivelog/2020_05_05/o1_mf_1_6_hc2f5ps2_.arc thread=1 sequence=6
media recovery complete, elapsed time: 00:00:01
Finished recover at 05-MAY-20
Oracle instance started
Total System Global Area 272629760 bytes
Fixed Size 2923336 bytes
Variable Size 213910712 bytes
Database Buffers 50331648 bytes
Redo Buffers 5464064 bytes
contents of Memory Script:
{
sql clone "alter system set db_name =
''DUP5'' comment=
''Reset to original value by RMAN'' scope=spfile";
sql clone "alter system reset db_unique_name scope=spfile";
}
executing Memory Script
sql statement: alter system set db_name = ''DUP5'' comment= ''Reset to original value by RMAN'' scope=spfile
sql statement: alter system reset db_unique_name scope=spfile
Oracle instance started
Total System Global Area 272629760 bytes
Fixed Size 2923336 bytes
Variable Size 213910712 bytes
Database Buffers 50331648 bytes
Redo Buffers 5464064 bytes
sql statement: CREATE CONTROLFILE REUSE SET DATABASE "DUP5" RESETLOGS ARCHIVELOG
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 1024
MAXINSTANCES 8
MAXLOGHISTORY 292
LOGFILE
GROUP 1 SIZE 50 M ,
GROUP 2 SIZE 50 M ,
GROUP 3 SIZE 50 M
DATAFILE
'/u01/app/oracle/oradata/DUP5/datafile/o1_mf_system_hc2dzg8d_.dbf',
'/u01/app/oracle/oradata/DUP5/datafile/o1_mf_system_hc2f1n78_.dbf',
'/u01/app/oracle/oradata/DUP5/datafile/o1_mf_system_hc2f2y5q_.dbf'
CHARACTER SET WE8MSWIN1252
contents of Memory Script:
{
set newname for clone tempfile 1 to new;
set newname for clone tempfile 2 to new;
set newname for clone tempfile 3 to new;
switch clone tempfile all;
catalog clone datafilecopy "/u01/app/oracle/oradata/DUP5/datafile/o1_mf_sysaux_hc2f0lt2_.dbf",
"/u01/app/oracle/oradata/DUP5/datafile/o1_mf_undotbs1_hc2f1dv0_.dbf",
"/u01/app/oracle/oradata/DUP5/datafile/o1_mf_users_hc2f2348_.dbf",
"/u01/app/oracle/oradata/DUP5/datafile/o1_mf_sysaux_hc2f24s2_.dbf",
"/u01/app/oracle/oradata/DUP5/datafile/o1_mf_sysaux_hc2f3g3x_.dbf",
"/u01/app/oracle/oradata/DUP5/datafile/o1_mf_users_hc2f46qd_.dbf",
"/u01/app/oracle/oradata/DUP5/datafile/o1_mf_example_hc2f48rs_.dbf";
switch clone datafile all;
}
executing Memory Script
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
renamed tempfile 1 to /u01/app/oracle/oradata/DUP5/datafile/o1_mf_temp_%u_.tmp in control file
renamed tempfile 2 to /u01/app/oracle/oradata/DUP5/datafile/o1_mf_temp_%u_.tmp in control file
renamed tempfile 3 to /u01/app/oracle/oradata/DUP5/datafile/o1_mf_temp_%u_.tmp in control file
cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/DUP5/datafile/o1_mf_sysaux_hc2f0lt2_.dbf RECID=1 STAMP=1039619501
cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/DUP5/datafile/o1_mf_undotbs1_hc2f1dv0_.dbf RECID=2 STAMP=1039619501
cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/DUP5/datafile/o1_mf_users_hc2f2348_.dbf RECID=3 STAMP=1039619501
cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/DUP5/datafile/o1_mf_sysaux_hc2f24s2_.dbf RECID=4 STAMP=1039619501
cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/DUP5/datafile/o1_mf_sysaux_hc2f3g3x_.dbf RECID=5 STAMP=1039619501
cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/DUP5/datafile/o1_mf_users_hc2f46qd_.dbf RECID=6 STAMP=1039619501
cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/DUP5/datafile/o1_mf_example_hc2f48rs_.dbf RECID=7 STAMP=1039619501
datafile 3 switched to datafile copy
input datafile copy RECID=1 STAMP=1039619501 file name=/u01/app/oracle/oradata/DUP5/datafile/o1_mf_sysaux_hc2f0lt2_.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=2 STAMP=1039619501 file name=/u01/app/oracle/oradata/DUP5/datafile/o1_mf_undotbs1_hc2f1dv0_.dbf
datafile 6 switched to datafile copy
input datafile copy RECID=3 STAMP=1039619501 file name=/u01/app/oracle/oradata/DUP5/datafile/o1_mf_users_hc2f2348_.dbf
datafile 7 switched to datafile copy
input datafile copy RECID=4 STAMP=1039619501 file name=/u01/app/oracle/oradata/DUP5/datafile/o1_mf_sysaux_hc2f24s2_.dbf
datafile 9 switched to datafile copy
input datafile copy RECID=5 STAMP=1039619501 file name=/u01/app/oracle/oradata/DUP5/datafile/o1_mf_sysaux_hc2f3g3x_.dbf
datafile 10 switched to datafile copy
input datafile copy RECID=6 STAMP=1039619501 file name=/u01/app/oracle/oradata/DUP5/datafile/o1_mf_users_hc2f46qd_.dbf
datafile 11 switched to datafile copy
input datafile copy RECID=7 STAMP=1039619501 file name=/u01/app/oracle/oradata/DUP5/datafile/o1_mf_example_hc2f48rs_.dbf
contents of Memory Script:
{
Alter clone database open resetlogs;
}
executing Memory Script
database opened
contents of Memory Script:
{
sql clone "alter pluggable database all open";
}
executing Memory Script
sql statement: alter pluggable database all open
Cannot remove created server parameter file
Finished Duplicate Db at 05-MAY-20
RMAN>
Verify the database and datafile
SQL> col HOST_NAME for a30
SQL> select name,open_mode,host_name from v$database, v$instance;
NAME OPEN_MODE HOST_NAME
--------- -------------------- ------------------------------
DUP5 READ WRITE oel6-node01.localdomain
SQL> select name from v$datafile;
NAME
--------------------------------------------------------------------------------
/u01/app/oracle/oradata/DUP5/datafile/o1_mf_system_hc2dzg8d_.dbf
/u01/app/oracle/oradata/DUP5/datafile/o1_mf_sysaux_hc2f0lt2_.dbf
/u01/app/oracle/oradata/DUP5/datafile/o1_mf_undotbs1_hc2f1dv0_.dbf
/u01/app/oracle/oradata/DUP5/datafile/o1_mf_system_hc2f1n78_.dbf
/u01/app/oracle/oradata/DUP5/datafile/o1_mf_users_hc2f2348_.dbf
/u01/app/oracle/oradata/DUP5/datafile/o1_mf_sysaux_hc2f24s2_.dbf
/u01/app/oracle/oradata/DUP5/datafile/o1_mf_system_hc2f2y5q_.dbf
/u01/app/oracle/oradata/DUP5/datafile/o1_mf_sysaux_hc2f3g3x_.dbf
/u01/app/oracle/oradata/DUP5/datafile/o1_mf_users_hc2f46qd_.dbf
/u01/app/oracle/oradata/DUP5/datafile/o1_mf_example_hc2f48rs_.dbf
10 rows selected.
SQL> select member from v$logfile;
MEMBER
--------------------------------------------------------------------------------
/u01/app/oracle/oradata/DUP5/onlinelog/o1_mf_3_hc2f6orq_.log
/u01/app/oracle/fast_recovery_area/DUP5/onlinelog/o1_mf_3_hc2f6p62_.log
/u01/app/oracle/oradata/DUP5/onlinelog/o1_mf_2_hc2f6mt0_.log
/u01/app/oracle/fast_recovery_area/DUP5/onlinelog/o1_mf_2_hc2f6n67_.log
/u01/app/oracle/oradata/DUP5/onlinelog/o1_mf_1_hc2f6kff_.log
/u01/app/oracle/fast_recovery_area/DUP5/onlinelog/o1_mf_1_hc2f6l7z_.log
6 rows selected.
SQL> select name from V$controlfile;
NAME
--------------------------------------------------------------------------------
/u01/app/oracle/oradata/DUP5/controlfile/o1_mf_hc2dyh49_.ctl
/u01/app/oracle/fast_recovery_area/DUP5/controlfile/o1_mf_hc2dyh4m_.ctl