About the VCS agent for SQL Server Database Engine

The VCS agent for SQL Server Database Engine monitors the Database Engine service and all the optional components that are integrated with the service. For example, if the Full-Text Search component is configured, the agent also monitors that component too. The agent brings the service online, monitors its status, and takes it offline. If the service is not running, the agent declares its state as Offline.

If detail monitoring is configured, the agent checks the health of the selected SQL Server databases or executes a monitoring script. If detail monitoring is successful, the agent declares the service group as Online.

Functions

Online

Brings the SQL Server Database Engine service online.

Offline

Takes the Database Engine service offline.

Monitor

Monitors the status of SQL Server services. It queries the Windows Service Control Manager (SCM) for the status of the services.

If detail monitoring is configured, then depending on the configuration, the agent performs a database health check or executes a monitoring script.

See About the monitoring options.

Clean

Forcibly stops the Database Engine service.

Cleans up after a resource fails to come online, fails to go offline, or fails to detect the state as Online even when the resource is online.

Note:

If you start the SQL Server services from outside VCS, then the SQL resource will go in an unknown state because the VCS agent monitors the computer context of the services. If the SQL Server service is not started in the virtual server context the resource goes in an unknown state. You must ensure that you start all the SQL Server-related services from within VCS.

Resource type definitions

The resource type represents the VCS configuration definition of the agent, and specifies how the agent is defined in the configuration file, main.cf.

The agent for SQL Server 2012 and 2014 is configured as a resource of the SQLServer type.

type SQLServer (
  static int IMF{} = { Mode=3, MonitorFreq=5, RegisterRetryLimit=3 }
  static i18nstr IMFRegList[] = { Instance }
  static i18nstr ArgList[] = { Instance, "LanmanResName:VirtualName", 
    DetailMonitorInterval, SQLOnlineTimeout, SQLOfflineTimeout, 
    SQLDetailMonitorTimeout, Username, Domain, Password, DBList, 
    "IPResName:Address", SQLFile, FaultOnDMFailure }
  str Instance
  str LanmanResName
  str IPResName
  int DetailMonitorInterval = 0
  int SQLOnlineTimeout = 90
  int SQLOfflineTimeout = 90
  int SQLDetailMonitorTimeout = 30
  i18nstr Username
  i18nstr Domain
  str Password
  i18nstr SQLFile
  i18nstr DBList[]
  boolean FaultOnDMFailure = 1
)

The agent for SQL Server 2008 is configured as a resource of the SQLServer2008 type.

type SQLServer2008 (
	static int IMF{} = { Mode=3, MonitorFreq=5, RegisterRetryLimit=3 }
	static i18nstr IMFRegList[] = { Instance }
	static i18nstr ArgList[] = { Instance, "LanmanResName:VirtualName", 
   SQLOnlineTimeout, SQLOfflineTimeout, DetailMonitorInterval, 
   SQLDetailMonitorTimeout, Username, Domain, Password, DBList, SQLFile, 
   FaultOnDMFailure, "LanmanResName:IPResName", SQLClusterAccount }
	str Instance
	str LanmanResName
	int SQLOnlineTimeout = 90
	int SQLOfflineTimeout = 90
	int DetailMonitorInterval
	int SQLDetailMonitorTimeout = 30
	i18nstr Username
	i18nstr Domain
	str Password
	i18nstr DBList[]
	i18nstr SQLFile
	boolean FaultOnDMFailure = 1
	str SQLClusterAccount
)
Attributes

The following table lists the attributes that must be configured for the agent to function properly.

Table: VCS agent for SQL Server Database Engine - required attributes

Required Attribute

Description

Name: Instance

Type: String

Dimension: Scalar

Name of the SQL Server instance to monitor.

If the value of this attribute is not set, the agent monitors the default SQL Server instance (MSSQLSERVER).

ame: LanmanResName

Type: String

Dimension: Scalar

Lanman resource name on which the SQLServer resource or the SQLServer2008 resource depends.

Table: VCS agent for SQL Server Database Engine - optional attributes

Optional attribute

Description

Name: SQLOnlineTimeout

Type: Integer

Dimension: Scalar

Number of seconds that may elapse before the Online function aborts.

Default value: 90

Name: SQLOfflineTimeout

Type: Integer

Dimension: Scalar

Number of seconds that may elapse before the Offline function aborts.

Default value: 90

Name: DetailMonitorInterval

Type: Integer

Dimension: Scalar

