Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

RECOVER AUTOMATIC STANDBY DATABASE; Script question

815 views
Skip to first unread message

ITAPORT06

unread,
Feb 22, 2004, 6:05:41 PM2/22/04
to
WIN NT Oracle 8i

I want to create a script BAT file (Win environment) in which the
standby database starts-up

Before setting the standby database into " Managed " mode, I must in
my case first execute rst the " Recovery automatic standby database "

This because manually shipped loggings have to be applied first by the
automatic command

My problem is that I want to excute this in a scipt unattend BUT:
" Recovery automatic standby database " command is always waiting for
an " CANCEL " reply after the last succesfull applied log file.

Who can tell me how I can give the " CANCEL" unattended in a scipt
so that I can schedule the script?

Thanks


startup NOMOUNT pfile=C:\Oracle\ORA81\admin\pfile\init.ORA

ALTER DATABASE MOUNT STANDBY DATABASE;

RECOVER AUTOMATIC STANDBY DATABASE;

(Here I need the cancel)

RECOVER MANAGED STANDBY DATABASE;

Niall Litchfield

unread,
Feb 23, 2004, 6:05:22 AM2/23/04
to
My log application sql script looks like this

set echo on
connect /@<tnsnames entry> as sysdba
spool c:\scripts\logapply.log
alter database recover automatic standby database until cancel;
alter database recover cancel;
spool off
exit

This is a manual standby but you get the idea

--
Niall Litchfield
Oracle DBA
Audit Commission UK
"ITAPORT06" <mok...@hotmail.com> wrote in message
news:ubbi301rq24fuc8jn...@4ax.com...

Chuck

unread,
Feb 23, 2004, 10:30:57 AM2/23/04
to
ITAPORT06 <mok...@hotmail.com> wrote in
news:ubbi301rq24fuc8jn...@4ax.com:

I do my automatic recovery a little different. Rather than specifying
AUTOMATIC on the command line, I let Oracle prompt me whether or not to
accept the suggested file name, then feed it a response of AUTO. When the
last available archived log is applied it automatically cancels. My
standbys are all on unix and the script looks like this. You should be
able to adapt the "here" document below to a sql script and redirect it
into a Windows version of sqlplus to achieve the same result.

sqlplus -s <<!
connect / as sysdba
startup nomount;
alter database mount standby database;
recover standby database
auto
recover managed standby database;
!
--
Chuck
Remove "_nospam" to reply by email

ITAPORT06

unread,
Feb 23, 2004, 2:24:07 PM2/23/04
to
Both thanks a lot for your help

Ton

unread,
Feb 24, 2004, 7:15:25 AM2/24/04
to
Chuck:

I tried your solution in the script but the situation is still the
same. The scripts is hanging and waiting for the manual answering of
CANCEL or AUTO
(See underneath)

I want to run the script unattended so that it will not hang. As
described in first msg under name ITAPORT06

Thanks

Statement processed.
ORA-00279: change 14285347 generated at 02/24/2004 10:44:32 needed for
thread 1
ORA-00289: suggestion :
D:\SUN_BACKUP_DATA\ORACLE_SUNL_ARC\SUNL_ARC_12199.ARC
ORA-00280: change 14285347 for thread 1 is in sequence #12199
Specify log: {<RET>=suggested | filename | AUTO | CANCEL}

Chuck

unread,
Feb 24, 2004, 2:02:25 PM2/24/04
to
76434...@compuserve.com (Ton) wrote in
news:4477604.04022...@posting.google.com:

I've found in some cases with windows you need to redirect the sql script
into sqlplus to get things to work. Instad of issuing a command like
"sqlplus @recover.sql", do this "sqlplus < recover.sql". Make sure the
recover.sql file contains all the commands from my previous post including
the connect.

Sybrand Bakker

unread,
Feb 24, 2004, 2:21:39 PM2/24/04
to
On 24 Feb 2004 04:15:25 -0800, 76434...@compuserve.com (Ton) wrote:

>
>I want to run the script unattended so that it will not hang. As
>described in first msg under name ITAPORT06

NOT possible.


--
Sybrand Bakker, Senior Oracle DBA

Niall Litchfield

unread,
Feb 24, 2004, 3:50:16 PM2/24/04
to
well the suggestion I made has been running successfully every 6 hours since
August 2003 on win2k...

--
Niall Litchfield
Oracle DBA
Audit Commission UK

*****************************************
Please include version and platform
and SQL where applicable
It makes life easier and increases the
likelihood of a good answer
******************************************
"Sybrand Bakker" <gooid...@sybrandb.demon.nl> wrote in message
news:o19n30d31frhmg8ld...@4ax.com...

ITAPORT06

unread,
Feb 24, 2004, 6:52:59 PM2/24/04
to
Thanks will test it tomorrow and will come back with the result.

Sybrand I was not sure with your " NOT Possible " reply if undertood
my goal well (maybe you did)

In short terms I want to give the CANCEL in the script as a answer for
RECOVER AUTOMATIC STANDBY DATABASE command so the script can continue
to set the dastabase into the " Standby Managed " mode after it has
applied the manual shipped log files.

Thanks



Niall Litchfield

unread,
Mar 2, 2004, 3:25:20 PM3/2/04
to
did you get anywhere?

--
Niall Litchfield
Oracle DBA
Audit Commission UK
*****************************************
Please include version and platform
and SQL where applicable
It makes life easier and increases the
likelihood of a good answer
******************************************

<ITAPORT06> wrote in message news:403be261...@news.hccnet.nl...

Ton

unread,
Mar 3, 2004, 10:02:09 AM3/3/04
to
Sorry Nial...... for not responding. WIN NT Oracle 8i 8.1.7.4
I appreciate your advice .....

I tried the following:

" alter database recover automatic standby database until cancel; "
" alter database recover cancel; "

The database still hangs after the " automatic recover " command
waiting for the log file which is not available yet.
Can only continue the script by the manual " cancel " and that is
what I want to prevent. It has to run unattended.

You told in an earlier mail that it is not hanging in your
environment. How is this possible?
Regards,

Ton
"Niall Litchfield" <niall.li...@dial.pipex.com> wrote in message news:<4044eda8$0$10131$cc9e...@news.dial.pipex.com>...

Niall Litchfield

unread,
Mar 3, 2004, 10:44:08 AM3/3/04
to
any chance of dropping me a mail offline - the compuserve address doesn't
work.

--
Niall Litchfield
Oracle DBA
Audit Commission UK

"Ton" <76434...@compuserve.com> wrote in message
news:4477604.04030...@posting.google.com...

0 new messages