1820592 Members
1773 Online
109626 Solutions
New Discussion юеВ

Oracle start and stop

 
SOLVED
Go to solution
Joerg Petz
New Member

Oracle start and stop

How can i configure start and stop an oracle database in serviceguard ?
6 REPLIES 6
Stefan Farrelly
Honored Contributor
Solution

Re: Oracle start and stop


Lets pretend your package is called PKG1, and it runs an oracle database. Your SG cluster should have the following configuration dir;

/etc/cmcluster/PKG1
Check what you package is called with the cmviewcl command.
In the above dir you will find a file called;
PKG1.cntl
This is your configuration file. In it you will find 2 sections, 1 called;
function customer_defined_run_cmds
and one called;
function customer_defined_halt_cmds
In each section you put your oracle startup and orcale_shutdown scripts or commands. eg. in our run_cmds section we have;
su - oracle <export ORACLE_SID=
svrmgrl
connection internal
startup
EOF

and in our halt_cmds section we have;
su - oracle <export ORACLE_SID=
svrmgrl
connection internal
shutdown immediate
EOF

Thats it. Now when you do a cmrunpkg or cmhaltpkg it will startup or shutdown oracle.
Im from Palmerston North, New Zealand, but somehow ended up in London...
John Palmer
Honored Contributor

Re: Oracle start and stop

Write yourself a shell script which calls Oracle's 'svrmgrl' to start and stop the database. It may also call 'lsnrctl' to start the SQLNET listener if required.

Have a look at the ones supplied by Oracle $ORACLE_HOME/bin/dbstart and dbshut. These are written to be called at system startup/shutdown.

Re: Oracle start and stop

Remember the important thing about package control scripts is that they need to function correctly unattended, so you really have to look to cover as many situations as possible. Quite often with Oracle this can lead to a compromise bewteen being able to stop/switch the package quickly and avoiding any Oracle recovery action.

There are a few situations in Oracle where a 'shutdown immediate' will hang and not bring down the database - what can you do? all DBAs hate the mention of 'shutdown end', but at some point you have to make a call to make the database available.
These are the kind of things I have seen implemented:
a) Kick off a background monitor script just before doing the shutdown immediate - this will wait for x amount of time and then if the database processes are still active try a 'shutdown end'. The original shutdown script waits for the monitor script to complete before returning to the package control script.
b)Use ServiceGuard's HALT_SCRIPT_TIMEOUT parameter to just continue the package halt regardless of what Oracle is still doing after x amount of time. All oracle processes will get toasted when ServiceGuard does an fuser -k on the Oracle file systems.

Of course the chances are that if the database is switched to anothet node or restarted then things could go real slow for several minutes while oracle goes thro instance recovery, but a lsow database is better than no database.


I am an HPE Employee
Accept or Kudo
Chris Garman
Frequent Advisor

Re: Oracle start and stop

Hi,

I have Oracle in a ServiceGuard environment. Scripts to start and stop Oracle are available from HP, product no B5139A, the ServiceGuard enterprise master toolkit.

The script is much more complicated that the one proposed. It kicks off a child to monitor everything it does and take corrective action, and it regularly checks Oracle is OK and informs serviceguard if it detects any problems.

And no, Im not an HP salesman.
Chris Garman
Frequent Advisor

Re: Oracle start and stop

Out of interest, these HP scripts always do a shutdown abort, and if that doesn't complete in a specified time goes in with kill -9.
When putting oracle in serviceguard you also need to start the listeners.
freddy_21
Respected Contributor

Re: Oracle start and stop

HP have toolkit for oracle. it is easier. But u must order first.
oracle toolkit have: startup and shutdown script and monitoring oracle process.
with oracle toolkit, possible to run offline backup without shutdown your package.

But possible you can create script for that.

About comment from Chris Garman i think haoracle.sh have many option. ( stop, shutdown, start) if you using haoracle.sh stop, thats means shutdown abort at oracle. but if you using haoracle.sh shutdown it means shutdown immediate.