Re: Unix Shell Script Help

Thanks for your comments, Mike.
I was responding to OP's requirement of how to "CANCEL" recovery. In old 
days when I was cloning database outside of RMAN, I was using combination 
of AUTO and CANCEL to perform recovery upto last available arch log.

#!/usr/bin/ksh
#

$ORACLE_HOME/bin/sqlplus -s /nolog <<eof1
connect /as sysdba;
startup mount;
RECOVER database using backup controlfile;
auto
exit 0;
eof1

echo "database recovered with available arch logs"

$ORACLE_HOME/bin/sqlplus -s /nolog <<eof2
connect /as sysdba;
RECOVER database using backup controlfile until cancel;
cancel
exit 0;
eof2

echo "database recovered with CANCEL"

$ORACLE_HOME/bin/sqlplus -s /nolog <<eof3
WHENEVER SQLERROR EXIT 1;
connect /as sysdba;
alter database open resetlogs;
exit 0;
eof3


Thanks
Mayen






"Mike Haddon" <m.haddon@xxxxxxxxx> 
Sent by: oracle-l-bounce@xxxxxxxxxxxxx
Feb 13 2009 06:47 PM
Please respond to
m.haddon@xxxxxxxxx


To
"oracle-l" <oracle-l@xxxxxxxxxxxxx>
cc

Subject
Re: Unix Shell Script Help


That will cancel before applying any archives

Mike

Mayen.Shah@xxxxxxxxxx wrote: 

#!/usr/bin/ksh 
# 

$ORACLE_HOME/bin/sqlplus -s /nolog <<eof1 

connect /as sysdba; 

RECOVER database using backup controlfile until cancel; 
cancel 
exit 0; 
eof1 


HTH 
Mayen 





"Bala" <oratips@xxxxxxxxx> 
Sent by: oracle-l-bounce@xxxxxxxxxxxxx 
Feb 12 2009 11:17 PM 

Please respond to
oratips@xxxxxxxxx



To
"oracle-l" <oracle-l@xxxxxxxxxxxxx> 
cc

Subject
Unix Shell Script Help



How do i supply "Cancel" in a Unix Shell script after the SQLPLUS command  

 
RECOVER DATABASE USING BACKUP CONTROLFILE UNTIL CANCEL; 
 
any tips/ suggestions highly appreciated. 
 
Thanks in Advance 
 
( Hot backup, HP unix, Oracle 10.2.0.4)

-- 
Bala Rao 

Other related posts: