Thanks Finn and Austin. I checked the doc referred by Austin earlier but due to
Shared Storage requirement and multiple Agent, I am looking exactly what you
have referred. I will look on this Postonline trigger details as I am not aware
of it and will check this option.
From: "Jorgensen, Finn"
To: "smishra_97_at_yahoo.com"; "oracle-l_at_freelists.org"
Sent: Fri, June 3, 2011 1:35:35 PM
Subject: RE: Oracle Grid Agent for Veritas Cluster Active-Passive environment
Iâve been in this exact situation. While you can do what Austin suggested in my
case it was a prohibitive amount of work to install an agent per database
protected by VCS.
I use EMCLI just like you do. The trick to getting the command run automatically
is to have it executed by whatâs called a âVCS post-online triggerâ. This is a
file called postonline in the directory /opt/VRTSvcs/bin/triggers. This file has
a comment about halfway down that says âput your code hereâ¦â. Put your code
Postonline is called by root so you have to su to oracle to get emcli to execute
correctly. Postonline is also called with the VCS package/group name as the
first parameter. In my case VCS groups are called the same thing as the database
SID so that made it easy for me to figure out which targets to relocate. I wrote
a script called gcrelocate.sh which takes the SID as a parameter, looks up the
target name of the database and the listener in the repository database and then
executes the appropriate EMCLI commands to relocate them to the new server. The
call in postonline looks like this :
`su - oracle -c "/oracle/exec.sh gcrelocate.sh $ARGV >>
/oracle/exec.sh is just a little script that sets up the environment
appropriately for the oracle user when scripts are called from cron or other
automated or remote tools (like postonline or ssh).
The one caveat is that the emcli relocate command requires both the old agent
name and the new agent name. Since postonline only fires when the target is
brought up on the new server you no longer know where it came from (at least not
when in a large, generic environment like I am. If you only have 2 servers then
itâs easy. It came from the one youâre not on now). I solved that by keeping the
name of the server a target is running on in a file that fails over with the
rest of the package. I chose the pfile directory. After the successful call to
emcli relocate by gcrelocate.sh it updates the file in the pfile directory to
contain the new filename so itâs ready for a failback.
Behalf Of Sanjay Mishra
Sent: Thursday, June 02, 2011 8:34 PM
Subject: Oracle Grid Agent for Veritas Cluster Active-Passive environment
I had a Veritas Cluster Non-RAC setup where I had 4 Database on Node1 and 4 on
Node2 and these cluster nodes act as High availability for each other. All
database are running with own VIP. Both Nodes have Local Oracle Software which
is 9i/10g/11g along with Oracle 11g Grid Agent.
Now if I failover one Database from Node A to Node B, then I can use emcli and
can relocate the Agent configuration for Oracle Database listener.
What I need is to Automate the process so that I don't need to manuall execute
the emcli command. I can do this using hares commands like. Anyone can share the
process used with VCS commands. EM agent are always running on both nodes and
only Database might be moved few times.
Sanjay>>> This e-mail and any attachments are confidential, may contain legal,
professional or other privileged information, and are intended solely for the
addressee. If you are not the intended recipient, do not use the information
in this e-mail in any way, delete this e-mail and notify the sender. CEG-IP2