System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

Init scripts for Oracle startup/shutdown on reboot new twist

Stephanie Gonos
Occasional Contributor

Init scripts for Oracle startup/shutdown on reboot new twist

I've read an older forumn about dbora and it's location and starting up. But my machine is different and I am puzzled by it.

I have HP-UX 11.31 u ia64 running. My init.d
file is under /sbin not etc. I see combinations of S & K scripts in the rc2,rc3,rc0.d directories.

my dbora is under /sbin/init.d/dbora, as root
I issue a ./dbora stop and all works, I write
to a startup or shutdown log.

When I issue a shutdown -r now, of course the
database is shutdown and doesn't come up.
Does any one know what the correct rcX. d the links should be made in ? is my shutdown command correct ?

Appreciate your help.
3 REPLIES
Steven E. Protter
Exalted Contributor

Re: Init scripts for Oracle startup/shutdown on reboot new twist

Shalom,

Oracle scripts should not be ever run by root.

Never.

Any scripts performing this function need to use su to become oracle and execute under oracle.

/usr/bin/su - oracle -c "command:

/sbin/init.d is the same as /etc/init.d under Linux. This is where the init scripts linked to in rc3 and rc2 should link.

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
Raynald Boucher
Super Advisor

Re: Init scripts for Oracle startup/shutdown on reboot new twist

SEP is right.

Another thing to consider is the sequence of the startup scripts. You cannot start oracle before starting a process / demon on which oracle depends. A crude example: disks must be up before the database can be started.

Also don't forget about oracle sqlnet / listener and network dependancies.
Matti_Kurkela
Honored Contributor

Re: Init scripts for Oracle startup/shutdown on reboot new twist

"dbora" is the standard name for Oracle DB startup/shutdown script examples provided by Oracle (and others).

In modern versions of Oracle, the example scripts already include the necessary "su" commands.

Examples of examples:
http://www.oracle-base.com/articles/linux/AutomatingDatabaseStartupAndShutdownOnLinux.php

http://www.remote-dba.net/t_grid_db_startup_shutdown.htm


As Raynald says, the correct ordering depends on your system configuration. Disks must be up before database can be started, and database must be up before starting an application that uses the database.

Likewise, the shutdown should happen in the reverse order: the applications must stop first, then the database, and the disks will be among the last.

MK
MK