Oracle agent functions

The Oracle agent monitors the database processes.

Table 1-1 lists the Oracle agent operations.

Oracle agent operations

Agent operation

Description

Online 

Starts the Oracle database by using the following svrmgrl or sqlplus command: 

startup force pfile=$PFile

The default Startup option is STARTUP_FORCE. You can also configure the agent to start the database using different Startup options for Oracle.  

See Startup and shutdown options 

Offline 

Stops the Oracle database with the specified options by using the following svrmgrl or sqlplus command: 

shutdown immediate

The default Shutdown option is IMMEDIATE. You can also configure the agent to stop the database using different Shutdown options for Oracle.  

See Startup and shutdown options 

Monitor 

Verifies the status of the Oracle processes. The Oracle agent provides two levels of monitoring: basic and detail. 

See Monitor options for Oracle agent 

Clean 

Forcibly stops the Oracle database by using the following svrmgrl or sqlplus command: 

shutdown abort

If the process does not respond to the shutdown command, the agent scans the process table for processes associated with the configured instance and kills them. 

Info 

Provides static and dynamic information about the state of the database.  

See Info entry point 

Action 

Performs predefined actions on a resource.  

See Action entry point 

Startup and shutdown options

You can specify Startup and Shutdown options for Oracle instances that are configured.

Table 1-2 lists the startup options that the agent supports.

Startup options

Option

Description

STARTUP_FORCE 

(Default) 

Runs startup force pfile='location_of_pfile' if the pfile is configured.  

If the pfile is not configured, the agent runs startup force. It picks up the default parameter files from their default locations. 

STARTUP 

Runs startup pfile='location_of_pfile' if the pfile is configured.  

If the pfile is not configured, the agent picks up the default parameter files from their default locations and runs startup

RESTRICTED 

Starts the database in the restricted mode.  

RECOVERDB 

Performs a database recovery on instance startup. 

CUSTOM 

Uses a predefined SQL script (start_custom_$SID.sql) and runs custom startup options. The script must be in the /opt/VRTSagents/ha/bin/Oracle directory and must have access to the Oracle Owner OS user. If the file is not present, the agent logs an error message.  

With a custom script, the agent takes the following action: 

sqlplus /nolog <<!

connect / as sysdba;

@start_custom_$SID.sql

exit;

!

SRVCTLSTART 

Uses the srvctl utility to start an instance of the database.  

For RAC clusters, you must manually set the default startup option as SRVCTLSTART.  

Table 1-3 lists the shutdown options that the agent supports.

Shutdown options

Option

Description

IMMEDIATE 

(Default) 

Shuts down the Oracle instance by running shutdown immediate.  

TRANSACTIONAL 

Runs the shutdown transactional command. This option is valid only for database versions that support this option.  

CUSTOM 

Uses a predefined SQL script (shut_custom_$SID.sql) and runs custom shutdown options. The script must be in the /opt/VRTSagents/ha/bin/Oracle directory and must have access to the Oracle Owner OS user. If the file is not present, the agent shuts the agent down with the default option.  

SRVCTLSTOP 

Uses the srvctl utility to stop an instance of the database.  

For RAC clusters, you must manually set the default option as SRVCTLSTOP. 

Monitor options for Oracle agent

The Oracle agent provides two levels of monitoring: basic and detail. By default, the agent does a basic monitoring.

The basic monitoring mode has two options: Process check and Health check.

In the detail monitoring mode, the agent performs a transaction on a test table in the database to ensure that Oracle is functioning properly.

See How the agent handles Oracle error codes during detail monitoring

Table 1-4 describes the basic monitoring options.

Basic monitoring options

Option

Description

(Default) 

Process check 

The agent scans the process table for the ora_dbw, ora_smon, ora_pmon, and ora_lgwr processes to verify that Oracle is running. 

Health check (supported on Oracle 10g and later) 

The agent uses the Health Check APIs from Oracle to monitor the SGA and retrieve the information about the instance.  

How the agent handles Oracle error codes during detail monitoring

The Veritas Cluster Server Agent for Oracle handles Oracle errors during detail monitoring. The agent classifies Oracle errors according to their severity and associates predefined actions with each error code.

The agent includes a reference file called oraerror.dat, which lists Oracle errors and the action to be taken when the error is encountered.

The file stores information in the following format:

Oracle_error_string:action_to_be_taken

For example:

01035:WARN

01034:FAILOVER

Table 1-5 lists the predefined actions that the agent takes when an Oracle error is encountered.

