Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Oracle startup/shutdown scripts for UNIX

Status
Not open for further replies.

sunguru99

MIS
Dec 3, 2003
13
0
0
US
I need to be able to do a cold backup of an Oracle database with a script. In order to do this, I need to shutdown/startup the Database automatically with a script. Here is a list of the manual commands to shutdown and startup the database:

su - applmgr

cd /usr/local/bin

. stopmanagers.sh shnp

su - oracle

svrmgrl

connect internal

shutdown immediate


-----------------------------------------------------------


su - applmgr

cd /usr/local/bin

. startmanagers.sh chnp

su - oracle

svrmgrl

connect internal

startup

Could someone help me with this?
 
the start and stop script I got from the dba's looks like the following:

Code:
# cd /etc/rc3.d
# ls
README          S15nfs.server   S50apache       S77dmi          S89sshd
S13kdc.master   S16boot.server  S50oracle       S80mipagent     S90samba
S14kdc          S34dhcp         S76snmpdx       S81volmgt       S99nagios
# more S50oracle
#!/sbin/sh
ORA_HOME=/oracle/u01/app/oracle/product/8.1.7
ORA_OWNER=oracle

if [ ! -f $ORA_HOME/bin/dbstart -o ! -d $ORA_HOME ]
then
echo "Oracle startup: cannot start"
exit
fi

case "$1" in
'start')
su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl start listener"
su - $ORA_OWNER -c $ORA_HOME/bin/dbstart
su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl dbsnmp_start"
;;
'stop')
su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl dbsnmp_stop"
su - $ORA_OWNER -c $ORA_HOME/bin/dbshut
su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl stop listener"
;;
esac

#

hth...

Best Regards, Franz
--
Solaris System Manager from Munich, Germany
I used to work for Sun Microsystems Support (EMEA) for 5 years
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top