1844205 Members
2176 Online
110229 Solutions
New Discussion

Shutdown Script

 
Girish Agarwal_1
Occasional Advisor

Shutdown Script

Hi All,
I have installed Oracle Database 9.2.0 on HPUX 11.11 and I want Oracle database to be started on a normal system startup(init 3) and shutdown normally on a "shutdown" or "reboot" or a "init 0" command.
For this purpose I created a /etc/rc.config.d/oraconf file and in /sbin/init.d/dbstart I have all the 4 cases ( start_msg,stop_msg,start,stop ).I have linked the dbstart file from rc2.d and rc3.d and rc0.d. I have tested the startup part and it works fine.
I have some doubt about the shutdown part. How to accurately verify that the shutdown script ran viz is there any log file which will display that. I have a link
lrwxr-xr-x 1 root sys 17 Apr 22 18:41 K901dbshutdown -> ../i
nit.d/dbstart. PLease find the dbstart file attached

Thanks,
Girish
7 REPLIES 7
Ian Dennison_1
Honored Contributor

Re: Shutdown Script

/etc/rc.log.old

Still trying to work out if this is a trick question.

Share and Enjoy! Ian
Building a dumber user
Ian Dennison_1
Honored Contributor

Re: Shutdown Script

PS "reboot" is the caveman way of shutting down a server, it does not follow the shutdown run levels at all!

Maybe thats the problem here?
Building a dumber user
Girish Agarwal_1
Occasional Advisor

Re: Shutdown Script

Hi Ian,
I checked the /etc/rc.log.old file and there is no indication of any Kill scripts having been executed.
Also,If not reboot then what is the preferred method of restarting a machine either thru' a script or remotely?
I have tried shutdown, init 0 and reboot on this machine and see that it displays messages like syncing and closing open volumes. So my guess will be that scripts from some rc directory is executed, and it looks more likely from rc1.d.
Do you know if there is any harm in putting the kill script in the rc0,rc1 and rc2 directories?

Thanks,
Girish
Jeroen Peereboom
Honored Contributor

Re: Shutdown Script

L.S,

S-script in rcN.d directory and K-script in RC directory. So in your case, since you start in 2 and 3, the kill would be in rc1.d

Where do you check Oracle's shutdown if you shut it down yourself?

JP.
Sanjay_6
Honored Contributor

Re: Shutdown Script

Hi Girish,

The kill script log would be in /etc/rc.log.old.

The rc.log file gets created when the system is started. It is updated again when the system is going through a normal shutdown and then renamed as rc.log.old when the system is booted again, with a fresh rc.log file created for the new startup logs.

Hope this helps.

Regds
Sanjay_6
Honored Contributor

Re: Shutdown Script

Hi,

Check your script.

echo ORA_SERVER not set to one in /etc/rc.config.d/nfsconf, exiting.

Should be

echo ORA_SERVER not set to 1 in /etc/rc.config.d/oraconf, exiting.

And during the startup phase,

first shutdown the oracle database and then shutdown the listener and not in the order you are doing now.

Hope this helps.

Regds
Girish Agarwal_1
Occasional Advisor

Re: Shutdown Script

Hi,
In reply to Sanjay, I modified the script as per your suggestion. Thanks
In reply to Jereon,Thanks for your suggestion, I have put the script in rc0.d,rc1.d and rc2.d directories. I am rebooting the machine at the console, and in my script I have an echo statement which will print a line in the stop case. I am hoping to see that echo getting printed everytime I shutdown,init 0 or reboot the Machine, so I know that Oracle is shutdown.

Please let me know, If what I am doing is incorrect.

Thanks,
Girish