RE: Oracle Grid Agent for Veritas Cluster Active-Passive environment

From: Vishal Gupta <vishal_at_vishalgupta.com>
Date: Sun, 5 Jun 2011 13:20:21 -0400 (EDT)
Message-ID: <787DD2F284E39D4FA3C2ABD2DAF1AB2D1110EC_at_MAIL.vishalgupta.co.uk>



Finn,  

Once the database has been brought up by VCS after successful failover, you could also get the information about previous hostname it was running on from AWR DBA_HIST_DATABASE_INSTANCE view. Just the take the second last record from there i.e. record of last startup.  

http://download.oracle.com/docs/cd/E11882_01/server.112/e17110/statviews _3211.htm#I1023404  

Regards,

Vishal Gupta

www.vishalgupta.com  

From: oracle-l-bounce_at_freelists.org
[mailto:oracle-l-bounce_at_freelists.org] On Behalf Of Jorgensen, Finn Sent: 03 June 2011 18:36
To: 'smishra_97_at_yahoo.com'; 'oracle-l_at_freelists.org' Subject: RE: Oracle Grid Agent for Veritas Cluster Active-Passive environment  

Sanjay,  

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 there.  

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[1] >> /oracle/local/logs/gcrelocate.out 2>&1"`;  

/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.  

HTH, Finn  

From: oracle-l-bounce_at_freelists.org
[mailto:oracle-l-bounce_at_freelists.org] On Behalf Of Sanjay Mishra Sent: Thursday, June 02, 2011 8:34 PM
To: oracle-l_at_freelists.org
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.

TIA
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

--
http://www.freelists.org/webpage/oracle-l
Received on Sun Jun 05 2011 - 12:20:21 CDT

Original text of this message