This page provides configuration details for Microsoft SQL Server collectors.

Prerequisites

To monitor Microsoft SQL Server with Database Visibility, you must be running the 2005 version or newer. 

To configure an Azure SQL Managed instance, follow the configuration procedures of a Microsoft SQL Server Collector described in this topic.

Connection Details

SectionFieldDescription
Create New CollectorDatabase TypeThe database type that you want to monitor.
AgentThe Database Agent that manages the collector.
Collector NameThe name you want to identify the collector by.
Connection DetailsHostname or IP Address

The hostname or IP address of the machine that your database is running on.

To monitor a cluster, specify the hostname or IP address of the listener of the cluster. See Monitor the Microsoft SQL Server Cluster to enable monitoring the MSSQL cluster.

Listener Port

The TCP/IP address of the port on which your database communicates with the Database Agent.

If you are using a Microsoft SQL Server cluster, specify the listener port of the cluster.

To enable monitoring of all the nodes in a cluster, you must enable the monitoring of the cluster. This allows the agent to automatically discover all the nodes present in a cluster. See Monitor the Microsoft SQL Server Cluster

Windows AuthenticationClick to enable Windows authentication when connecting to the database.
Custom JDBC Connection StringThe JDBC connection string generated by the database agent, for example, jdbc:sqlserver://. You can also specify a custom connection string, which is useful for setting custom authentication options.
Username and PasswordUsernameThe name of the user who is connecting to and monitoring the database through the Database Agent. The user should have the permissions described in User Permissions for Microsoft SQL Server.
PasswordThe password of the user who is connecting to and monitoring the database through the Database Agent.
CyberArkClick to enable CyberArk for database username and password. When CyberArk is enabled, information about Application, Safe, Folder, and Object is required to fetch the username and password for your database. To use CyberArk with Database Visibility, you must download the JavaPasswordSDK.jar file from the CyberArk web site and rename the file to cyberark-sdk-9.5.jar. Then, you must copy the JAR file to the lib directory of the database agent zip file. 
Advanced OptionsSub-Collectors

Click to monitor multiple database instances in a consolidated view, and aggregate metrics of multiple databases. To monitor a custom cluster, you can add additional hostname or IP address, and port details for each sub-collector. You can add up to a total of 29 sub-collectors. Thereby, 30 databases can be monitored in a custom cluster. In addition to the licenses consumed by the main collector, each sub-collector consumes one or more licenses, depending on the database type. 

Note

  • All connection parameters other than the hostname or IP address, and port details of the sub-collector are the same as the main collector. If you want to specify different parameters for the sub–collectors, while creating or editing the collector configuration, you can do that only via the Create Collector API.

  • You cannot convert a custom cluster collector to a standalone collector. If you want to monitor a standalone database, delete the entire custom cluster collector and create a fresh standalone collector. However, note that deleting the custom cluster collector will delete all its historical data.
Connection PropertiesClick to add a new JDBC connection property or edit an existing property for relational databases.
Exclude DatabasesThe databases that you want to exclude, separated by commas.
Monitor Operating SystemSee this page for more details, Configure the Database Agent to Monitor Server Hardware.

Note

To handle High Availability (Multi-AZ) for Amazon RDS, set the databaseName JDBC connection string property to a user database.

Monitor Microsoft SQL Server

You can monitor the SQL Server either using an existing user account or by creating a new user account, with relevant privileges.

Monitor the Microsoft SQL Server Cluster

You can monitor all the nodes in the availability group of an MSSQL database server 2012 or later. 

To enable monitoring of all the nodes, you must enable the dbagent.mssql.cluster.discovery.enabled property either at the Controller level or at the agent level.

This property is disabled by default.

Authentication Methods

You can monitor the SQL server using either of the following authentication methods:

  • Windows authenticated account (if the Database Agent is running on Windows) 
  • SQL Server authenticated account (if the Database Agent is running on Windows or Linux)

Before you Begin

To connect to the SQL Server database using a Windows authenticated account, perform the following:

● Select Windows Authentication checkbox when creating the collector using "Create New Collector" dialog.

Note

Do not specify the username and password when updating database connection details.


● Specify the path to the Database Agent authentication library as follows:

Version DetailsPath
Windows 64-bit
java -Djava.library.path="C:\dbagent_install_dir\auth\x64" -jar db-agent.jar
CODE
Windows 32-bit
java -Djava.library.path="C:\dbagent_install_dir\auth\x86" -jar db-agent.jar
CODE


● Ensure that the Windows account user has appropriate privileges to authenticate the database server and can start the database agent.

● Change the logon credentials of the service to the Windows account with SQL Server access, if using a Windows service to run the Database Agent.

Server Level Permissions for SQL Server Logon 

To create a new SQL Server user (with minimum permissions required to monitor), perform the following steps:

  1. Create a new login for the AppDynamics SQL Server Database Collector, such as AppD_User, using SQL Server Management Studio (SSMS).
    New Login
  2. To map the new user to "master" and "msdb" databases, click "master" and "msdb" under Users mapped to this login

    Login Properties

    User mapping to "master" and "msdb" are mandatory for monitoring. To view object information in the Object Browser screens, additional mapping to other databases is required.

  3. After creating the login, grant the following privileges to the user by substituting AppD_User with the name you specified on the Login - New window:

    use master
    GRANT VIEW ANY DATABASE TO AppD_User;
    GRANT VIEW ANY definition to AppD_User;
    GRANT VIEW server state to AppD_User;
    GRANT SELECT ON [sys].[master_files] TO AppD_User;
    CODE

Optional Object Permissions for SQL Server

The following object permissions are required for optional screens within the Database (DB) Visibility user interface:

ScreenObject Permissions

Object Browser > Users

GRANT execute on sp_helplogins to AppD_User;
CODE

Note

securityAdmin role is required

Object Browser > Storage



To view object storage metadata, user mapping to other databases of interest is required.

Note

public role is required

Object Browser > Job Status

use msdb
GRANT SELECT on dbo.sysjobsteps TO AppD_User;
GRANT SELECT on dbo.sysjobs TO AppD_User;
GRANT SELECT on dbo.sysjobhistory TO AppD_User;
CODE
Object Browser > Error Log

For versions <= 2005:

GRANT execute on sp_readErrorLog to AppD_User;
CODE

For versions > 2005:

GRANT EXECUTE ON xp_readerrorlog
CODE

Note

securityAdmin role required

Object Browser > Database

To view object storage metadata, user mapping to other databases of interest is required e.g. Table/View metadata.

Note

public role required.

Following image shows how users are mapped to AdventureWorks2012 database:

Login Properties