SID:<value_of_the_oracle_home>:[Y|N]For exemple, to register for automatic startup the DB11G instance :
DB11G:/opt/oracle/11.2.0:YNext, create a file called "/etc/init.d/dbora" as the root user, containing the following :
#!/bin/sh
# chkconfig: 345 99 10
# description: Oracle auto start-stop script.
#
ORACLE_HOME=/opt/oracle/11.2.0
ORACLE_OWNER=oracle
if [ ! -f $ORACLE_HOME/bin/dbstart ]
then
echo "Oracle startup: cannot start"
exit
fi
case "$1" in
'start')
# Start the Oracle databases:
# The following command assumes that the oracle login
# will not prompt the user for any values
su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/lsnrctl start"
su - $ORACLE_OWNER -c $ORACLE_HOME/bin/dbstart
touch /var/lock/subsys/dbora
;;
'stop')
# Stop the Oracle databases:
# The following command assumes that the oracle login
# will not prompt the user for any values
su - $ORACLE_OWNER -c $ORACLE_HOME/bin/dbshut
su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/lsnrctl stop"
rm -f /var/lock/subsys/dbora
;;
esac
Set the dbora file in the dba group :$> chgrp dba dboraUse the chmod command to set the privileges to 750:
$> chmod 750 /etc/init.d/dboraAssociate the dbora service with the appropriate run levels and set it to auto-start using the following command:
$> chkconfig --add dbora
links :
For Oracle 10.2 see http://docs.oracle.com/cd/B19306_01/server.102/b15658/strt_stp.htm#CFAHAHGA
For Oracle 11.2 see http://docs.oracle.com/cd/E11882_01/server.112/e10839/strt_stp.htm#BABGDGHF