Defines whether the agent performs detail monitoring of the SQL Server instance.

The value 0 (zero) indicates that the agent performs only the basic monitoring of the instance service. A non-zero value indicates the number of online monitor cycles that the agent must wait before performing detail monitoring.

Veritas recommends that you set this value to an integer between 1 and 12. The value 1 would make the agent perform detail monitoring at each monitor cycle. The value 2 would make the agent perform detail monitoring at every other monitor cycle. This interpretation may be extended to other values.

If this attribute is set to a non-zero value, then the following attributes must be assigned appropriate values:

  • For script-based monitoring: SQLFile, Username, Password, Domain, and SQLDetailMonitorTimeOut

  • For databases list-based monitoring: Username, Password, Domain, and DBList

Default value: 5

Note:

This is not a SQL Server agent-specific attribute, but a common type-level attribute. The value of this attribute can only be set through the wizard. If you configure the service group manually, you must remember to specify this attribute and its value.

See About the monitoring options.

Name: FaultOnDMFailure

Type: Boolean

Dimension: Scalar

Defines whether the agent fails over the service group if the detail monitoring script execution fails.

The value 1 indicates that the agent fails over the service group if detail monitoring script fails to execute. The value 0 indicates that it does not fail over, but goes into the unknown state.

Defines whether the agent faults the SQL Server resource when the detail monitoring fails.

  • If the value is set to True, the agent faults the configured SQL Server resource when the detail monitoring fails.

    In this case, the SQL Server resource may go into OFFLINE state.

  • If the value is set to False, the agent does not fault the SQL Server resource when the detail monitoring fails.

    In this case, the SQL Server resource may go into the UNKOWN state.

Default value: True

Name: SQLDetailMonitorTimeout

Type: Integer

Dimension: Scalar

Number of seconds that may elapse before the detail monitoring routine aborts.

Default value: 30

Name: Username

Type: String

Dimension: Scalar

User account in whose context the detail monitoring is performed.

If the DetailMonitorInterval attribute is set to a non-zero value, the value of this attribute must not be empty.

The Microsoft Windows authentication name when logging in to a database for detail monitoring. This attribute must not be null if the DetailMonitorInterval attribute is set to a non-zero value. The user must have the necessary privileges to connect to the database and execute the appropriate query.

Note:

This attribute can take localized values.

Name: Domain

Type: String

Dimension: Scalar

Domain of the user account specified in the Username attribute.

Domain for the user account. This attribute is used to create a trusted connection to the SQL Server instance if the DetailMonitorInterval attribute is set to a non-zero value.

Note:

This attribute can take localized values.

Name: Password

Type: String

Dimension: Scalar

Password for the user account specified in the Username attribute.

If the DetailMonitorInterval attribute is set to a non-zero value, the value of this attribute must not be empty.

Password for logging in to a database for in-depth monitoring. This attribute must not be null if the DetailMonitorInterval attribute is set to a non-zero value.

Name: SQLFile

Type: String

Dimension: Scalar

Location of the SQL file that is executed during a monitor cycle.

If the DetailMonitorInterval attribute is set to a non-zero value, then either the script-based detail monitoring or the database list-based detail monitoring must be configured.

This attribute must not be null if DetailMonitorInterval attribute is set to a non-zero value and script-based detail monitoring is configured.

Note:

This attribute can take localized values.

Name: DBList

Type: String

Dimension: Vector

List of databases for which the agent must perform detail monitoring.

If the DetailMonitorInterval attribute is set to a non-zero value, then either the script-based detail monitoring or the database list-based detail monitoring must be configured.

If both the SQLFile attribute and the DBList attribute are configured, then the DBList attribute takes precedence.

Note:

This attribute can take localized values.

Name: IPResName

Type: String

Dimension: Scalar

(SQL Server 2012 and 2014 only) IP resource on which the Lanman resource for the SQLServer resource depends.

Name: SQLClusterAccount

(SQL Server 2008 only) Use this attribute if the user account that you specify for the SQL Server service and the SQL Server Agent service is not a member of the local Administrators group on all the cluster nodes that are part of the service group.

Specify a domain group or the SQL Server service name. If you specify a domain group, then the SQL Server service account must be part of this domain group.

The agent assigns the account with Full Control privileges to the SQL Server databases and log files.

For a domain group, specify in the format Domain.com\DomainGroup.

For SQL Server service name, specify in the format MSSQL$InstanceName.

For the default instance, the service name is MSSQLServer.