Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: temporary shutdown ?

Re: temporary shutdown ?

From: Billy Verreynne <vslabs_at_onwe.co.za>
Date: Thu, 29 Oct 1998 12:24:57 +0200
Message-ID: <719ftq$qbk$1@hermes.is.co.za>


Marco Nedermeijer wrote in message <719453$8ju$1_at_newnews.nl.uu.net>...
>
>Is is possible to automaticly shutdown the database for 1 hour ?
>how ?

On most Unix systems this should work (script not tested as I do not have access at the moment to Unix):
--
# shutting down Oracle in 1 hour

# create a simple temp SQL script that does the shutdown echo "
  connect internal/mypassword
  shutdown immediate;
  exit;

         " > /tmp/~$$.sql

# create a simply Unix script that runs the above SQL script echo "
  svrmgr23 < /tmp/~$$.sql
  rm /tmp/~$$.sql
  rm /tmp/~$$.sh

         " > /tmp/~$$.sh

# now let's schedule the temp script to run in 1 hour at -m -f /tmp/~$$.sh now + 60 minutes
--

No funnies in this. The Unix "at" command is used to do the scheduling. We redirect STDIN to the SQL script when running server manager. And we delete the temp files in the temp script.

You should add some parameters to the script like the type of shutdown and the when, e.g.
# oracle-shutdown immediate 120
where immediate tells the script to do an immediate shutdown and 120 indicates the number of minutes.

For NT this will also work. Exactly the same logic as above - even down to the at command (though the at parameters are different for NT and you can not echo multiple lines into a file).

regards,
Billy Received on Thu Oct 29 1998 - 04:24:57 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US