Submit a ticketCall us

Have You Auto Renewed? If not, you're missing out.
The SolarWinds Renewal Program comes with a host of benefits including the most recent product updates, 24/7 technical support, virtual instructor-led training and more. Experience all of this with the convenience of Auto Renewal, and never worry about missing any of these great benefits. Learn More.

Home > Success Center > Database Performance Analyzer (DPA) > Create the DPA Monitoring Login for SQL Server AG Listener Registrations

Create the DPA Monitoring Login for SQL Server AG Listener Registrations

Updated May 19, 2017

Overview

If you are monitoring a SQL Server availability group (AG), you must manually create SQL Server logins on secondary replicas when both of the following conditions are met:

  1. You specified an AG listener during DPA registration, and
  2. The DPA monitoring login does not exist on all replicas.

In most cases, the monitoring login will not exist on the replicas if you chose to have DPA create the monitoring user during registration. If you are using a monitoring login that you know already exists on all replicas, these instructions do not apply.

For information about the options for monitoring SQL Server AGs, see License types.

Background

SQL Server logins are stored on the [master] database, and therefore logins created on the primary replica are not automatically propagated to secondary replicas. Database users, however, are replicated to secondary replicas because replication occurs at the database level.  

This is important when you have registered using an AG listener because the DPA monitoring login needs to continue to work when a primary failover occurs. The login is created on the primary replica during registration. However, because the login is not replicated to other AG replicas, the login will not exist when the primary fails over, and DPA will not be able to monitor. Therefore, you must manually create the login on each secondary replica that the listener's AG can fail over to.

Environment

  • DPA, all versions

Steps

Get the list of AG replicas

To display a list of secondary replicas that the AG could fail over to:

  1. In DPA, select a SQL Server instance from the DPA home page.
  2. Click on the AG Status tab in the upper-right corner.
  3. Click on the listener's AG (the one in bold).

    The Replicas section lists the replicas that need the DPA monitoring login and permissions.

Create the monitoring login

Create the login on each secondary replica using the same credentials as the monitoring login on the primary replica.

  1. On each secondary replica, log in as a SYSADMIN user.
  2. Run the following commands. Substitute the correct monitoring login and password.
USE [master]
GO

-- Create DPA monitoring login on each Secondary replica.
CREATE LOGIN [<DPA monitoring login>] WITH
  PASSWORD=N'<DPA monitoring login password>',
  DEFAULT_DATABASE=[master],
  DEFAULT_LANGUAGE=[us_english],
  CHECK_EXPIRATION=OFF, CHECK_POLICY=OFF
GO

-- Give rights to monitor the replica.
ALTER SERVER ROLE [sysadmin] ADD MEMBER [<DPA monitoring login>]
GO

 

Last modified

Tags

Classifications

Public