Applications Systems

Create the DPA monitoring user for SQL Server and Azure SQL Managed Instance

Create or recreate the SQL Server user that DPA uses for monitoring a SQL Server database instance or an Azure SQL Managed Instance (ASMI).

First published date

10/22/2018 11:56 AM

Last published date

4/11/2023 3:52 PM

Overview

This article provides instructions to manually create the SQL Server user with the proper rights and privileges that DPA uses to monitor a SQL Server database instance or an Azure SQL Managed Instance (ASMI). Follow these instructions, for example, if you deleted or lost the SQL Server user, or if you need to create the user when you register an ASMI.

Note: This article applies to SQL Server and ASMI. For information about Azure SQL Database, see Register an Azure SQL Database

    Product section

    Database Performance Analyzer

    Resolution

    1. Connect as a SYSADMIN user to the monitored database.
    2. Replace username and password in the script below with the credentials for the user account.
    3. Run the script:
      --Create DPA login
      
      CREATE LOGIN [username] WITH
        PASSWORD=N'password',
        DEFAULT_DATABASE=[master],
        DEFAULT_LANGUAGE=[us_english],
        CHECK_EXPIRATION=OFF, CHECK_POLICY=OFF
      GO
      
      --Give SYSADMIN rights to the DPA user
      EXEC sys.sp_addsrvrolemember @loginame = N'username', @rolename = N'sysadmin'
      GO
      -- Scripts are not supported under any SolarWinds support program or service.
      -- Scripts are provided AS IS without warranty of any kind. SolarWinds further
      -- disclaims all warranties including, without limitation, any implied warranties
      -- of merchantability or of fitness for a particular purpose. The risk arising
      -- out of the use or performance of the scripts and documentation stays with you.
      -- In no event shall SolarWinds or anyone else involved in the creation,
      -- production, or delivery of the scripts be liable for any damages whatsoever
      -- (including, without limitation, damages for loss of business profits, business
      -- interruption, loss of business information, or other pecuniary loss) arising
      -- out of the use of or inability to use the scripts or documentation.
      

      You have an option to configure Azure Active Directory (AAD) in DPA.