Thursday, July 4, 2013

Restore RAC to single instance RMAN backup

Step 1 :- Create pfile from production database and modify following parameters
control_files
log_archive_dest_1
cluster_database_instances

Step 2 :- Startup no mount
startup nomount
Step 3 :- rman connect target=/  catalog rman/rman@rmandb
set dbid=137714854
list backup;
Step 4 :- pick any backup identify tag information and restore control file
run {
 allocate channel 'dev_0' type 'sbt_tape'
 parms 'SBT_LIBRARY=/opt/omni/lib/libob2oracle8_64bit.so,ENV=(OB2BARTYPE=Oracle8,OB2APPNAME=oradb, OB2BARLIST=ONLINE_my-pc_oradb)';
 restore controlfile from tag 'TAG20130701T001553';
}
Step 5 :- startup mount
Step 6 :- Restore database & Recover database :-
run {
allocate channel 'dev_0' type 'sbt_tape'
parms 'SBT_LIBRARY=/opt/omni/lib/libob2oracle8_64bit.so,ENV=(OB2BARTYPE=Oracle8,OB2APPNAME=oradb, OB2BARLIST=ONLINE_my-pc_oradb)';
sql 'alter database rename file "+data/dbf/PROD/redo01.log" to "/data/scratch/dbf/PROD/redo01.log"';
sql 'alter database rename file "+/data/dbf/PROD/redo02.log to  "/data/scratch/dbf/PROD/redo02.log"';
sql 'alter database rename file "+/data/dbf/PROD/redo03.log to "/data/scratch/dbf/PROD/redo03.log"';
set NEWNAME for datafile 1 to '/oradb_restore/data/oradb/datafile/system.260.800209871’;
set NEWNAME for datafile 2 to '/oradb_restore/data/oradb/datafile/sysaux.261.800209873’;
set NEWNAME for datafile 3 to '/oradb_restore/data/oradb/datafile/undotbs1.262.800209875’;
set NEWNAME for datafile 4 to '/oradb_restore/data/oradb/datafile/users.264.800209883’;
set NEWNAME for datafile 5 to '/oradb_restore/data/oradb/datafile/oradb_data_ts.267.800305713’;
set NEWNAME for datafile 6 to '/oradb_restore/data/oradb/datafile/oradb_data_ts.268.800305741’;
set NEWNAME for datafile 7 to '/oradb_restore/data/oradb/datafile/oradb_data_ts.269.800305769’;
set NEWNAME for datafile 8 to '/oradb_restore/data/oradb/datafile/oradb_idx_ts.270.800311977’;
set NEWNAME for datafile 9 to '/oradb_restore/data/oradb/datafile/oradb_idx_ts.271.800312003’;
set NEWNAME for datafile 9 to '/oradb_restore/data/oradb/datafile/undotbs1.278.806582679’;
restore database from tag 'TAG20130701T001553';
switch datafile all;
recover database;
}

Step 7 :-
alter database open resetlogs;
If open database fail with error ORA-38856
then, Set the following parameter in the init.ora file:
_no_recovery_through_resetlogs=TRUE

Step 8 :- Disable other threads i.e. used for RAC other instances and drop redo log groups
select THREAD#, STATUS, ENABLED from v$thread;
select group# from v$log where THREAD#=2;
alter database disable thread 2;
alter database clear unarchived logfile group 2;  
alter database drop logfile group 2 ;

Step 9 :- You can drop Undo database space for other instances
show parameters undo
select tablespace_name from dba_tablespaces where contents='UNDO';
drop tablespace UNDOTBS2 including contents and datafiles;

Step 10 :- Add temp file
alter tablespace temp add tempfile '/oradb_restore/data/oradb/tempfile/temp02.dat' size 200m reuse autoextend on next 100m  maxsize 400m;
 

No comments:

Post a Comment