Operating System - HP-UX
1838747 Members
3656 Online
110129 Solutions
New Discussion

Oracle Monitor/Startup Script

 
SOLVED
Go to solution
Aaron Sheard
Frequent Advisor

Oracle Monitor/Startup Script

Hi all,
I am setting up a 2 node MC/SG cluster to run oracle 8.1.7. in the package conf file i have moved the old /sbin/init.d/oracle script into /etc/cmcluster and put /etc/cmcluster/oracle start in the function customer_defined_run_cmds
{
/etc/cmcluster/oracle start
test_return 51
}
customer_defined_halt_cmds
{
/etc/cmcluster/oracle stop
test_return 52
}

but i dont know what to put in the SERVICE_CMD field above, this is what I have now.

SERVICE_NAME[0]=oracle_SRVP
SERVICE_CMD[0]="/etc/cmcluster/oracle start"
SERVICE_RESTART[0]="-r 0"

but every time i start the package, it mounts the file systems, starts oracle, then as soon as it is started successfully it stops the service, in the package log it says:

Jan 16 14:54:38 xora000 cmcld: Processing exit status for service PKG*31233
Jan 16 14:54:38 xora000 cmcld: Service PKG*31233 terminated due to an exit(0).
Jan 16 14:54:38 xora000 cmcld: Halted package oracleSRVP on node xora000.


i am thinking that for some reason it doesnt like my oracle rc script and I may have to re-write it. can anyone confirm what should be in the SERVICE_CMD field, i think i got the run_cmds and halt_cmds right.

Any help would really be appreciated!

Aaron Sheard
"uh, hey... did we get a good backup last night?"
13 REPLIES 13
Krishnan Viswanathan
Frequent Advisor
Solution

Re: Oracle Monitor/Startup Script

Typically, there is a HP standard script for oracle startup and it should be used. It should be placed in /etc/cmcluster//ORA-pkgname.sh

Here is a sample ORA-pkgname.sh attached as text. My package name is merc_pkg.

Also you can get step by step info for configuration from this link

http://docs.hp.com/cgi-bin/fsearch/framedisplay?top=/hpux/onlinedocs/B3936-90053/B3936-90053_top.html&con=/hpux/onlinedocs/B3936-90053/00/00/32-con.html&toc=/hpux/onlinedocs/B3936-90053/00/00/32-toc.html&searchterms=cmclnodelist&queryid=20011108-085249

Please download the PDF document. It is really comprehensive. (Also check if your serice software versions are the same on both servers)

Bill Hassell
Honored Contributor

Re: Oracle Monitor/Startup Script

Look in the MC/SG toolkit for an example start/stop script. Be sure to read the README file and the comments in the example script.

$ ls /opt/cmcluster/toolkit/oracle
ORACLE.sh README

This script is designed for HP-UX 10.20 and 11.0 and handles Oracle 7 and 8.


Bill Hassell, sysadmin
Aaron Sheard
Frequent Advisor

Re: Oracle Monitor/Startup Script

so, if i use the ora-pkgname.sh script in the SERVICE_CMD field, what do i put in the run_cmds and halt_cmds? anything? (I guess i dont understand why there is 3 fields, i thought you should have 2: 1 for start and 1 for stop)

Thanks again for your assistance.

Aaron Sheard
"uh, hey... did we get a good backup last night?"
Sanjay_6
Honored Contributor

Re: Oracle Monitor/Startup Script

hi Aaron,

you don't have to put anything to start the database and shut the database in the service cmd script. Call the ora packge script with a start and stop option in the customer defined run_cmds and halt_cmds. If you want to minitor the oracle database you call the same script with the monitor option in the the service_cmd.

Hope this helps.

Regds
Aaron Sheard
Frequent Advisor

Re: Oracle Monitor/Startup Script

So I can just leave SERVOCE_CMD blank then? OK.

Thanks again!!

Aaron
"uh, hey... did we get a good backup last night?"
Christopher McCray_1
Honored Contributor

Re: Oracle Monitor/Startup Script

Aaron,

First of all, you needn't put anything in the SERVICE_CMD area; it only depends on how sensitive you want your cluster to be to application failures.

With that being said, the ORACLE.sh script provided by HP for MCSG also has a monitor argument, which is an option for you. So:

SERVICE_NAME[0]=oracle_mon
SERVICE_CMD[0]=/etc/cmcluster/ORACLE.sh monitor
SERVICE_RESTART[0]="-r 0"

Also, although it is not required, I use the halt argument in my customer_defined_halt_commands function because it causes oracle to to a shutdown abort rather than a shutdown immediate, which is much slower and enables the failover to occur faster instead of running the risk of the database shutting down because the proimary node reboots.

Just some thoughts, hope they help