Predefined agent actions for Oracle errors

Action

Description

IGNORE 

Ignores the error. 

When the Veritas Agent for Oracle encounters an error that does not have a matching error code in the oraerror.dat file, then the agent ignores the error. 

UNKNOWN 

Marks the resource state as unknown and sends a notification if the Notifier resource is configured. See the Veritas Cluster Server User's Guide for more information about VCS notification. 

This action is typically associated with configuration errors or program interface errors. 

WARN 

Marks the resource state as online and sends a notification if the Notifier resource is configured.  

This action is typically associated with errors due to exceeded quota limits, session limits/restricted sessions so on.  

FAILOVER 

(Default) 

Marks the resource state as offline. This faults the service group, which fails over to the next available system. 

This is agent's default behavior. If the file oraerror.dat is not available, the agent assumes this default behavior for every Oracle error encountered. 

NOFAILOVER 

Freezes the service group temporarily and marks the resource state as offline. The agent also sends a notification if the Notifier resource is configured.  

This action is typically associated with errors that are not system-specific. For example, if a database does not open from a node due to corrupt Oracle files, failing it over to another node will not help.  

Info entry point

The Veritas Cluster Server Agent for Oracle supports the Info entry point, which provides static and dynamic information about the state of the database.

To invoke the Info entry point, type the following command:

# hares -value resource ResourceInfo [system]\

[-clus cluster | -localclus]

The entry point retrieves the following static information:

  • Version
  • InstanceNo
  • InstanceName
  • DatabaseName
  • HostName
  • StartupTime
  • Parallel
  • Thread
  • InstanceRole

The entry point retrieves the following dynamic information:

  • InstanceStatus
  • Logins
  • OpenMode
  • LogMode
  • ShutdownPending
  • DatabaseStatus
  • Shared Pool Percent free
  • Buffer Hits Percent

You can add additional attributes by adding sql statements to the file /opt/VRTSagents/ha/bin/Oracle/resinfo.sql. For example:

select 'static:HostName:'||host_name from v$instance;

select 'dynamic:ShutdownPending:'||shutdown_pending from v$instance;

The format of the selected record must be as follows:

attribute_type:userkey_name:userkey_value

The variable attribute_type can take the value static and/or dynamic.

Action entry point

The Veritas Cluster Server Agent for Oracle supports the Action entry point, which enables you to perform predefined actions on a resource.

To perform an action on a resource, type the following command:

# hares -action res token [-actionargs arg1 ...] \

[-sys system] [-clus cluster]

You can also add custom actions for the agent. For further information, refer to the Veritas Cluster Server Agent Developer's Guide.

See Predefined virtual fire drill actions

Table 1-6 describes the agent's predefined actions.

Predefined agent actions

Action

Description

VRTS_GetInstanceName 

Retrieves the name of the configured instance. You can use this option for the Oracle and the Netlsnr resources. 

VRTS_GetRunningServices 

Retrieves the list of processes monitored by the agent. You can use this option for the Oracle and the Netlsnr resources. 

DBRestrict 

Changes the database session to enable the restricted mode. 

DBUndoRestrict 

Changes the database session to disable the restricted mode. 

DBSuspend 

Suspends a database.  

DBResume 

Resumes a suspended database.  

DBTbspBackup 

Backs up a tablespace; actionargs contains name of the tablespace to be backed up.  

Table 1-7 lists the virtual fire drill actions of the Veritas Cluster Server Agent for Oracle allows you to run infrastructure checks and fix specific errors.

Predefined virtual fire drill actions

Virtual fire drill action

Description

getid 

(Oracle agent) 

Verifies that the Oracle Owner exists on the node. 

home.vfd 

(Oracle agent) 

Verifies the following: 

  • ORACLE_HOME is mounted on the node and corresponding entry is in the fstab.

    If the ORACLE_HOME is not mounted, the action entry point checks if any other resource has already mounted ORACLE_HOME.

  • Pfile is provided and it exists on the node.
  • Password file from $ORACLE_HOME/dbs/orapw[SID] is present.

owner.vfd 

(Oracle agent) 

Verifies the uid and gid of the Oracle Owner attribute. Checks if uid and gid of Owner attribute is the same on the node where the Oracle resource is currently online

tnsadmin.vfd 

(Netlsnr agent) 

Checks if listener.ora file is present. If listener.ora file, it checks if ORACLE_HOME is mounted and displays appropriate messages.