Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: RMAN -Help
I don't think you can write a single rman restore script that will work in
all situations.
Below is a rather old list of stuff I keep to serve as a reminder. I pick
what I need from the list. As you might notice, the list still has svrmgrl
in it.
svrmgrl <<-XXX
connect internal
startup nomount
exit
XXX
rman <<-XXX
connect target sys/viper@$ORACLE_SID
connect rcvcat rman/rman_at_catp4
run {
allocate channel ch1 type 'SBT_TAPE' parms
allocate channel ch2 type 'SBT_TAPE' parms
allocate channel ch3 type 'SBT_TAPE' parms
allocate channel ch4 type 'SBT_TAPE' parms
### When you want to restore up to, but not including, a specific log
sequence number
### For example, the database wants log 275, but all you have in rman
catalog are 273 and 274
# set until logseq=275 thread=1;
### When you want to restore to a specific time.
# set until time "to_date('2001-02-09 02:00:00','YYYY-MM-DD HH24:MI:SS')";
### Various syntax possibilities for restoring control files
# restore controlfile to '/u01/oradata/ORACLE_SID/control_01.ctl'; # restore controlfile to '/u02/oradata/ORACLE_SID/control_02.ctl'; # restore controlfile to '/u06/oradata/ORACLE_SID/control_03.ctl'; # replicate controlfile from '/u01/oradata/ORACLE_SID/control_01.ctl';
sql 'ALTER DATABASE MOUNT'; restore database;
recover database; sql 'ALTER DATABASE OPEN RESETLOGS'; release channel ch1; release channel ch2; release channel ch3; release channel ch4; }
XXX
### Various other possibilties below ....
##svrmgrl <<-XXX
## connect internal
## alter database recover using backup controlfile until cancel;
## alter database recover using backup controlfile;
## alter database recover until cancel;
## alter database recover;
## alter database open;
## alter database open resetlogs;
##XXX
echo "" echo " ------ DON'T FORGET ------ DON'T FORGET ------" echo "Don't forget to RESET DATABASE in RMAN catalog." echo " ------ DON'T FORGET ------ DON'T FORGET ------" echo "" ----------------------------------------------------------------Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- Archives are at http://www.freelists.org/archives/oracle-l/ FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html -----------------------------------------------------------------Received on Thu Jun 10 2004 - 12:09:40 CDT
![]() |
![]() |