Chris
It wasn't me!!!!
Sanjay_6
Honored Contributor

Re: Oracle Monitor/Startup Script

Hi Aaron,

The configuration is like this,

First specify a service name in the package ascii configuration script. Next you specify the command that is required to run that service in the package control script. Normally a service can be the monitoring of the database, so to run this service you use the oracle.sh script with the monitor option in the package control script. If you don't want to minitor the database leave the service_cnd blank in the packge control script. Comment the line referring to the service cmd. put a "#" before the same.

# SERVICE_NAME[0]=oracle_SRVP
# SERVICE_CMD[0]="/etc/cmcluster/oracle start"
# SERVICE_RESTART[0]="-r 0"

Here the serive name oracle_SVRP is defined in the packge ascii configuration script and the corresponding command to run that service is mentioned in the packge control script. Comment the lines as shown above in the package control script if you don't want to run the service.

Hope this helps.

Regds
Christopher McCray_1
Honored Contributor

Re: Oracle Monitor/Startup Script

Just a couple of other tips, assuming this isn't your configuration:

1) I would create a subdirectory under /etc/cmcluster as your packagdirectory
/etc/cmcluster/
This is where you will place your package configuration and control scripts. Do this for all packages for housekeeping and to avoid possible confusion.

2) Additionally, you aren't limited to the monitoring option in ORACLE.sh. You may alternatively decide to use a script you create on your own. As they said in MCSG class in reference to service processes, "you are only limited by your own scripting abilities"

Good luck and happy clustering
Chris
It wasn't me!!!!
John Palmer
Honored Contributor

Re: Oracle Monitor/Startup Script

If you specify anything in the SERVICE_CMD field, this will be run when the package is started.

It is intended to be either the service itself or some sort of monitoring script.

That process is monitored by Serviceguard and if it fails (or simply exits) then the package is condidered to have failed.

Anything that you specify in SERVICE_CMD must therefore run the whole time that the package is active.

Regards,
John

Aaron Sheard
Frequent Advisor

Re: Oracle Monitor/Startup Script

re: SERVICE_CMD

hmm maybe thats why my package fires up right away then fails over to the 2nd node, starts up then shuts down. if SERVICE_CMD is not used, maybe it must be commented out (right now the value is "" but is not commented out)

Aaron
"uh, hey... did we get a good backup last night?"
Christopher McCray_1
Honored Contributor

Re: Oracle Monitor/Startup Script

Exactly. The rule is, if your not using it, comment it out.

Have a good time
Chris
It wasn't me!!!!
Aaron Sheard
Frequent Advisor

Re: Oracle Monitor/Startup Script

OK - my oracle startup/monitor/shutdown script is working well. Thanks for all your help everyone. As well, when i kill a process that is monitored, it shutsdown and fails over to the secondary node. However, my final problem is this: when the instance fails over to the secondary node, it immediately dies, and says:

cmcld: Package oracleSRVP cannot run on this node because switching has been disabled for this node

even though in the package admin:failover options I have enabled switching on BOTH nodes. it seems once it goes through this cycle, it automatically changes both nodes to switching disabled. Any ideas?

(BTW You guys are great!)

Aaron
"uh, hey... did we get a good backup last night?"
Christopher McCray_1
Honored Contributor

Re: Oracle Monitor/Startup Script

run the following command:

dmc30:/var/adm/syslog# cmviewcl -v

CLUSTER STATUS
WSMIS up

NODE STATUS STATE
dmc30 up running

Network_Parameters:
INTERFACE STATUS PATH NAME
PRIMARY up 0/4/0/0 lan3
PRIMARY up 0/0/0/0 lan0
PRIMARY up 1/8/0/0 lan2
STANDBY up 1/10/0/0 lan1

PACKAGE STATUS STATE AUTO_RUN NODE
WSMDB up running enabled dmc30

Policy_Parameters:
POLICY_NAME CONFIGURED_VALUE
Failover configured_node
Failback manual

Script_Parameters:
ITEM STATUS MAX_RESTARTS RESTARTS NAME
Subnet up 1.2.3.4

Node_Switching_Parameters:
NODE_TYPE STATUS SWITCHING NAME
Primary up enabled dmc30 (current)
Alternate up enabled dmc31
mot only do you need to ensure that AUTO_RUN shows enabled for the package, but also the node itself must have switching enabled, which is displayed at the bottom under the SWITCHING parameter. If the status shows disabled, run the following command:

# cmmodpkg -e -n -n

use the -n option for all nodes in your cluster, then run cmviewcl -v again; The SWITCHING should display as enabled. You MUST reenable the swithing for the packge and node every time a failover occurrs.

Hope this helps
Chris
It wasn't me!!!!