Operating System - HP-UX
1748036 Members
4721 Online
108757 Solutions
New Discussion юеВ

Re: Oracle Startup / Shutdown Script

 
SOLVED
Go to solution
Gus Mestousis
Frequent Advisor

Oracle Startup / Shutdown Script

Does anyone have a working startup and shutdown script for Oracle 8 on HP-UX 11.00
Basically what I need is a script that I can run prior to a backup kicking off, to bring all the databses down, and then after the backup job is completed to bring them back up. This isn' the normal startup/shutdown script that runs on boot in rc.

ANy help would be appreciated.

Thanks,
Gus
Sure, let me just drop everything and work on your problem.
14 REPLIES 14
Steven E. Protter
Exalted Contributor

Re: Oracle Startup / Shutdown Script

Sorry it took me so long to get to you.

Attached is a tar file.

It contains these three files...

rwxr-xr-x 0/3 1079 Dec 24 08:08 2002 /usr/contrib/bin/shut.oracle
rwxr-xr-x 0/3 159 Dec 24 08:08 2002 /usr/contrib/bin/shutsid.sh
rwxr-x--- 0/3 1246 Nov 6 08:39 2002 /sbin/init.d/oracle


These scripts are designed to read the /etc/oratab file and shut down any instances desginated as Y or active at machine startup.

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
Printaporn_1
Esteemed Contributor

Re: Oracle Startup / Shutdown Script

Hi Gus,

$ORACLE_HOME/bin/dbshut

it will shutdown instance base on information in /etc/oratab.
enjoy any little thing in my life
Indira Aramandla
Honored Contributor

Re: Oracle Startup / Shutdown Script

Hi,

If you have all the working database defined in your /etc/oratab file the just call
the script $ORACLE_HOME/bin/dbshut to shutdown all the databases before the backup and then after the backup call
the script
$ORACLE_HOME/bin/dbstart

Never give up, Keep Trying
Radhakrishnan Venkatara
Trusted Contributor

Re: Oracle Startup / Shutdown Script

well

we normally uses dbshut and dbstart scripts in bin directory inside $ORACLE_HOME

radhakrishnan
Negative thinking is a highest form of Intelligence
Andreas D. Skjervold
Honored Contributor

Re: Oracle Startup / Shutdown Script

Hi

Just want to add that it might be wise to edit the dbshut script to do a "shutdown immediate" instead of the "shutdown [normal]"
This prevents you from having user sessions blocking the shutdown of the database and thus making the backup invalid.
("Shutdown normal" awaits the end of transactions before shutting down the instance)

rgds
Andreas
Only by ignoring what everyone think is important, can you be aware of what everyone ignores!
Yogeeraj_1
Honored Contributor
Solution

Re: Oracle Startup / Shutdown Script

hi Gus,

We use startup and shutdown scripts found in the /etc/rc*.d directories to make things happen. Many times, these just run a script "dbstart" and "dbshut".

It is preferable to do it yourself though.

Normally, you would setup (as root) the startup/shutdown script in /etc/rc3.d and /etc/rc0.d. Mine are /etc/rc3.d/S100oracle" (startup)and "/etc/rc0.d/K100oracle" (kill).

These scripts are actually a symbolic link to the single script /etc/init.d/oracle. It contains only:


#!/bin/sh

# Start/stop processes required for oracle

case "$1" in
'start')
su - oracle8i -c orastart
su - ias902 -c webstop
;;
'stop')
su - ias902 -c webstop
su - oracle8i -c orastop
;;
esac


In my case, i have 2 Oracle accounts on my machine, one for the 9iAS and 1 for the database. I run simply a script "orastart" to start stuff for them and "orastop" to stop them. I write orastart and orastop. The nice thing about this is that if oracle8i needs to add/remove something from its startup/shutdown -- he doesn't need to get root to update the script, he just modifies orastart/stop.


The orastart script for Oracle8i is as follows:

#!/bin/csh

lsnrctl start

svrmgrl << EOF
connect internal
startup
exit
EOF

Put it in $ORACLE_HOME/bin for Oracle8i. It starts the listener, starts the database.

The shutdown script is similar, it looks like:


#!/bin/csh

lsnrctl stop

svrmgrl << EOF
connect internal
shutdown immediate
exit
EOF


If I needed to start more then one listener, I would have the appropriate commands in there to do so.

This shows how to automate the starting of virtually anything (not just Oracle stuff) on HP-UX....


Hope this helps!

regards
Yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
Steven E. Protter
Exalted Contributor

Re: Oracle Startup / Shutdown Script

I would note the reason I don't use dbshut is that it sometimes hangs, making my cold backup window a real problem.

Same thing has happend during system shutdown.

My scripts solve both problems.

I hope that the earlier answers by myself or other help, if so, please throw the other guys some points.

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
Brian Crabtree
Honored Contributor

Re: Oracle Startup / Shutdown Script

Actually, your best option is to issue a "shutdown abort", "startup restrict", and a "shutdown immediate". This will disconnect all of the sessions (including hung ones not affected by a shutdown immediate) as well as clear up any lock issues that might occur and force all sessions into rollback. The restricted startup will keep any users without restricted session from logging in (ie: automated applications, users connecting directly, etc), and the shutdown immediate will ensure that you have a clean shutdown.

Thanks,

Brian
Dan Zucker
Regular Advisor

Re: Oracle Startup / Shutdown Script

I strongly suggest that the listener not be shutdown, started up, or queried.

I find that the commands that handle the listener require a terminal. There is probably a way around, but since the dtaa base is closed even with an open listener, I just do not bother.