Example scripts for duplicate

edit tnsnames.ora on the remote host where binaries were cloned and network assistant configured listener is configured. 

dupdb = (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=dup.example.com)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=dup)))
srcdb = (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=src.example.com)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=src)))

Connecting to the databases

CONNECT TARGET SYS/sysdba@srcdb;    # source database 
CONNECT AUXILIARY SYS/sysdba@dupdb; # duplicate database instance
CONNECT CATALOG rman/rman@catdb;    # recovery catalog database

DUPLICATE DATABASE prod DBID 123456789 TO dupdb 
UNTIL TIME "TO_DATE('12/14/2020', 'MM/DD/YYYY')" 
## TO RESTORE POINT TESTDB12142020   --- you can also set to a restore point to which databases backup is taken and restored to duplicate database.
PASSWORD FILE  ### asking here also to copy the password file.
SPFILE
NOFILENAMECHECK
BACKUP LOCATION '/prod_backups' ;  ## backup location also can be set 

Related Posts: