I am running CentOS 6 and I am trying to get my Oracle database to run at startup. I have been following these steps:
http://www.oracle-base.com/articles/linux/automating-database-startup-and-shutdown-on-linux.php (Oracle 11gR2 portion at bottom)
I have created this script and it is saved as /etc/init.d/dbora:
#!/bin/bash # 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_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 # Remove "&" if you don't want startup as a background process. su $ORA_OWNER -c "/home/oracle/scripts/startup.sh >> /home/oracle/scripts/startup_shutdown.log 2>&1" & 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 "/home/oracle/scripts/shutdown.sh >> /home/oracle/scripts/startup_shutdown.log 2>&1" rm -f /var/lock/subsys/dbora ;; esac
Next, I ran:
chmod 750 /etc/init.d/dbora
As per the instructions.
Finally, I added the script using chkconfig.
chkconfig --add dbora
I also added the scripts that the dbora file calls.
I am able to start the database using:
service dbora start
does not work.