1. Como root, creas un script /etc/init.d/dbora (o con el nombre que
quieras). El contenido del script es:
#!/bin/sh
# chkconfig: 345 11 12
# description: Oracle auto start-stop script.
#
# Set ORA_HOME to be equivalent to the $ORACLE_HOME
# from which you wish to execute dbstart and dbshut;
#
# Set ORA_OWNER to the user id of the owner of the
# Oracle database in ORA_HOME.
ORA_HOME=/aqui/poner/el/path/a/ORACLE/HOME
ORA_OWNER=oracle
if [ ! -f $ORA_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 - $ORA_OWNER -c "$ORA_HOME/bin/dbstart $ORA_HOME"
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 - $ORA_OWNER -c "$ORA_HOME/bin/dbshut $ORA_HOME"
su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl stop"
rm -f /var/lock/subsys/dbora
;;
esac
En la línea que define ORA_HOME, tienes que cambiar y poner el
ORACLE_HOME de la BD que quieres arrancar. En la línea que define
ORA_OWNER, tienes que poner con qué usuario quieres arrancar oracle, si
es un usuario distinto de "oracle".
2. Incluir el servicio en el arranque del sistema.
En sistemas Red Hat / CentOS se puede hacer mediante el siguiente
comando (como root):
chkconfig --add dbora (si has llamado al script de otra forma sustituye "dbora" por el nombre que sea).
3. En algunas versiones de Oracle, el archivo $ORACLE_HOME/bin/dbstart
tiene un error. Busca una línea que dice:
ORACLE_HOME_LISTNER=/ade/vikrkuma_new/oracle
si la encuentras, hay que sustituir "/ade/vikrkuma_new/oracle" por el
ORACLE_HOME bueno, que normalmente es el mismo que hemos puesto en el
script en la línea de ORA_HOME.
4. En el archivo /etc/oratab, busca la instancia que quieras que se
arranque automáticamente, y cambia el flag de autoarranque (el Y/N del
final de cada línea). Las instancias que lo tienen en 'Y' se arrancan
automáticamente, las otras no. Por ejemplo:
TSH1:/u01/app/oracle/product/9.2.0:Y
Marca para arrancar automáticamente la instancia TSH1 en la ORACLE_HOME "/u01/app/oracle/product/9.2.0".
Y con esto ya deberia de arrancar automaticamente
No hay comentarios:
Publicar un comentario