Operating System - HP-UX
1838226 Members
3663 Online
110125 Solutions
New Discussion

Re: Oracle control script

 
SOLVED
Go to solution
Roberto Volsa
Frequent Advisor

Oracle control script

hello,
in the Oracle control script of my HA cluster, ther is the halt function for the Ora application with the "shutdown abort" command.
Can be this substituted with "shutdown immediate" command?
When the halt function is recalled?
Thanks a lot
5 REPLIES 5
A. Clay Stephenson
Acclaimed Contributor

Re: Oracle control script

I would certainly make this change. I suppose someone was impatient with how long a 'shutdown immediate' might take and used 'shutdown abort' without uderstanding the consequences.
If it ain't broke, I can fix that.
Volker Borowski
Honored Contributor
Solution

Re: Oracle control script

Hello,
sorry to contradict, but there are situations, where a shutdown immediate will not be able to shut down the database.

So even if a HA detects there is need to switchover and decides for a shutdown, it might be that the reason for the switchover will not allow to do a shutdown immediate.

Example: If you loose the disk-controller that writes to the rollback tablespace, a shutdown immediate is not possible, because a shutdown immediate will not be able to do the rollback for the transactions to be closed. The only way out is a shutdown abort and do the rollback upon instance startup on the failover node.

Although I'd prefer to do this only in case of a switch. For administration purposes I suggest to have additional scripts to do a shutdown immediate.

Hope this helps
Volker
Pierce Byrne_1
Frequent Advisor

Re: Oracle control script

I would call a seperate script to shutdown the database which uses shutdown immediate. call this script in background from HA script, sleep for what you think is a reasonable time based on normal shutdowns, then check if oracle still up, if it is then call shutdown abort at that stage only.
shutdown abort is only a last resort.

eg.
# call shutdown script
$MYLOCALBIN/oracle_shutdown $ORACLE_SID immediate &
sleep 120
# check if shutdown script still running
ps -ef | grep $MYLOCALBIN/oracle_shutdown | grep -v grep
# if it is call with abort sledgehammer
if [ $? -ne 0 ]
then
$MYLOCALBIN/oracle_shutdown $ORACLE_SID abort
fi


melvyn burnard
Honored Contributor

Re: Oracle control script

There is a reason for why this is so, and I quote:

The reasoning for this treatment is seen in the accompanying toolkit README
file:

# Stops the database with a "shutdown abort" versus use of the command
# call "ORACLE_TEST0.sh shutdown" which uses "shutdown immediate" for a clean
# database shutdown. Stop must use "abort" to guarantee the database stops
# in time to be able to startup on another node.


Should a graceful shutdown of Oracle be required, the Oracle.sh script can
be exercised using the "shutdown" option. Prior to this however, package
switching for the Oracle package must be disabled. The "shutdown"
performs a "shutdown immediate", terminating all Oracle PIDs the monitor
version of the script is watching for. When this happens, it will be
interpreted as a package failure, and ServiceGuard will attempt to move
the package to the adoptive node. A sample cmmodpkg command:


# cmmodpkg -d ora_pkg

End quote

Essentially, what would possibly happen is that your package may fail to switch and start in the event of a failure.
My house is the bank's, my money the wife's, But my opinions belong to me, not HP!
Carlos Roberto Schimidt
Regular Advisor

Re: Oracle control script

Hi,

To avoid from control script execute "fuser -k" and kill oracle process after try "shutdown immediate" without finish sucessfully, I made this changes:

immediate)
shutdown_oracle immediate
check_status=$?
if [ $check_status -ne 0 ] ; then
shutdown_oracle abort
check_status=$?
fi
return $check_status
;;