Info about Oracle Data Guard Agent for VCS
- 11 years ago
There does not seem to be an agent for Windows.
- 11 years ago
You can write your own agent either from scratch using information from the VCS Agent Developers Guide -
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:
- StartProgram: Write a program that promotes ODG to primary and demotes the other node if it is there. The program touches a lock file
- MonitorProgram: Just checks lock file exists
- 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 functionThe agent determines the role of the database and the type of open mode usingthe SQL commands:DATABASE_ROLE from V$DATABASEOPEN_MODE from V$DATABASEIf 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 faultand reconfigures the database as follows:■The agent first tries to demote a primary database instance by executing theaction DGDemotePri inside the remote cluster.■Then, the agent changes the mode of the local database from PHYSICALSTANDBY to PRIMARY.The agent stops the reception of redo log information using the SQL command:ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCELThe 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 changeseffective 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