Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: starting and stopping db instances
Hey David,
He wants to run it from NT. He's already using a shell script.
David F. Newman <buzzwang_at_damocles.ourvillage.com> wrote in message
news:86oggudkbm.fsf_at_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:30:10 CDT
![]() |
![]() |