1752793 Members
6127 Online
108789 Solutions
New Discussion юеВ

Re: Dbshut and dbstart

 
SOLVED
Go to solution
Qcheck
Super Advisor

Dbshut and dbstart

Hi All,

I am unixadmin and dba's gave the scripts to start the oracle when server reboots and stop the database gracefully when the server is going to reboot/shutdown.

Now the problem is it doesn't stop the database and hangs there...

What I did was, created the following files:

/sbin/init.d/dbshut
/sbin/init.d/dbstart

And linked as follows:

/sbin/rc0.d/K01dshut -> /sbin/init.d/dbshut
/sbin/rc3.d/S824dbstart -> /sbin/init.d/dbstart

And when rebooted the server, oracle didn't come up.

Any ideas, how to put startup and shutdown scripts in HPUX.

Thanks
21 REPLIES 21
Rick Garland
Honored Contributor

Re: Dbshut and dbstart

For the dbshut, is the 'shutdown immediate' included, or is it just 'shutdown'

Qcheck
Super Advisor

Re: Dbshut and dbstart

Hi Rick,

Thanks for the response but where should I include 'shutdown immediate'?

Thanks
Steven E. Protter
Exalted Contributor
Solution

Re: Dbshut and dbstart

Shalom,

dbshut ships with a bug.

It should say shutdown immediate but says shutdown.

shutdown waits for the users to terminate their sessions, which means pretty much forever.

change dbshut and you should be fine.

There are however not bugs that I know of in dbstart.

Put a set -x in the top of that script and/or redirect the output to a file and restart your server for further diagnostics.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Qcheck
Super Advisor

Re: Dbshut and dbstart

Hi Steve,

Still I didn't get.

Instaed of /sbin/init.d/dbshut are you saying to put /sbin/init.d/shutdown?

Thanks
David Bellamy
Respected Contributor

Re: Dbshut and dbstart

Hello Pratibha the dbshut and dbstart scripts should also be copied to the /etc/rc.config.d
directory.
Rick Garland
Honored Contributor

Re: Dbshut and dbstart

As SEP has stated, in the dbshut is the command 'shutdown' - this should be 'shutdown immediate'

This would hang the shutdown because the database is waiting for all connections to be closed. If users are working, or do not logout, connections will never close and the shutdown will not complete.

Qcheck
Super Advisor

Re: Dbshut and dbstart

The dbshut script has the following:

#!/usr/bin/sh

/usr/bin/su oracle -c '

Thanks
DCE
Honored Contributor

Re: Dbshut and dbstart


You need to modify the dbshut script.

vi the file and look the for the line containing shutdown

change the line to shutdown immediate

HTH DCE
Greg Vaidman
Respected Contributor

Re: Dbshut and dbstart

you probably don't want to run dbshut and dbstart directly out of the sytem startup like you're doing, since they usually should be executed by the oracle user (usually "oracle"). You'll want to make a copy of /sbin/init.d/template and put an su to your oracle user to run those commands, e.g.,

su - oracle -c "/opt/oracle/product/9.2.0/bin/dbstart"

etc.

you can make one script that does the dbshut in response to the "stop" parameter and dbstart in response to the "start" parameter. then create the links as you have above, but to the new script.