Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: automating shutdown,startup??
Jason Berryhill wrote:
> I would like to be able to automate shutdown, backup, and restart of my
> db from witin a cron job.
>
> Here is my specific question ==> how do I run a script from the command
> line with server manager in line mode? The documentation I have does not
> mention how to do this (at least I haven't found it yet).
Running server manager from the command line is performed in the same way as you would SQL*PLUS e.g.
svrmgrl -s <<! 1>$ORALOG 2>&1
connect internal;
shutdown immediate;
!
where $ORALOG is merely an environment variable pointing to a log file and
the ! (can be anything) is used to terminate the code to be executed by
svrmgr. Note that this delimiter has to be in charcter position 1 of the
line.
Also when writing the cron script you must remember to explicitly declare
all your environment variables e.g. ORACLE_SID, ORACLE_HOME, PATH as the
cron routine does not inherit these values from the submitting user.
Hope this helps,
Ian Received on Mon Nov 03 1997 - 00:00:00 CST