====== RMAN DUPLICATE ====== ==== Environement ==== oracle@oracle:/oracle/TWOTST/orahome # env| grep ORA ORACLE_SID=TWOTST ORA_NLS10=/oracle/TWOTST/orahome/nls/data ORACLE_BASE=/oracle/TWOTST ORACLE_SW=/oracle/product/19.16.0.0.0p1 ORACLE_HOME=/oracle/TWOTST/orahome oracle@oracle:/oracle/DUPTST/orahome # env| grep ORA ORACLE_SID=DUPTST ORA_NLS10=/oracle/DUPTST/orahome/nls/data ORACLE_BASE=/oracle/DUPTST ORACLE_SW=/oracle/product/19.16.0.0.0p1 ORACLE_HOME=/oracle/DUPTST/orahome ==== create pfile in auxiliary DUPTST from pfile in source database containing at least: ==== instance_name=DUPTST db_name=DUPTST control_files="/oracle/data1/DUPTST/controlfile/control01.ctl" control_files="/oracle/data2/DUPTST/controlfile/control02.ctl" ==== Start the RMAN client: ==== * CONNECT to the source database as TARGET * CONNECT to the auxiliary instance * CONNECT to CATALOG RMAN> CONNECT TARGET SYS@TWOTST; # source database connected to target database: PROD (DBID=1234567) RMAN> CONNECT AUXILIARY SYS@DUPTST; # duplicate database instance connected to auxiliary database: DUPDB (not mounted) RMAN> CONNECT CATALOG rman_owner@ONETST; # recovery catalog database connected to recovery catalog database Method one (filnames in script): run { ALLOCATE AUXILIARY CHANNEL c1 DEVICE TYPE disk; ALLOCATE AUXILIARY CHANNEL c2 DEVICE TYPE disk; SET NEWNAME FOR DATAFILE 1 /oracle/data4/TWOTST/datafile/system_001.dbf SET NEWNAME FOR DATAFILE 2 /oracle/data4/TWOTST/datafile/sysaux_001.dbf SET NEWNAME FOR DATAFILE 3 /oracle/data4/TWOTST/datafile/databyhora.dbf SET NEWNAME FOR DATAFILE 4 /oracle/data4/TWOTST/datafile/tools_001.dbf SET NEWNAME FOR DATAFILE 5 /oracle/data4/TWOTST/datafile/data_001.dbf SET NEWNAME FOR DATAFILE 6 /oracle/data4/TWOTST/datafile/undotwo_001.dbf SET NEWNAME FOR DATAFILE 7 /oracle/data4/TWOTST/datafile/data_002.dbf DUPLICATE TARGET DATABASE TO 'DUPDB' #SKIP TABLESPACE tools LOGFILE GROUP 1 ('/oracle/data1/TWOTST/onlinelog/redo1_1.rdo', '/oracle/data1/TWOTST/onlinelog/redo2_1.rdo', '/oracle/data1/TWOTST/onlinelog/redo3_1.rdo', '/oracle/data1/TWOTST/onlinelog/redo4_1.rdo') SIZE 200M REUSE, GROUP 2 ('/oracle/data2/TWOTST/onlinelog/redo2_1.rdo', '/oracle/data2/TWOTST/onlinelog/redo2_2.rdo', '/oracle/data2/TWOTST/onlinelog/redo3_2.rdo', '/oracle/data2/TWOTST/onlinelog/redo4_2.rdo') SIZE 200M REUSE, } Method two (filenames in initSID.ora via db_file_name_convert, log_file_name_convert: