1) Create a file call dbora under the /etc/init.d/ and put the following content as root user
#! /bin/bash
#
# network Bring up/down networking
#
# chkconfig: 345 20 80
# description: Starts and stops the Oracle database and listeners
#
# /etc/rc.d/init.d/oracle
# See how we were called
export ORACLE_SID=grdprd
export TZ=UTC-08
export ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1
su oracle -c "$ORACLE_HOME/bin/lsnrctl stop LISTENER_UTC8"
su oracle -c "$ORACLE_HOME/bin/lsnrctl start LISTENER_UTC8"
echo $ORACLE_SID
su oracle -c "$ORACLE_HOME/bin/sqlplus '/ as sysdba'" << EOF
startup
EOF
2)
execute below as root user
chmod +x /etc/init.d/dbora
chkconfig --add dbora
No comments:
Post a Comment