Automating Oracle Database Startup and Shutdown On Linux SOP
Automating Oracle Database Startup and Shutdown On Linux SOP
oracle
VM
-- /oracle
[oracle@localhost /]# echo $ORACLE_HOME
-- /oracle/db10g
[oracle@localhost /]# echo $ORACLE_SID
-- oracle sid
root
root
root
oracle
/etc/oratab
# oracle sid:/oracle/db10g:N
Change value from N to Y for the scripts to start or shut down the database
oracle sid:/oracle/db10g:Y
VM
$ORACLE_HOME/bin/dbstart
ORACLE_HOME_LISTNER=$ORACLE_HOME
root
/etc/init.d/dbora
#!/bin/sh
# chkconfig: 345 99 10
# description: Oracle auto start-stop script.
#
ORA_HOME=/oracle/db10g
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
# Remove "&" if you don't want startup as a background process.
# su $ORA_OWNER -c "$ORA_HOME/bin/dbstart $ORA_HOME" &
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
root
root
root
/etc/init.d/dbora
Change privileges and permissions of /etc/init.d/oracle