how to do database automatic startup and shutdown [message #234029] |
Sun, 29 April 2007 02:26 |
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 #234133 is a reply to message #234051] |
Mon, 30 April 2007 02:24 |
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
|
|
|