Restore RAC Database form tape Restore to new server




Restore RAC Database form tape Restore to new server ( Incomplete Recovery since we will be restoring C.F )



Few recommendation for RAC 11.2


Unix> rman target /

RMAN> configure controlfile autobackup on;

RMAN> configure retention policy to recovery window of 7 days;

RMAN> configure snapshot controlfile name to '+DATA/sncforcl.ora'; --from 11.2.0.2.0,the snapshot control file must be saved in a shared location





1. Copy backups to destination host using scp or ftp




2. Resore spfile and create the pfile from the spfile

RMAN> set DBID=2325151276

RMAN> startup nomount; -- may error and say could not open parameter file with messg sarting without pfile

RMAN> run{

allocate channel ch00 device type 'SBT_TAPE'

PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/tmp/tape)";

restore spfile to '$ORACLE_HOME/dbs/spfile$ORACLE_SID.ora' from '/tmp/tape/c-2325151276-20110726-01';

release channel ch00;

}


 modify the pfile  


edit the pfile to modify audit_file_dest, background_dump_dest, control_files, core_dump_dest, log_archive_dest_1,

user_dump_dest values. Remove RAC specific parameters such as cluster_database_instances, cluster_database. use one undo_tablespace name.


3. Resore Control file

RMAN> startup force nomount pfile='/tmp/init.ora';

RMAN> run{
allocate channel ch00 device type 'SBT_TAPE'
PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/tmp/tape_2011_07_27)";
restore controlfile to '/u01/app/oracle/control01.ctl' from '/tmp/tape_2011_07_27/c-2325151276-20110727-02'; -- or just restore controlfile
release channel ch00;
}


4. Find upto which SCN to recover


Mount and list backup of archivelog all

pick up the highest sequence number for each thread

Note : Look into the next scn number for these 2 rows, and pick the row with the lowest next scn number



RMAN> alter database mount;

RMAN> list backup of archivelog all;



NOTE : (Restore any required archive logs )

RMAN> run{
allocate channel ch00 device type 'SBT_TAPE'

PARMS="SBT_LIBRARY=oracle.disksbt,ENV=(BACKUP_DIR=/tmp/tape_2011_07_27)";

set archivelog destination to '/u01/app/oracle';
restore archivelog logseq 15 from tag 'TAG20110727T134422';
release channel ch00;


}

5. Now restore and recover

RMAN> run{
allocate channel ch01 device type 'SBT_TAPE'

PARMS="SBT_LIBRARY=oracle.disksbt, ENV=(BACKUP_DIR=/tmp/tape_2011_07_27)";

set until sequence 22 thread 1;
set newname for datafile 1 to '/u01/app/oracle/system01.dbf';
set newname for datafile 2 to '/u01/app/oracle/sysaux01.dbf';
set newname for datafile 3 to '/u01/app/oracle/undotbs01.dbf';
set newname for datafile 4 to '/u01/app/oracle/users01.dbf';
set newname for datafile 5 to '/u01/app/oracle/example01.dbf';
set newname for datafile 6 to '/u01/app/oracle/undotbs02.dbf';

restore database;
switch datafile all;
recover database;

release channel ch01;
}


6. Rename online redo logs


SQL> alter database rename file '+DATA/rac/onlinelog/group_2.262.737169357' to '/u01/app/oracle/redo01.log';

SQL> alter database rename file '+DATA/rac/onlinelog/group_1.261.737169343' to '/u01/app/oracle/redo02.log';

SQL> alter database rename file '+DATA/rac/onlinelog/group_3.266.737246587' to '/u01/app/oracle/redo03.log';

SQL> alter database rename file '+DATA/rac/onlinelog/group_4.267.737246619' to '/u01/app/oracle/redo04.log';


SQL> alter database open resetlogs;

SQL> select MEMBER FROM V$LOGFILE;