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

Home -> Community -> Usenet -> c.d.o.server -> Re: starting and stopping db instances

Re: starting and stopping db instances

From: David F. Newman <buzzwang_at_damocles.ourvillage.com>
Date: 30 Jul 1999 15:11:25 -0400
Message-ID: <86oggudkbm.fsf@damocles.ourvillage.com>


chienli_at_uclink4.berkeley.edu writes:

> Hi,
>
> I have a problem that I can't figure out how to do or even know if it is
> possible.
>
> The problem is that I want to shutdown and startup an oracle instance
> everyone hour or so. Before, how we did it was to run a shell script on
> the server side to schedule a bunch of batch jobs. The shell script
> calls svrmgrl and connects internal to do shutdown and startup. Now I
> would like to do this from my NT client and do the same thing from a
> program I am writing.
>

Well,

        You could use a script like the following and just put it in cron to go off ever hour.

#!/bin/sh

ORACLE_SID=<insert SID here>
ORACLE_HOME=`grep "^${ORACLE_SID}:" /var/opt/oracle/oratab |cut -d: -f 2` export ORACLE_SID ORACLE_HOME

#########################

# Shutdown the database #
#########################

${ORACLE_HOME}/bin/svrmgrl <<END_OF_SHUTDOWN connect internal
shutdown immediate
END_OF_SHUTDOWN

######################

# Start the database #
######################

${ORACLE_HOME}/bin/svrmgrl <<END_OF_STARTUP connect internal
startup
END_OF_STARTUP --
David F. Newman
Oracle DBA
buzzwang_at_ourvillage.com Received on Fri Jul 30 1999 - 14:11:25 CDT

Original text of this message

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