mgsnl
asked on
Starting Oracle service automatically when server restarts
System : HP-Unix 11i, Oracle 8.1.7
I want to start the oracle instance and listener automatically whenever the HP-Unix server starts. How can this be achieved? Also what is to be done to shutdown the oracle instance when the server shuts down.
Thanks.
I want to start the oracle instance and listener automatically whenever the HP-Unix server starts. How can this be achieved? Also what is to be done to shutdown the oracle instance when the server shuts down.
Thanks.
Simple - use the oratab file (http://www.orafaq.com/faqunix.htm#ORATAB)
It's true you need the ORATAB defintion, but that's not enough.
First, make sure the entry for your database SID in the ORATAB file ends in a capital "Y". Eg:
# $ORACLE_SID:$ORACLE_HOME:[ N|Y]
#
ORCL:/u01/app/ora cle/product/8.0.5:Y
#
The scripts for starting and stopping databases are: $ORACLE_HOME/bin/dbstart and dbshut. SQL*Net (or Net8) is started with the lsnrctl command. Add the following entries to your /sbin/rc2.d/* file:
su - oracle -c "/path/to/$ORACLE_HOME/bin /dbstart" # Start DB's
su - oracle -c "/path/to/$ORACLE_HOME/bin /lsnrctl start" # Start listener
su - oracle -c "/path/tp/$ORACLE_HOME/bin /namesctl start" # Start OraNames (optional)
First, make sure the entry for your database SID in the ORATAB file ends in a capital "Y". Eg:
# $ORACLE_SID:$ORACLE_HOME:[
#
ORCL:/u01/app/ora cle/product/8.0.5:Y
#
The scripts for starting and stopping databases are: $ORACLE_HOME/bin/dbstart and dbshut. SQL*Net (or Net8) is started with the lsnrctl command. Add the following entries to your /sbin/rc2.d/* file:
su - oracle -c "/path/to/$ORACLE_HOME/bin
su - oracle -c "/path/to/$ORACLE_HOME/bin
su - oracle -c "/path/tp/$ORACLE_HOME/bin
ASKER
Thanks, but what is to be done to start the Listener along with the oracle instance?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Oracle always provides scripts dbstart & dbshut in Oracle_home/bin folder.
You need to create links for this scritps in /etc/rc.d/init.d folder. Shut script should be in starting with K in rc0 or rc1 folder and start script should be starting from S and in rc3 folder.
But as mentioned earlier you need to check the oratab file and this file will be refered in the scripts
/var/opt/oracle/oratab
It should contain list of all instances along with the home path and Y or N indicating whether to start or stop the db when dbstart & dbshut are called.
Alternatively you can create your own script as helpneed mentioned.
You need to create links for this scritps in /etc/rc.d/init.d folder. Shut script should be in starting with K in rc0 or rc1 folder and start script should be starting from S and in rc3 folder.
But as mentioned earlier you need to check the oratab file and this file will be refered in the scripts
/var/opt/oracle/oratab
It should contain list of all instances along with the home path and Y or N indicating whether to start or stop the db when dbstart & dbshut are called.
Alternatively you can create your own script as helpneed mentioned.
ASKER
Thanks for all your inputs. They have been very helpful. There is a slight confusion regarding the path of the files. My HP-Unix installation does not have a /etc/init.d folder. Instead there is a /sbin/init.d folder. Also the rc1.d, rc2.d, etc are in sbin (and not in etc). The version of HP-Unix is hpux-11i B.11.11, oracle version is 8.1.7.
hi
yes there will be some slight difference in these different flavours...thats ok
so with that differences u can go ahead and do the things with good results
enjoy madi
yes there will be some slight difference in these different flavours...thats ok
so with that differences u can go ahead and do the things with good results
enjoy madi