Oracle AS10g Automatic Startup/Shutdown
This article describes a method to make Oracle AS10g start and stop automatically during server startup and shutdown on Linux.As the oracle user create a "dba" directory:
Next create a file called "startup" in the dba directory with the following contents:su - oracle mkdir $ORACLE_BASE/dba
The list of components to start should be altered to match your requirements.#!/bin/ksh dcmctl shutdown opmnctl stopall opmnctl start # ----------------------------------- # Adjust to start desired components. dcmctl start -ct ohs dcmctl start -co container1 dcmctl start -co container2 # ----------------------------------- emctl stop iasconsole emctl start iasconsole
Then create a file called "shutdown" in the dba directory with the following contents:
Make sure both files are executable:#!/bin/ksh dcmctl shutdown opmnctl stopall emctl stop iasconsole
As the root user create a file called "/etc/init.d/oracle" with the following contents:chmod u+x startup chmod u+x shutdown
#!/bin/sh
# chkconfig: 345 99 10
# description: Oracle auto start-stop script.
#
ORA_BASE=/u01/app/oracle
ORA_HOME=/u01/app/oracle/product/904_j2ee
ORA_OWNER=oracle
case "$1" in
'start')
# Start the Oracle databases:
su - $ORA_OWNER -c $ORA_BASE/dba/startup &
;;
'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_BASE/dba/shutdown &
;;
esac
Use chmod to set the privileges to 750:Associate the oracle service with the appropriate run levels and set it to auto-start:chmod 750 /etc/init.d/oracle
The relevant instances should now startup/shutdown automatically at system startup/shutdown.chkconfig --level 345 dbora on
Hope this helps. Regards Tim...
Back to the Top.
