The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > OS Specific Forums > Linux
Google UNIX.COM


Linux RedHat, Ubuntu, SUSE, Fedora, Debian, Mandriva, Slackware, Gentoo linux, PCLinuxOS. All Linux questions here!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Shutdown aewpcoles UNIX for Advanced & Expert Users 6 08-03-2006 06:46 AM
Startup/Shutdown scripts vincente AIX 1 05-23-2006 10:30 AM
Shutdown Scripts zheng_soon Shell Programming and Scripting 4 07-08-2003 09:53 PM
rc scripts, do i need to kill them on shutdown? kymberm UNIX for Advanced & Expert Users 1 02-10-2003 07:57 AM
to shutdown rajashekaran UNIX for Advanced & Expert Users 2 02-18-2002 10:42 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 05-11-2005
Registered User
 

Join Date: Mar 2005
Posts: 41
Shutdown scripts

Hello all

I'm trying to automate the startup/shutdown of my database whenever the OS is bounced ...

OS : Linux (Kernel : 2.4.20.-6)
Oracle : 9.2.0.5

The contents of /etc/init.d/dbora file is listed below

case "$1" in

'start')
su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/dbstart"
su - $ORACLE_OWNER -c "lsnrctl start LISTENER"
su - $ORACLE_OWNER -c "agentctl start"
;;
'stop')
su - $ORACLE_OWNER -c "agentctl stop"
su - $ORACLE_OWNER -c "lsnrctl stop LISTENER"
su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/dbshut"
;;
*)
echo $"Usage: $prog {start|stop}"
exit 1
esac
exit

Contents of /etc/oratab is
ORA920:/u01/app/oracle/product/9.2.0:Y


I created all the required links

ln -s /etc/init.d/dbora /etc/rc3.d/S99dbora
ln -s /etc/init.d/dbora /etc/rc4.d/S99dbora
ln -s /etc/init.d/dbora /etc/rc5.d/S99dbora
ln -s /etc/init.d/dbora /etc/rc0.d/K10dbora
ln -s /etc/init.d/dbora /etc/rc6.d/K10dbora

I shutdown the Linux system using both init 6 and init 0 and in both cases the automation process started up the oracle instance but it did not shut the oracle instance down before shutting down Linux system.My S* scripts are working fine but not my K* scripts. Am I missing something here ?

PS:
There are 2 files in /etc/rc0.d and /etc/rc6.d ,

S00killall -> ../init.d/killall*
S01reboot -> ../init.d/halt*

Why are these S* scripts in rc0 and rc6 directories ...Seems to me like these S* scripts are getting executed before the K* scripts in in /etc/rc0.d and /etc/rc6.d ...but I'm not sure what is really going on here ...

Thanks
Reply With Quote
Forum Sponsor
  #2  
Old 05-15-2005
zazzybob's Avatar
Registered Geek
 

Join Date: Dec 2003
Location: Melbourne, Australia
Posts: 2,100
Some flavours of Linux have their own ideas about Startup and Shutdown scripts.

For example - on SuSE Linux, changing runlevel from, say, runlevel 5 to runlevel 0 involves executing the K* scripts in the runlevel 5 directory before it leaves runlevel 5 for runlevel 0, which is different to traditional *nix.... So what you'll need to do is execute

Code:
ln -s /etc/init.d/dbora /etc/rc3.d/K10dbora
ln -s /etc/init.d/dbora /etc/rc4.d/K10dbora
ln -s /etc/init.d/dbora /etc/rc5.d/K10dbora
and that should fix it..

Think about it like this (for SuSE Linux, anyways ) - on entering runlevel X, the S* scripts in rcX.d are excuted. On leaving runlevel X, the K* scripts in rcX.d are executed.

Cheers
ZB
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 10:26 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0