RMAN Production restore process Step's Step 1. Take all the files from RMAN directory to some other directory and ftp to failover databases where you wants to restore RMAN files for recovery. Step 2. Make sure FTP file size are same on both the side use the following lines below Ls -l > 1.lst from source and ls -l > 2.lst target Vi 1.lst and 2.lst remove unnecessary lines except datafile Then run the command below: For 1.lst tr -s " " < dir | tr " " "|" | cut -d"|" -f 6,10 | sort > 1a.lst For 2.lst tr -s " " < dir | tr " " "|" | cut -d"|" -f 6,10 | sort > 2a.lst diff 1a.lst 2a.lst [Different should be 0] Step 3: Goto target machine (failover database) Step 4: Run dropdb.sql [Which will generate rmfiles.sh script] Dropdb.sql script set pages 0 set head off set feedback off set echo off spool rmfiles.sh select 'rm ' || trim(file_name) from dba_data_files ; select 'rm ' || trim(member) from v$logfile ; select 'rm ' || trim(name) from v$controlfile ; spool off Step 5: It will create a script called rmfiles.sh rm /data/system/NBPRDD01/system01.dbf rm /data/temp/NBPRDD01/temp01.dbf rm /data/tools/NBPRDD01/tools01.dbf rm /data/db1/NBPRDD01/pin00.dbf rm /data/db2/NBPRDD01/pin01.dbf rm /data/db3/NBPRDD01/pin02.dbf rm /data/db4/NBPRDD01/pin03.dbf rm /data/db5/NBPRDD01/pin04.dbf rm /data/db6/NBPRDD01/pin05.dbf rm /data/db7/NBPRDD01/pin06.dbf rm /data/db8/NBPRDD01/pin07.dbf rm /data/db9/NBPRDD01/pin08.dbf rm /data/db10/NBPRDD01/pin09.dbf rm /data/db11/NBPRDD01/pin10.dbf rm /data/db12/NBPRDD01/pin11.dbf rm /data/db13/NBPRDD01/pin12.dbf rm /data/db14/NBPRDD01/pin13.dbf rm /data/db15/NBPRDD01/pin14.dbf rm /data/db16/NBPRDD01/pin15.dbf rm /data/db17/NBPRDD01/pin16.dbf rm /data/db18/NBPRDD01/aol_data.dbf rm /data/db19/NBPRDD01/aol_screen.dbf rm /data/db20/NBPRDD01/aol_event.dbf rm /data/idx1/NBPRDD01/pinx00.dbf rm /data/idx2/NBPRDD01/pinx01.dbf rm /data/idx3/NBPRDD01/pinx02.dbf rm /data/idx4/NBPRDD01/pinx03.dbf rm /data/idx5/NBPRDD01/pinx04.dbf rm /data/idx6/NBPRDD01/pinx05.dbf rm /data/idx7/NBPRDD01/pinx06.dbf rm /data/idx8/NBPRDD01/pinx07.dbf rm /data/idx9/NBPRDD01/pinx08.dbf rm /data/idx10/NBPRDD01/pinx09.dbf rm /data/idx11/NBPRDD01/pinx10.dbf rm /data/idx12/NBPRDD01/pinx11.dbf rm /data/idx13/NBPRDD01/pinx12.dbf rm /data/idx14/NBPRDD01/pinx13.dbf rm /data/idx14/NBPRDD01/pinx14.dbf rm /data/idx15/NBPRDD01/pinx15.dbf rm /data/idx16/NBPRDD01/aol_index.dbf rm /data/idx17/NBPRDD01/aol_event_index.dbf rm /data/idx18/NBPRDD01/pinx16_1.dbf rm /data/idx19/NBPRDD01/aol_screen_index.dbf rm /data/rbs1/NBPRDD01/rbs01.dbf rm /data/rbs2/NBPRDD01/rbs02.dbf rm /data/rbs3/NBPRDD01/rbs03.dbf Step 5:Shutdown abort [Make sure ORACLE_SID ,v$session,v$instance are correct] Step 6: Run rmfile.sh [Which will delete all the datafiles] Step 7: Change password orapwd file=orapwNBBKPD02 entries=10 password=Sunday Step 8: Change Instance_name,service_name,db_name to NBBKPD02 [For example] And uncomment remote_login_passwordfile = exclusive parameter In init.ora file under $ORACLE_HOME/dbs directory Step 9: Add NBBKPD02 in listner.ora file and start the listner again ** SID_LIST_LISTENER = (SID_LIST = (SID_DESC = (ORACLE_HOME = /apps/oracle/product/8.1.7) (SID_NAME = NBPRDD01) ) ** (SID_DESC = (ORACLE_HOME = /apps/oracle/product/8.1.7) (SID_NAME = NBBKPM02) ) ) Step 10: Add entry for NBBKPD02 in tnsname.ora file NBBKPD02 = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = nbdbd2op.ops.aol.com) (PORT = 1521)) ) (CONNECT_DATA = (ORACLE_SID = NBBKPD02) ) ) Step 11: Startup the database with nomount option using changed init.ora file Svrmgrl> connect internal startup database nomount pfile=$ORACLE_HOME/dbs/initNBBKPD02.ora Step 12:Go to source database [For example in this case NBPRDM01 ,machine nbdbm1op and execute this command] rman_dup.sh rman target / catalog rmanuser/cbso4ever@NBRCAT auxiliary sys@NBBKPD02 cmdfile=rman_dup.rcv log=rman_dup.log rman_dup.rcv run { allocate auxiliary channel ch1 type disk ; allocate auxiliary channel ch2 type disk ; allocate auxiliary channel ch3 type disk ; allocate auxiliary channel ch4 type disk ; allocate auxiliary channel ch5 type disk ; allocate auxiliary channel ch6 type disk ; duplicate target database to NBBKPD02 nofilenamecheck ; } It generate rman_dup.log at source machine. It will open the failover database and bring up the system upto current state. If you Get errorr below then you have apply last redolog file from online. RMAN-03022: compiling command: allocate RMAN-03023: executing command: allocate RMAN-08030: allocated channel: ch6 RMAN-08500: channel ch6: sid=18 devtype=DISK "rman_dup.log" 648 lines, 32125 characters RMAN-11001: Oracle Error: ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below ORA-01152: file 1 was not restored from a sufficiently old backup ORA-01110: data file 1: '/data/system/NBPRDD01/system01.dbf' RMAN-08031: released channel: ch1 RMAN-08031: released channel: ch2 RMAN-08031: released channel: ch3 RMAN-08031: released channel: ch4 RMAN-08031: released channel: ch5 RMAN-08031: released channel: ch6 RMAN-00571: =========================================================== RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== RMAN-00571: =========================================================== RMAN-03002: failure during compilation of command RMAN-03013: command type: Duplicate Db RMAN-03015: error occurred in stored script Memory Script RMAN-03002: failure during compilation of command RMAN-03013: command type: recover RMAN-03002: failure during compilation of command RMAN-03013: command type: recover(4) RMAN-06053: unable to perform media recovery because of missing log RMAN-06025: no backup of log thread 1 seq 342 scn 208361707 found to restore Recovery Manager complete. 12a. Generate controlfile script from source machine and run in the target after modification. a) svrmgrl > Alter database backup controlfile to trace and change. b) Change necessary entry save as create_control.sql STARTUP NOMOUNT CREATE CONTROLFILE SET DATABASE "NBPRDD01" RESETLOGS ARCHIVELOG MAXLOGFILES 32 MAXLOGMEMBERS 2 MAXDATAFILES 1000 MAXINSTANCES 8 MAXLOGHISTORY 453 LOGFILE GROUP 1 ( '/data/redo1/NBPRDD01/redo11.log', '/data/redo2/NBPRDD01/redo21.log' ) SIZE 1000M, GROUP 2 ( '/data/redo1/NBPRDD01/redo12.log', '/data/redo2/NBPRDD01/redo22.log' ) SIZE 1000M, GROUP 3 ( '/data/redo1/NBPRDD01/redo13.log', '/data/redo2/NBPRDD01/redo23.log' ) SIZE 1000M, GROUP 4 ( '/data/redo1/NBPRDD01/redo14.log', '/data/redo2/NBPRDD01/redo24.log' ) SIZE 1000M DATAFILE '/data/system/NBPRDD01/system01.dbf', '/data/rbs1/NBPRDD01/rbs01.dbf', '/data/rbs2/NBPRDD01/rbs02.dbf', '/data/rbs3/NBPRDD01/rbs03.dbf', '/data/temp/NBPRDD01/temp01.dbf', '/data/tools/NBPRDD01/tools01.dbf', '/data/db1/NBPRDD01/pin00.dbf', '/data/db2/NBPRDD01/pin01.dbf', '/data/db3/NBPRDD01/pin02.dbf', '/data/db4/NBPRDD01/pin03.dbf', '/data/db5/NBPRDD01/pin04.dbf', '/data/db6/NBPRDD01/pin05.dbf', '/data/db7/NBPRDD01/pin06.dbf', '/data/db8/NBPRDD01/pin07.dbf', '/data/db9/NBPRDD01/pin08.dbf', '/data/db10/NBPRDD01/pin09.dbf', '/data/db11/NBPRDD01/pin10.dbf', '/data/db12/NBPRDD01/pin11.dbf', '/data/db13/NBPRDD01/pin12.dbf', '/data/db14/NBPRDD01/pin13.dbf', '/data/db15/NBPRDD01/pin14.dbf', '/data/db16/NBPRDD01/pin15.dbf', '/data/db17/NBPRDD01/pin16.dbf' CHARACTER SET UTF8; RECOVER DATABASE ALTER SYSTEM ARCHIVE LOG ALL; ALTER DATABASE OPEN; Step 13: Run recovery for last redolog file Copy last redolog file or archive log file from online machine to failover under /oracle_backup/NBPRDD01/arch directory Svrmgrl> connect internal Shutdown immediate Startup mount Recover database using backup controlfile until cancel Alter database open resetlog Note: RMAN copy controlfile along with datafile at same timestamp. Step 14: Rename failover database to original name NBPRDM01 c) svrmgrl > Alter database backup controlfile to trace and change. d) Change necessary entry save as create_control.sql STARTUP NOMOUNT CREATE CONTROLFILE SET DATABASE "NBPRDD01" RESETLOGS ARCHIVELOG MAXLOGFILES 32 MAXLOGMEMBERS 2 MAXDATAFILES 1000 MAXINSTANCES 8 MAXLOGHISTORY 453 LOGFILE GROUP 1 ( '/data/redo1/NBPRDD01/redo11.log', '/data/redo2/NBPRDD01/redo21.log' ) SIZE 1000M, GROUP 2 ( '/data/redo1/NBPRDD01/redo12.log', '/data/redo2/NBPRDD01/redo22.log' ) SIZE 1000M, GROUP 3 ( '/data/redo1/NBPRDD01/redo13.log', '/data/redo2/NBPRDD01/redo23.log' ) SIZE 1000M, GROUP 4 ( '/data/redo1/NBPRDD01/redo14.log', '/data/redo2/NBPRDD01/redo24.log' ) SIZE 1000M DATAFILE '/data/system/NBPRDD01/system01.dbf', '/data/rbs1/NBPRDD01/rbs01.dbf', '/data/rbs2/NBPRDD01/rbs02.dbf', '/data/rbs3/NBPRDD01/rbs03.dbf', '/data/temp/NBPRDD01/temp01.dbf', '/data/tools/NBPRDD01/tools01.dbf', '/data/db1/NBPRDD01/pin00.dbf', '/data/db2/NBPRDD01/pin01.dbf', '/data/db3/NBPRDD01/pin02.dbf', '/data/db4/NBPRDD01/pin03.dbf', '/data/db5/NBPRDD01/pin04.dbf', '/data/db6/NBPRDD01/pin05.dbf', '/data/db7/NBPRDD01/pin06.dbf', '/data/db8/NBPRDD01/pin07.dbf', '/data/db9/NBPRDD01/pin08.dbf', '/data/db10/NBPRDD01/pin09.dbf', '/data/db11/NBPRDD01/pin10.dbf', '/data/db12/NBPRDD01/pin11.dbf', '/data/db13/NBPRDD01/pin12.dbf', '/data/db14/NBPRDD01/pin13.dbf', '/data/db15/NBPRDD01/pin14.dbf', '/data/db16/NBPRDD01/pin15.dbf', '/data/db17/NBPRDD01/pin16.dbf' CHARACTER SET UTF8; RECOVER DATABASE ALTER SYSTEM ARCHIVE LOG ALL; ALTER DATABASE OPEN; Step 15: Change init.ora file instance_name,db_name,service_name back to Original name. NBPRDM01,NBPRDM01,NBPRDD01 Commect # remote_login_passwordfile = exclusive Step 16: Shutdown the database with immediate option Svrmgrl> connect internal Shutdown immediate @create_controlfile Step 17: Drop database link Crtlink.sql col username format a20 col host format a20 col db_link format a15 set lines 200 select username,host,db_link from user_db_links ; drop database link md_primary ; create database link md_primary connect to nwtnprod identified by : using 'NBBKPD02' ; select username,host,db_link from user_db_links ; select instance_name from v$instance@md_primary; Step 18: Disable 3 trigger disable_3.sql alter trigger ACCOUNT_GROUPS_TRIGGER disable ; alter trigger LEDGER_REPORT_TRIGGER disable ; alter trigger TRIG_CYCLE_DEFERRED_TAX disable ; Step 19: Validation test . Record count and no of recirds exported from export log should taily Step 20: Operation check all the objects including indexes Step 21: run utlrp.sql [ Which will re-compile Invalid object to Valid. Step 22: Flush shareplex queue Step 23: Register all new databases to RMAN RMAN Production Backup process Step's Wow to take RMAN backup for recovery purpose: For any upgrade in online databases and restore to failover databases case: Step 1: Create a directory where all the datafile will copy [Example POSTCONV] /oracle_backup/NBPRDD01/rmanbackup/POSTCONV Step 2: execute postconv.sh command from Unix command line Postconv.sh $ORACLE_HOME/bin/rman target / catalog userid/password@RMANCAT_SID cmdfile postconv.rcv Which call postconv.rcv file run { allocate channel c1 type disk; allocate channel c2 type disk; allocate channel c3 type disk; allocate channel c4 type disk; set command id to 'Postconv'; setlimit channel c1 kbytes 2097152 maxopenfiles 32 readrate 200; setlimit channel c2 kbytes 2097152 maxopenfiles 32 readrate 200; setlimit channel c3 kbytes 2097152 maxopenfiles 32 readrate 200; setlimit channel c4 kbytes 2097152 maxopenfiles 32 readrate 200; backup incremental level = 0 format '/oracle_backup/NBPRDD01/rmanbackup/POSTCONV/%d_%s_%p' tag='Postconv' (database filesperset = 2 include current controlfile); release channel c1; release channel c2; release channel c3; release channel c4; } Note: This script will create a addition set of RMAN backup with different TAG=Postconv Same script have to run across all online databases before 1 AM or after 3 PM For normal recovery case: Step 1: Go to directory /oracle_backup/NBPRDD01/rmanbackup and make sure last Date and time all the files update. Step 2: