Monday, May 13, 2013

Script to restore archive logs



#!/usr/bin/ksh
date

export ORACLE_SID=MYDBSTB
export NLS_LANG=american
export NLS_DATE_FORMAT='Mon DD YYYY HH24:MI:SS'
export ORACLE_HOME=/ora/fs0000/app/oracle/product/9.2.0.3
rman target / catalog mycat/mycatpwd@catdb <<eOfScript

spool log to '/ora/fs0000/app/oracle/admin/MYDBSTB/logbook/20130511.RestoreArchives.Alex/restore_archlogs.log' ;

run {
allocate channel t1 type 'SBT_TAPE' PARMS='BLKSIZE=1048576,SBT_LIBRARY=/usr/openv/netbackup/bin/libobk.so64';
allocate channel t2 type 'SBT_TAPE' PARMS='BLKSIZE=1048576,SBT_LIBRARY=/usr/openv/netbackup/bin/libobk.so64';
allocate channel t3 type 'SBT_TAPE' PARMS='BLKSIZE=1048576,SBT_LIBRARY=/usr/openv/netbackup/bin/libobk.so64';
send 'NB_ORA_SERV=<nbserver_comp>, NB_ORA_CLIENT=<nbclient_comp>';
#restore archivelog from time 'Apr 26 2013 04:55:06' until time 'Apr 28 2013 08:52:00';
restore archivelog from logseq 4095908 until logseq 4095958 thread 1;
release channel t1;
release channel t2;
release channel t3;
}
exit
eOfScript
date
exit

No comments: