Custom Scripts
Oracle Site Guard allows for custom scripts to be used during operations to perform tasks not natively supported by Site Guard.
NMS provides templates for Site Guard custom scripts in $NMS_BASE/templates. They must be installed in a common location on each NMS server or each database server, depending on the script. Scripts should be installed with .template removed from their names and made executable unless otherwise noted. Some of these scripts must be edited and others can be edited.
Custom Scripts for Database Server
This must be configured to run as the user that is running the database.
sg-createrestorepoint.template
Shell script that creates a guaranteed restore point in the database named “BEFORE_PATCH_NMS”. If $HOME/.profile does not set ORACLE_HOME, ORACLE_SID, and PATH such that “sqlplus / as sysdba” connects to the database, then this script must be edited to set those environment variables.
sg-createrestorepoint.sql.template
SQL script used by sg-createrestorepoint.template. Does not need to be executable.
Custom Scripts for NMS server
These must be configured to run as the NMS administrative user. When Dual-Environment Configuration is used, these scripts must be configured twice – once for each environment.
sg-nmsreadonly.template
Shell script that calls nms‑read‑only to turn on Read Only mode.
sg-nmsstart.template
Shell script that calls nms‑all‑start to start NMS services and the WebLogic managed server.
sg-nmsstop.template
Shell script that calls "nms‑all‑stop ‑fast" to stop NMS services and the WebLogic managed server.
sg-nmsswitchover.template
Shell script which handles a switchover. Run from the Standby site that is becoming Primary. This:
Syncs the operations model from the old primary site to the standby site that is becoming primary by running the nms-sync-site script.
Updates the NMS schema at the standby site to indicate that it is the current primary site by running the nms-update-site script.
Starts NMS Services and the WebLogic managed server.
Creates a system alarm indicating that this is the new primary site.
This script must be customized to match the sites and hosts at which NMS is installed. See the comments in the template.
Other Custom Scripts
Other custom scripts can be added for any other business needs.