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: startup and shutdown oracle in solaris 8

Re: startup and shutdown oracle in solaris 8

From: David Fitzjarrell <oratune_at_aol.com>
Date: Thu, 30 Nov 2000 19:57:07 GMT
Message-ID: <906bef$jrv$1@nnrp1.deja.com>

In our last gripping episode ora_error_at_my-deja.com wrote:
> Why don't just use oratab?
>
> __________________
>
> In article <905viq$8un$1_at_nnrp1.deja.com>,
> David Fitzjarrell <oratune_at_aol.com> wrote:
> > In our last gripping episode Chris Lee <clee_at_innocent.com> wrote:
> > > Hi,
> > >
> > > My company just installed Oracle 8i on a solaris 8 machine. Right
 now,
> > > we have to start and shutdown the database manually. We would like
 to
> > > change it so that when the system starts, it will start the
 database
 and
> > > the listener, and when the system shutdowns, it will shutdown the
> > > database and the listener too. Does anyone knows how I can do it?
> > >
> > > Thanks,
> > >
> > > -- Chris
> > >
> >
> > That can be accomplished with the rc scripts used when the system
 boots
> > and shuts down. Most UNIX systems have /etc/rc?.d directories along
> > with an /etc/init.d directory. The /etc/init.d directory is used to
> > hold scripts designed to start and stop services; the scripts are
 named
> > after the service. For your Oracle database and listener you would
> > create a short script to start services or stop them depending upon
 the
> > parameter sent to the script. An example follows:
> >
> > #!/bin/sh
> > #
> > # oracle
> > #
> > # Start or stop Oracle services automatically
> > #
> > # Used at system boot or system shutdown
> > #
> >
> > case $1 in
> > 'start') su - oracle -c "dbstart"
> > su - oracle -c "lsnrctl start";;
> > 'stop') su - oracle -c "lsnrctl stop"
> > su - oracle -c "dbshut";;
> > *) echo "Invalid parameter"
> > echo "USAGE: `basename $0` start|stop";;
> > esac
> >
> > This script should be named 'oracle' and placed in /etc/init.d.
 Links
> > to this script should be made in the proper rc?.d directory -- most
> > UNIX systems boot to run level 3, therefore the links to this script
> > should be in /etc/rc3.d. The links should start with S?? (to start
 the
> > service) or K?? (to kill, or stop, the service). Examples of
 possible
> > link names are listed below:
> >
> > S99oracle
> > K01oracle
> >
> > Normally one would locate the oracle service as one of the last
> > services to start and one of the first services to stop, hence the
 S99
> > (probably the last 'S' entry in the rc3.d directory) and the K01
 (one
> > of the first 'K' entries in rc3.d). These links are symbolic links,
 or
> > symlinks as the terminology goes. If you are not familiar with
> > creating such links the syntax is:
> >
> > ln -s /etc/init.d/oracle /etc/rc3.d/S99oracle
> > ln -s /etc/init.d/oracle /etc/rc3.d/K01oracle
> >
> > Presuming the system only uses run level 3 or is shut down these are
> > the only two links you need. Once the system leaves run level 3
> > (presumably by executing a shutdown) the Oracle services are stopped
> > and no longer available. Once the system enters run level 3 the
 Oracle
> > services are started (both the database and the listener) and,
 barring
> > any errors, the database and listener are ready for users.
> >
> > If you have any trouble getting this set up please feel free to
 email
> > me at oratune_at_aol.com or davidf_at_bcgsystems.com.
> >
> > --
> > David Fitzjarrell
> > Oracle Certified DBA
> >
> > Sent via Deja.com http://www.deja.com/
> > Before you buy.
> >
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>

One can see why your handle is 'ora_error'. Apparently you haven't taken the time to examine the dbstart and dbshut scripts in $ORACLE_HOME/bin. If you had you would know that both scripts utilize /etc/oratab to determine which instances are available and which are set to auto-start. All oratab contains is a colon-delimited list of instance-specific parameters -- SID, ORACLE_HOME, and a 'Y' or 'N' to inform the scripts whether to auto-start the instance listed or not. There is nothing more that /etc/oratab can accomplish. Your suggestion, therefore, has no merit.

Please properly research your responses before issuing them.

--
David Fitzjarrell
Oracle Certified DBA


Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Thu Nov 30 2000 - 13:57:07 CST

Original text of this message

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