Forum Discussion

Faisal_Saleem's avatar
11 years ago

Info about Oracle Data Guard Agent for VCS

Dear All I am working on gaining knowledge about Oracle Data Guard Agent for Veritas Cluster Server for Windows Server. Any help from the community will be helpful for VCS version 6x Thanks
  • mikebounds's avatar
    11 years ago

    You can write your own agent either from scratch using information from the VCS Agent Developers Guide - 

    http://sort-cdn.symantec.com/public/documents/sfha/6.0.2/windows/productguides/pdf/VCS_AgentDev_6.0.2.pdf

    or use the Process agent.  It is not that difficult.  Using the Process agent you would need to use the following attributes of the Process Agent:

    1. StartProgram: Write a program that promotes ODG to primary and demotes the other node if it is there.  The program touches a lock file
    2. MonitorProgram: Just checks lock file exists
    3. StopProgram: Removes lock file

    So the 2nd two are easy, so the StartProgram is the one that is difficult.  You can see what the UNIX agent does from the documentation (https://sort.symantec.com/agents/detail/4625) and actually you could download UNIX agent and reuse the code from the online.  If the code is written in perl it MAY work unchanged, but dealing with files MAY need altering as Windows paths can have spaces.  Even if program is written in shell, at least you can reuse or the databas commands - these are listed in the guide:

     

    About the Oracle Data Guard agent’s online function
     
    The agent determines the role of the database and the type of open mode using
    the SQL commands:
    DATABASE_ROLE from V$DATABASE
    OPEN_MODE from V$DATABASE
     
    If the role of the replicated database is PRIMARY and the open mode is MOUNT,
    the agent makes the database accessible for clients as follows:
    ■ Alters the database to open mode READ WRITE.
    ■ Creates a lock file on the local host to indicate that the resource is online.
     
    If the role of the database is PHYSICAL STANDBY, the agent assumes a site fault
    and reconfigures the database as follows:
    ■ The agent first tries to demote a primary database instance by executing the
       action DGDemotePri inside the remote cluster.
    ■ Then, the agent changes the mode of the local database from PHYSICAL
       STANDBY to PRIMARY.
     
      The agent stops the reception of redo log information using the SQL command:
    ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL
     
    The agent changes the role of the database using the SQL command:
    ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY
     
    ■ The agent then restarts the local database instance to make the changes
    effective and creates a lock file in the local agent home directory.
     
    Note here, this also uses an action script "DGDemotePri" in order to run the commands to demote the database on a different node.
     
    If you are going to reuse code, then it may be easier to write a "proper" agent with the info from the Developers guide.
     
    Mike