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: Start-up script for Unix boxes

Re: Start-up script for Unix boxes

From: Richard Lloyd <rkl_at_csc.liv.ac.uk>
Date: Fri, 6 Nov 1998 10:17:45 GMT
Message-ID: <F1zwLL.25t@csc.liv.ac.uk>


[Posted and mailed]

In article <3641889C.87AD61AB_at_hotmail.com>, Mark Gourley <mark_gourley_at_hotmail.com> writes:
> However, this is not the case, and
> it means that whenever the box is rebooted Oracle is NOT restarted, and
> hence any applications which rely on it will not start either.

If you check out the Oracle manuals, they usually *do* mention that you have to put code in your startup and shutdown sequences for your machine, but you're right, the "root.sh" that you're supposed to run as root after the installation really should put this stuff on your system.

Also note that I had a heck of a job getting exactly the right code to put in my startup sequence because Oracle does weird stuff that works OK if you run lsnrctl start/dbstart (or the opposite to shut it down) from the command line, but in the context of a machine startup/shutdown doesn't work cos a terminal's not there.

Eventually, this syntax worked for me:

nohup su - oracle -c "/opt/oracle/bin/run_oracle start" </dev/null >/dev/null 2>&1 &

(and I wrote my own run_oracle script that just calls dbstart/lsnrctl start [or opposite if "stop" is passed] - the script also needs to set up your typical Oracle env vars (ORACLE_HOME etc. etc.)]

The Oracle 8.0.5 manual suggests that you can just get away with what you said, i.e.:

                su - oracle -c 'lsnrctl start'
                su - oracle -c 'dbstart'

This is *not* true, at least on HP-UX anyway. You have to nohup and background it and redirect stdin, stdout, stderr to /dev/null. After many shutdowns, reboots and hair-pulling, I finally got Oracle on HP-UX to smoothly shutdown and restart on a machine reboot - make sure you use "shutdown -r 0" and not "reboot -q" though !

Richard K. Lloyd,           E-mail: rkl_at_csc.liv.ac.uk
Connect,                       WWW: http://www.csc.liv.ac.uk/~rkl/

3, Brownlow Street,
Liverpool University,
Merseyside, UK. L69 3GL Received on Fri Nov 06 1998 - 04:17:45 CST

Original text of this message

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