/* * RMAN cloning from one server to another * equal database structure, tested on 10gR2 */ PREPARE AUX INSTANCE -------------------- 1) check/create directory strucutre instance: - adump - bdump - cdump - udump database: - datafiles folder 2) prepare pfile copy pfile from target to aux instance 3) create password file orapwd file=PWD.ora password=pass (windows) on windows oradim -NEW -SID (check if service is running) test - export ORACLE_HOME, SID - sqlplus /nolog, connect / as sysdba, startup nomount - udump?alert.log or traces? 3) prepare SQLNet - run netmgr, add database service - add tnsnames.ora entry SID_LIST_LISTENER = (SID_LIST = ... (SID_DESC = (GLOBAL_DB_NAME = ) (ORACLE_HOME = c:\oracle\product\10.2.0\db_1) (SID_NAME = ) ) ) tnsping AUX sqlplus "sys/pass@aux as sysdba" - shutdown - startup nomount - CREATE PFILE FROM SPFILE (optional), then instance restart into nomount again 4) SQLNET - AUX visibility from target system - copy tnsnames entry to target tnsnames.ora - sqlplus "sys/pass@aux as sysdba" 5) make a backup on target, then transmit the backups to the same destination to AUX RMAN> BACKUP DATABASE; RMAN> SQL 'ALTER SYSTEM ARCHIVE LOG CURRENT'; RMAN> BACKUP ARCHIVELOG ALL; If you do not switch logfile and archive current log, following error you will recieve with RMAN-06023 errors because RMAN is looking for backups created before the most recent archived log. copy backups to the same destinantion on aux 6) RMAN DUPLICATE !! Before run RMAN DUPLICATE, be sure, there is no loged session on AUX instance: - exit from sqlplus or in the restart AUX stage the instance will be waiting for loged sessions to logoff - only one rman session should be there when duplicate begins rman: connect target / connect auxiliary sys/oracle@AUX1 run { DUPLICATE TARGET DATABASE TO PPLTE NOFILENAMECHECK; } /* other examples: # posible options to change CF datafiles paths when are different # SET NEWNAME FOR DATAFILE 1 TO 'c:\oradata\pplte\system01.dbf'; # SET NEWNAME FOR DATAFILE 2 TO 'c:\oradata\pplte\users01.dbf'; # # duplicate target database to # duplicate options: NOFILENAMECHECK - when destinations are equall must be used to disable validation # # PFILE - if AUX has no SPFILE - strongly recomended to define connect target / connect auxiliary sys/oracle@AUX1 run { DUPLICATE TARGET DATABASE TO PPLTE NOFILENAMECHECK PFILE=c:\oracle\product\10.2.0\db_1\database\initPPLTE.ora LOGFILE GROUP 1 ('c:\oradata\pplte\redo01a.log', 'c:\oradata\pplte\redo01b.log') SIZE 100M REUSE, GROUP 2 ('c:\oradata\pplte\redo02a.log', 'c:\oradata\pplte\redo02b.log') SIZE 100M REUSE; } */ ERRORS: ======= RMAN-00571: =========================================================== RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== RMAN-00571: =========================================================== RMAN-03002: failure of Duplicate Db command at 09/10/2009 16:57:40 RMAN-03015: error occurred in stored script Memory Script RMAN-06136: ORACLE error from auxiliary database: ORA-19563: header validation failed for file your set NEWNAME FOR DATAFILE command rewrites one file two times - ? probably is not needed to specify a change when path are identical or switch all datafile clause is used /* * googled http://www.orafaq.com/forum/t/121303/2/ http://www.cis.unisa.edu.au/oracle/server.101/b10734/rcmtroub.htm */ Duplication Fails with Multiple RMAN-06023 Errors: Scenario In this scenario, you back up the database, then run the DUPLICATE command. You receive the following error stack: RMAN-00571: =========================================================== RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== RMAN-00571: =========================================================== RMAN-03002: failure of Duplicate Db command at 09/04/2001 13:55:11 RMAN-03015: error occurred in stored script Memory Script RMAN-06026: some targets not found - aborting restore RMAN-06023: no backup or copy of datafile 8 found to restore RMAN-06023: no backup or copy of datafile 7 found to restore RMAN-06023: no backup or copy of datafile 6 found to restore RMAN-06023: no backup or copy of datafile 5 found to restore RMAN-06023: no backup or copy of datafile 4 found to restore RMAN-06023: no backup or copy of datafile 3 found to restore RMAN-06023: no backup or copy of datafile 2 found to restore RMAN-06023: no backup or copy of datafile 1 found to restore Duplication Fails with Multiple RMAN-06023 Errors: Diagnosis The DUPLICATE command recovers to archived redo logs, but cannot recover into online redo logs. Thus, if the restored backup cannot be made consistent without applying the online redo logs, then duplication fails with RMAN-06023 errors because RMAN is looking for backups created before the most recent archived log. Duplication Fails with Multiple RMAN-06023 Errors: Solution After backing up the source database, archive and back up the current redo log: RMAN> SQL 'ALTER SYSTEM ARCHIVE LOG CURRENT'; RMAN> BACKUP ARCHIVELOG ALL;