My environment is CentOS 6.2 64-bit system. I’ve installed Oracle Database 11gR2 in it. This post provides the steps to automate the start/stop process of Oracle database.
What do we achieve through this:
Follow the below steps:
<SID>:<ORACLE_HOME>:Y
#!/bin/sh
# chkconfig: 345 99 10
# description: Oracle auto start-stop script.
#
# Set ORA_OWNER to the user id of the owner of the
# Oracle database software.
ORA_HOME=/opt/Oracle/db11gR2/product/11.2.0/dbhome_1
ORA_OWNER=oracle
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”
rm -f /var/lock/subsys/dbora
;;
esac
We’re done. Now to start the database run the command service dbora start as root user. Similarly to stop the database run the command service dbora stop as root user.
Verify the below screenshots for start/stop commands output. In my environment orcl is the SID.
References:
Metalink note 222813.1
NOTE: For 10g database, the steps are little different, follow the oracle documentation in such case.
I am engulfed in Oracle Identity & Access Management domain. I have expertise on providing the optimized solutions for user provisioning, web access management, Single Sign-On and federation capabilities etc., I am also well versed with complex integrations within Identity Management and other product domains. I have expertise on building demos and implementation experience on products Oracle Access Manager, Oracle Adaptive Access Manager, Oracle Entitlement Server, Oracle Virtual Directory, Oracle Internet Directory etc., Look @ my blog: http://talkidentity.blogspot.com