1. change /etc/oratab as oracle
ORCL:/u01/app/oracle/product/11.2.0/db_1:Y
|
2. As root user create new file with name oracle - for startup and shutdown the database in /etc/init.d/ directory:
#!/bin/bash
#
# oracle Init file for starting and stopping
# Oracle Database. Script is valid for 10g and 11g versions.
#
# chkconfig: 35 80 30
# description: Oracle Database startup script
# Source function library.
. /etc/rc.d/init.d/functions
ORACLE_OWNER="oracle"
ORACLE_HOME="/u01/app/oracle/product/11.2.0/db_1"
case "$1" in
start)
echo -n $"Starting Oracle DB:"
su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/dbstart $ORACLE_HOME"
echo "OK"
;;
stop)
echo -n $"Stopping Oracle DB:"
su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/dbshut $ORACLE_HOME"
echo "OK"
;;
*)
echo $"Usage: $0 {start|stop}"
esac
|
3. As root change the permissions and configure runlevel:
chmod 750 /etc/init.d/oracle
chkconfig --add oracle --level 0356
|
Comments
Post a Comment