Operating System - HP-UX
1844090 Members
2508 Online
110227 Solutions
New Discussion

oracle 9.2.0.6 startup/shutdown/monitor script for service guard

 
SOLVED
Go to solution
nishith
Frequent Advisor

oracle 9.2.0.6 startup/shutdown/monitor script for service guard

hii!

can anyone provide me the oracle 9.2.0.6 startup/shutdown/monitor script for service guard on hp-ux 11i.

Thanking you in advance!
4 REPLIES 4
Steven E. Protter
Exalted Contributor

Re: oracle 9.2.0.6 startup/shutdown/monitor script for service guard

Shalom nishith,

I'm going to let you in on a little secret. Process monitoring is how this is done and its not a good way to work.

You do a ps -ef | grep for oracle.

This gets you a list of important processes.

Then you use code like this:

smonproc=$(ps -ef | grep SMON |wc -l)
if [ $smonprod -le 1 ]
then
echo "Oracle problem..."
# put your code here.
fi

The problem is that its quite possible for the oracle processes to be present in a SG environment with the database being down or the database being mounted on the secondary node.

So the real way to monitor oracle is to use sqlplus to see if its running. The sqlplus command will undoubtedly fail if the database is not running.


sqlplus manager/manager1@systemname <<-EOF >> /tmp/sql_log
select * from v$database
EOF

You use the sqlplus statement you want, perhaps read from dual.

The problem I've run into in SG here is that sometimes the sqlplus statement takes a long time to execute and the cluster does not work really well.

Here are some online resources.

http://docs.hp.com/en/B5736-90046/ch03s02.html

http://www.oracle.com/technology/docs/deploy/availability/pdf/OPFS_8.0.6_install.pdf

http://www.filibeto.org/sun/lib/nonsun/oracle/9.2.0.1.0/oracle-real-app-clust-A95979_02.pdf

http://www.google.co.il/group/uvic.mlist.hpux-admin/browse_thread/thread/b10475b4205dc45/284847cd8b048778%23284847cd8b048778?sa=X&oi=groupsr&start=0&num=2


http://www.bmc.com/products/documents/84/06/28406/28406.pdf

Lots of good stuff up there, probably the very scripts you need.

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
Geoff Wild
Honored Contributor
Solution

Re: oracle 9.2.0.6 startup/shutdown/monitor script for service guard

Here's what we have...

In the package control script:

SERVICE_NAME[0]="oraclemon"
SERVICE_CMD[0]="/etc/cmcluster/oracle/Perl/oraclemon.pl"
SERVICE_RESTART[0]=""


In the Perl dir, we have a file called:

# cat oracle_procs
ora_smon 0
ora_pmon 0
ora_dbw0 0
ora_reco 0
ora_ckpt 0
ora_lgwr 0
ora_arc0 0
LISTENER 1
extproc_listener 1


Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
rariasn
Honored Contributor

Re: oracle 9.2.0.6 startup/shutdown/monitor script for service guard

Hi nishith,

For startup database:

1.- read enviarables (profile_bdNAME for ORACLE_HOME, ORACLE_SID, export PATH for $ORACLE_HOME/bin and others)

2.- Startup database


su - oracle -c '
. /home/oracle/oraBDNAME/conf/profile_BDNAME

sqlplus /nolog <connect / as sysdba
startup pfile=/oracle1/oraBDNAME/initBDNAME.ora
exit;
EOF
'
For shutdown database:

su - oracle -c '
. /home/oracle/oraBDNAME/conf/profile_BDNAME


sqlplus /nolog <connect / as sysdba
shutdown immediate
exit;
EOF
'

Define functions run and halt oracle in script for run/halt Sguard Pkg.

ran

ran
Sandman!
Honored Contributor

Re: oracle 9.2.0.6 startup/shutdown/monitor script for service guard

Hi Nishith,

Within the MC/SG control script there are two functions that need entries for starting and shutting down the Oracle database server. Assuming you are familiar with the package control script.

Start commands for Oracle go in function customer_defined_run_cmds, and stop commands go in function customer_defined_halt_cmds.

=======================================================
function customer_defined_run_cmds
{
# startup the Oracle database server
su - oracle -c ${ORACLE_HOME}/bin/sqlplus /nolog <connect / as sysdba
startup pfile=${PFILE}
EOF

# startup the listener process
su - oracle -c "${ORACLE_HOME}/bin/lsnrctl start"
}

function customer_defined_halt_cmds
{
# shutdown the listener process
su - oracle -c "${ORACLE_HOME}/bin/lsnrctl stop"

# shutdown the Oracle database server
su - oracle -c ${ORACLE_HOME}/bin/sqlplus /nolog <connect / as sysdba
shutdown immediate
exit
EOF
}
=======================================================

hope it helps!