Connect SQL Server To Mini DBA


Use the SQL Server connection workflow to add a SQL Server instance to Mini DBA monitoring. SQL Server monitoring uses database permissions for DMVs, metadata, jobs, Query Store, events, and logs. Optional Windows host access adds performance counter and WMI metrics.

Mini DBA connect SQL Server

Add Server Fields

In Servers, select Add Server and choose SQL Server.

Field What to enter
Type SQL Server
Instance / Host SQL Server host or SERVER\INSTANCE
Username Leave blank for Windows authentication, or enter a SQL login
Password Password for the SQL login

The Mini DBA Engine must be able to reach the SQL Server listener and authenticate with the account you enter.

What Mini DBA Monitors After Connection

With the required SQL Server permissions, Mini DBA can collect the information used by SQL Server monitoring pages:

  • SQL Server activity, sessions, requests, blocking, and waits.
  • Cached SQL, Query Store, execution plan detail, and expensive query metrics.
  • CPU, memory, database files, drives, and storage-related SQL Server data.
  • SQL Server Agent jobs, logins, Always On Availability Groups, deadlocks, and error log data.
  • Health checks and performance tuning evidence.
  • SQL Server alerts and report data.

Optional permissions unlock optional features. For example, SQL Server Agent job monitoring needs access to msdb job tables, while profiler and instant deadlock detection depend on Extended Events permissions.

Required SQL Server Permissions

The SQL Server permissions modal checks:

  • VIEW SERVER STATE: essential for SQL Server DMVs, activity, waits, memory, CPU, and query diagnostics.
  • VIEW ANY DATABASE: essential for database discovery beyond master and tempdb.
  • VIEW ANY DEFINITION: essential for schema, object, and file detail.
  • XP_READERRORLOG: optional, enables SQL Server error log features, deadlock detection support, and failover alerting.
  • ALTER TRACE: optional, shows running traces.
  • ALTER ANY EVENT SESSION: optional, enables Extended Events based profiler and fast deadlock detection.
  • DEFAULT TRACE: optional, enables file growth and change event discovery where SQL Server default trace is available.
  • READ SYSJOBS: optional, enables SQL Server Agent job alerting and job history review.

SQL Example: Create A Monitoring Login

Run this as a SQL Server administrator. Change the login name and password first.

USE [master];
GO

CREATE LOGIN [minidba_monitor]
WITH PASSWORD = 'UseASecretPasswordHere';
GO

CREATE USER [minidba_monitor] FOR LOGIN [minidba_monitor];
GO

GRANT VIEW SERVER STATE TO [minidba_monitor];
GRANT VIEW ANY DATABASE TO [minidba_monitor];
GRANT VIEW ANY DEFINITION TO [minidba_monitor];
GRANT EXEC ON XP_READERRORLOG TO [minidba_monitor];
GRANT ALTER TRACE TO [minidba_monitor];
GRANT ALTER ANY EVENT SESSION TO [minidba_monitor];
GO

USE [msdb];
GO

CREATE USER [minidba_monitor] FOR LOGIN [minidba_monitor];
ALTER ROLE SQLAgentReaderRole ADD MEMBER [minidba_monitor];
ALTER ROLE db_datareader ADD MEMBER [minidba_monitor];
GO

If you use Windows authentication, grant the same permissions to the Windows principal, for example [DOMAIN\minidba-monitor].

Optional Default Trace

If you want default trace dependent features on supported SQL Server versions, enable it with:

EXEC sp_configure 'show advanced options', 1;
RECONFIGURE;
EXEC sp_configure 'default trace enabled', 1;
RECONFIGURE;

Verify Permissions In Mini DBA

After adding the SQL Server, open the server in the navigation tree and open the SQL Server Connectivity Permissions modal. Select Refresh to probe the current login. The modal shows each permission as OK or NO and includes the exact T-SQL to grant missing access.

Use this modal after:

  • Creating a new monitoring login.
  • Switching from Windows authentication to SQL authentication.
  • Moving Mini DBA Engine to a different host.
  • Enabling or disabling profiler, deadlock, or Agent job features.
  • Troubleshooting missing SQL Server monitoring data.

Host OS Login And Metrics

SQL Server exposes some host OS information through SQL Server DMVs, including host OS platform, distribution, and release where available.

For extra Windows host metrics, Mini DBA checks:

  • Windows Counters: memory and disk counters through Performance Monitor access.
  • READ WMI: CPU core usage and running Windows programs through WMI.

The Windows account used by Mini DBA needs appropriate local or domain access, including Performance Monitor Users, Performance Log Users, Event Log Readers, WMI root\cimv2 access, Windows Management Instrumentation firewall rules, and Remote Registry where required. Use Enable WMI For SQL Server Monitoring for the step-by-step Windows WMI setup.

For general host OS guidance, see Host OS Login.

SQL Server Connection Troubleshooting

  • If Windows authentication fails, confirm the Mini DBA Engine service account has access to SQL Server.
  • If SQL authentication fails, confirm SQL authentication is enabled and the login is not locked out or disabled.
  • If only master and tempdb appear, grant VIEW ANY DATABASE.
  • If file or object metadata is missing, grant VIEW ANY DEFINITION.
  • If activity, waits, and query pages are empty, grant VIEW SERVER STATE.
  • If Agent jobs are missing, add the monitoring user to msdb SQLAgentReaderRole and db_datareader.
  • If error log or deadlock history is missing, grant EXEC on xp_readerrorlog and review Extended Events permissions.
  • Right-click the SQL Server in the tree and open Connectivity Log for SQL Server login, timeout, TLS, network, and data-access errors captured by the engine.

SQL Server Monitoring Permissions FAQ

Can Mini DBA use Windows authentication?

Yes. Leave Username blank in the Add Server panel for Windows authentication. The Mini DBA Engine process identity must have SQL Server access and the required SQL Server permissions.

Is sysadmin required?

No. Sysadmin is convenient for testing but not recommended for routine monitoring. Use the grants shown above for a least-privilege monitoring login.

Does Mini DBA change traces when ALTER TRACE is granted?

The permission modal notes that Mini DBA uses ALTER TRACE to show running traces. The app does not alter running traces just because the permission exists.

Which permission is most important?

VIEW SERVER STATE is the most important SQL Server monitoring permission. Without it, many DMV-based pages cannot show useful activity, wait, query, CPU, and memory data.

Related Pages