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

Home -> Community -> Mailing Lists -> Oracle-L -> Re: Automatic database start in sun solaris

Re: Automatic database start in sun solaris

From: Don Granaman <granaman_at_home.com>
Date: Fri, 24 Aug 2001 11:24:06 -0700
Message-ID: <F001.003773BB.20010824114030@fatcity.com>

I agree. The general idea is:

  1. Set up /var/opt/oracle/oratab
  2. Create a script like the one below named, for example, "dbora" in /etc//init.d
  3. Create links to this script from /etc/rc0.d and /etc/rc2.d (e.g. ln -s /etc/init.d/dbora etc/rc0.d/K99dbora)

Now you only have to modify /var/opt/oracle/oratab and /etc/init.d/dbora for updates, additions, etc.
Be aware of any potential issues with dbshut - easily fixed script errors in 8i, shutdown normal vs shutdown immediate or transactional, etc. I often add a " $1" after "shutdown" in dbshut so I can call it with "dbshut immediate" or with just "dbshut". (I know, this goes against the recommendations and there are other ways, but this works for me.)

On very complex systems with a number of databases, instances, listeners, and with multiple versions of Oracle, I might create a set of master scripts like "startlsnr", "stoplsnr", "startora", and "stopora" in the local bin directory and call them from /etc/init.d/dbora. This is rather rare though.

-Don Granaman
[certifiable OraSaurus]

> In fact almost all of the files at rc0.d and rc2.d is linked to
/etc/init.d
> Do not forget to link the files Murosa has told you before
> Create a script something like oracle:
>
>
> #!/usr/bin/sh
> #variables
> ORA_HOME=/usr/u01/app/oracle/product/8.0.5
> ORA_OWNER=oracle # That shall be your oracle owner
>
> if [ ! -f $ORA_HOME/bin/dbstart ]
> then
> echo "Oracle startup: cannot start"
> exit
> fi
> case "$1" in
> 'start')
> #Starting Oracle
>
> su - $ORA_OWNER -c $ORA_HOME/bin/dbstart
> su - $ORA_OWNER -c "$ORA_HOME/bin/listener_start.pl"
> ;;
> 'stop')
>
> #Shutting down oracle
> su - $ORA_OWNER -c $ORA_HOME/bin/dbshut
> su - $ORA_OWNER -c "$ORA_HOME/bin/listener_stop.pl"
> ;;
> esac
>
> That would work. Feel free to ask me any questions if something goes
> wrong...
>
> "Do not criticize someone until you walked a mile in their shoes, that way
> when you criticize them, you are a mile a way and have their shoes."
>
> Okan
>
>
>
> ----- Original Message -----
> To: Multiple recipients of list ORACLE-L <ORACLE-L_at_fatcity.com>
> Sent: Friday, August 24, 2001 3:10 PM
>
>
> > Saroj, you must create two files, SXXXOracle and KXXXOracle,
> > in /etc/rc2.d, for example, where XXX are numbers. So when your machine
> > reboots that files starts Oracle Database and listeners. Well, first,
> > because second is to stop database and listener. This is a question of
> > Unix start. Due to I'm not really sure how can you do it, it's better
> > you see at that directory, /etc/rc2.d, and look any pair of files to
> > see it.
> >
> > Remenber SXXXOracle is to start Oracle and listeners and KXXXOracle
> > is to stop its.
> >
> > HTH
> >
> >
> >
>
> --
> Please see the official ORACLE-L FAQ: http://www.orafaq.com
> --
> Author: Okan CIMEN
> INET: okan_at_cimen.org
>
> Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
> San Diego, California -- Public Internet access / Mailing Lists
> --------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from). You may
> also send the HELP command for other information (like subscribing).
>

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Don Granaman
  INET: granaman_at_home.com

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Fri Aug 24 2001 - 13:24:06 CDT

Original text of this message

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