RE: Implementing Continuous Managed Recovery on a Standby Databas

2002-12-06 Thread Stephen Lee

It's surprising you could do this since, as far as I know, if you start a
background process in ksh then try to exit the shell, you get prompted that
you have running jobs; if you type exit again, the jobs are killed.  

Two things I do are:

Instead of running nohup directly, run
sh -c /bin/nohup your_command 

or

echo command (including any redirects, if needed) | at now


 -Original Message-
 From: Orr, Steve [mailto:[EMAIL PROTECTED]]
 Sent: Friday, December 06, 2002 11:29 AM
 To: Multiple recipients of list ORACLE-L
 Subject: Implementing Continuous Managed Recovery on a 
 Standby Database
 
 
 Problem: How to keep a standby database in continuous managed recovery
 without having to maintain an open terminal session. (Version 8.1.7.2)
 
 When you execute the following...
 -- 
 SQL RECOVER MANAGED STANDBY DATABASE;
 -- 
 ...SQL*Plus does not return a prompt and the database is in continuous
 recovery BUT... as soon as you exit the session, recovery 
 discontiues and
 the logs are nolonger automagically applied. No problem, I 
 said, I'll
 just wrap it in a shell script and launch it in the 
 background. Doesn't
 work and it appears SQL*Plus is a misbehaving process. (Linux)
 
 So then I tried nohup:
 -- 
 $ nohup sqlplus / as sysdba @managed_recov.sql  
 [1] 23412 
 $ nohup: appending output to 'nohup.out' 
 [1]+ Exit 127 nohup sqlplus / as sysdba @managed_recov.sql 
 -- 
 The managed_recov.sql script contains this one line: 
 RECOVER MANAGED STANDBY DATABASE; 
 This works but it does not persist as a background process- 
 it terminates
 when I hit enter or leave the terminal session. I think it terminates
 because SQL*Plus is misbehaving. What do you think? 
 
 So with a little help from a *nix geek I did this...
 -- 
 sqlplus / as sysdba @managed_recov.sql /dev/null standby.log 
 -- 
 ...presto chango, it works- standard I/O is OK and running in the
 background. The standby DB is in continuous recovery and I 
 can shutdown my
 PC and go home and managed recovery just keeps on running. Cool.
 
 Is there a better way to do this? I submitted a TAR but OWS 
 hasn't been any
 help. Doesn't it seem lame that Oracle gives the RECOVER 
 MANAGED STANDBY
 DATABASE command but is unable to provide a means to 
 implement it without
 requiring the terminal session to remain open?
 
 
 Whining in Bozeman, Montana
 Steve Orr
 -- 
 Please see the official ORACLE-L FAQ: http://www.orafaq.com
 -- 
 Author: Orr, Steve
   INET: [EMAIL PROTECTED]
 
 Fat City Network Services-- 858-538-5051 http://www.fatcity.com
 San Diego, California-- Mailing list and web hosting services
 -
 To REMOVE yourself from this mailing list, send an E-Mail message
 to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
 the message BODY, include a line containing: UNSUB ORACLE-L
 (or the name of mailing list you want to be removed from).  You may
 also send the HELP command for other information (like subscribing).
 
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Stephen Lee
  INET: [EMAIL PROTECTED]

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).




RE: Implementing Continuous Managed Recovery on a Standby Databas

2002-12-06 Thread Orr, Steve
 I would go one more paranoid step further and redirect stderr too.
program  file  DOES redirect BOTH stdout and stderr. Or use 
program  file  for Bourne/bash... sigh.

socially_challenged_standing_in_the_background.sh/dev/null/dev/null 


Bozo in Bozeman, Montana



-Original Message-
Sent: Friday, December 06, 2002 11:09 AM
To: Multiple recipients of list ORACLE-L
Database



Quit whining =8-)

The behaviour is the same for any process that inherits it's stdin/stdout
and stderr from the parent. Once the parent (your shell) goes
away, the file handles are closed and the child has nothing to
talk to. You only half-solved the problem with the nohup. You
did the right thing by redirecting stdoutstdin was already
pointing to the script file. I would go one more paranoid step
further and redirect stderr too.

Jeff Herrick

On Fri, 6 Dec 2002, Orr, Steve wrote:

 Problem: How to keep a standby database in continuous managed recovery
 without having to maintain an open terminal session. (Version 8.1.7.2)

 When you execute the following...
 --
 SQL RECOVER MANAGED STANDBY DATABASE;
 --
 ...SQL*Plus does not return a prompt and the database is in continuous
 recovery BUT... as soon as you exit the session, recovery discontiues and
 the logs are nolonger automagically applied. No problem, I said, I'll
 just wrap it in a shell script and launch it in the background. Doesn't
 work and it appears SQL*Plus is a misbehaving process. (Linux)

 So then I tried nohup:
 --
 $ nohup sqlplus / as sysdba @managed_recov.sql 
 [1] 23412
 $ nohup: appending output to 'nohup.out'
 [1]+ Exit 127 nohup sqlplus / as sysdba @managed_recov.sql
 --
 The managed_recov.sql script contains this one line:
 RECOVER MANAGED STANDBY DATABASE;
 This works but it does not persist as a background process- it terminates
 when I hit enter or leave the terminal session. I think it terminates
 because SQL*Plus is misbehaving. What do you think?

 So with a little help from a *nix geek I did this...
 --
 sqlplus / as sysdba @managed_recov.sql /dev/null standby.log 
 --
 ...presto chango, it works- standard I/O is OK and running in the
 background. The standby DB is in continuous recovery and I can shutdown my
 PC and go home and managed recovery just keeps on running. Cool.

 Is there a better way to do this? I submitted a TAR but OWS hasn't been
any
 help. Doesn't it seem lame that Oracle gives the RECOVER MANAGED STANDBY
 DATABASE command but is unable to provide a means to implement it without
 requiring the terminal session to remain open?


 Whining in Bozeman, Montana
 Steve Orr

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Orr, Steve
  INET: [EMAIL PROTECTED]

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).