Home » Infrastructure » Linux » how to do database automatic startup and shutdown
icon7.gif  how to do database automatic startup and shutdown [message #234029] Sun, 29 April 2007 02:26 Go to next message
bluepower
Messages: 10
Registered: April 2007
Location: new delhi
Junior Member
hey hii friendz,

dis is bhumika i've a query regarding database startup and shutdown scripts...I did d following steps on mah database bt its nt working don't know why i m new to dis oracle world nd seeking guidence...steps are:

1)login as root 
2)edit /etc/oratab
oracle_sid:oracle_home:Y(bhumi:/oracle/app/oracle/product/9.2.0:Y)
3)created script in /etc/rc.d/init.d/oracle.sh

#!/bin/sh
# chkconfig: 345 99 10
# description: Oracle auto start-stop script.
#
# Set ORA_HOME to be equivalent to the $ORACLE_HOME
# from which you wish to execute dbstart and dbshut;
#
# Set ORA_OWNER to the user id of the owner of the 
# Oracle database in ORA_HOME.

ORA_HOME=/oracle/app/oracle/product/9.2.0
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
su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl start"
su - $ORA_OWNER -c $ORA_HOME/bin/dbstart
;;
'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
su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl stop"
;;
esac

4)chmod 750 /etc/rc.d/init.d/oracle.sh
5)chgrp dba /etc/rc.d/init.d/oracle
6)chkconfig --add oracle.sh
7)restart the system
 after login as oracle,exported oracle_sid bt database was nt started......
9)when i performed chkconfig --list oracle.sh then it displayed status on at level 345


[mod-edit: add code tags]





plz gimme the solution as soon as possible....i'll be very thankful

[Updated on: Sun, 29 April 2007 04:12] by Moderator

Report message to a moderator

Re: how to do database automatic startup and shutdown [message #234051 is a reply to message #234029] Sun, 29 April 2007 04:12 Go to previous messageGo to next message
Mohammad Taj
Messages: 2412
Registered: September 2006
Location: Dubai, UAE
Senior Member

6)chkconfig --add oracle.sh

Are you sure it was add ?

you can also try with explicit add oracle.sh file for restart.

ln -s /etc/init.d/oracle /etc/rc.d/rc2.d/S99oracle
ln -s /etc/init.d/oracle /etc/rc.d/rc3.d/S99oracle
ln -s /etc/init.d/oracle /etc/rc.d/rc4.d/S99oracle
ln -s /etc/init.d/oracle /etc/rc.d/rc0.d/K01oracle
ln -s /etc/init.d/oracle /etc/rc.d/rc6.d/K01oracle



Regards
Taj
Re: how to do database automatic startup and shutdown [message #234133 is a reply to message #234051] Mon, 30 April 2007 02:24 Go to previous message
bluepower
Messages: 10
Registered: April 2007
Location: new delhi
Junior Member


thanks fr replying back sir.I want to ask u dt do i need to put .sh extention while creating the oracle script and if i want to create d links explicitly then have to put .sh or nt?

ln -s /etc/init.d/oracle /etc/rc.d/rc2.d/S99oracle.sh
ln -s /etc/init.d/oracle /etc/rc.d/rc3.d/S99oracle.sh
ln -s /etc/init.d/oracle /etc/rc.d/rc4.d/S99oracle.sh
ln -s /etc/init.d/oracle /etc/rc.d/rc0.d/K01oracle.sh
ln -s /etc/init.d/oracle /etc/rc.d/rc6.d/K01oracle.sh


yes,I m sure it was added bcoz when i restart d system nd performed chkconfig --list oracle.sh showed me 345 level on

Previous Topic: How to use SCP in non-interactive mode
Next Topic: Enterprise Linux 4 - Subscription number
Goto Forum:
  


Current Time: Thu Dec 08 12:45:18 CST 2016

Total time taken to generate the page: 0.11472 seconds