Here is different scenario to create duplicate databases:
A duplicate database, which is a copy of the target database with a unique DBID. It is entirely independent of the primary database.
A standby database does not get a new DBID. A standby database, which is a special copy of the primary database that is updated by applying archived redo logs from the primary database.
I) Duplicate database without connecting to the target database and recovery catalog:
1) At source take a backup and move to target server: rman> backup database plus archivelog;
2) Create password file and init.ora for auxiliary instance with only one parameter DB_NAME=jdup
3) Start the instance with no mount: STARTUP NOMOUNT
4) Connect to the auxilary instance from RMAN and perforam the rman duplicate:
DUPLICATE DATABASE TO jdup
UNTIL TIME "TO_DATE('01-FEB-2012 10:00:00','DD-MON-YYYY HH24:MI:SS')"
SPFILE
set control_files='+jdata\jdup\control\controlfile.ctl'
set db_file_name_convert='+jdata\jdb','+jdata\jdup'
set log_file_name_convert='+jdata\jdb','+jdata\jdup'
BACKUP LOCATION '/u01/bkup/';
II) Database Duplication from ACTIVE Database:
1) No need to take backup of source database
2) Password file MUST match source and traget database
3) tnsname.ora should have target and source connect string
4) DUPLICATE TARGET DATABASE TO jdb FROM ACTIVE DATABASE
SPFILE NOFILENAMECHECK;
III) Duplicate database using nofilenamecheck: Production and Auxiliary have same directory structure and are running on two different machines (ORACLE 10g - nofilenamecheck )
DUPLICATE TARGET DATABASE TO testdev nofilenamecheck;
IV) Duplicate database using nofilenamecheck and dorecover(UNTIL clause): Production and Auxiliary have same directory structure and are running on two different machines (oracle 11g - dorecover nofilenamecheck)
(select next_change# from v$archived_log where sequence# = (select max(sequence#) from v$archived_log)
set until scn 121212;
DUPLICATE TARGET DATABASE TO testdev dorecover nofilenamecheck;
V) Duplicate database using pfile :
DUPLICATE TARGET DATABASE TO dupdb PFILE = <initDUPDB.ora> NOFILENAMECHECK;
A duplicate database, which is a copy of the target database with a unique DBID. It is entirely independent of the primary database.
A standby database does not get a new DBID. A standby database, which is a special copy of the primary database that is updated by applying archived redo logs from the primary database.
I) Duplicate database without connecting to the target database and recovery catalog:
1) At source take a backup and move to target server: rman> backup database plus archivelog;
2) Create password file and init.ora for auxiliary instance with only one parameter DB_NAME=jdup
3) Start the instance with no mount: STARTUP NOMOUNT
4) Connect to the auxilary instance from RMAN and perforam the rman duplicate:
DUPLICATE DATABASE TO jdup
UNTIL TIME "TO_DATE('01-FEB-2012 10:00:00','DD-MON-YYYY HH24:MI:SS')"
SPFILE
set control_files='+jdata\jdup\control\controlfile.ctl'
set db_file_name_convert='+jdata\jdb','+jdata\jdup'
set log_file_name_convert='+jdata\jdb','+jdata\jdup'
BACKUP LOCATION '/u01/bkup/';
II) Database Duplication from ACTIVE Database:
1) No need to take backup of source database
2) Password file MUST match source and traget database
3) tnsname.ora should have target and source connect string
4) DUPLICATE TARGET DATABASE TO jdb FROM ACTIVE DATABASE
SPFILE NOFILENAMECHECK;
III) Duplicate database using nofilenamecheck: Production and Auxiliary have same directory structure and are running on two different machines (ORACLE 10g - nofilenamecheck )
DUPLICATE TARGET DATABASE TO testdev nofilenamecheck;
IV) Duplicate database using nofilenamecheck and dorecover(UNTIL clause): Production and Auxiliary have same directory structure and are running on two different machines (oracle 11g - dorecover nofilenamecheck)
(select next_change# from v$archived_log where sequence# = (select max(sequence#) from v$archived_log)
set until scn 121212;
DUPLICATE TARGET DATABASE TO testdev dorecover nofilenamecheck;
V) Duplicate database using pfile :
DUPLICATE TARGET DATABASE TO dupdb PFILE = <initDUPDB.ora> NOFILENAMECHECK;
No comments:
Post a Comment