Skip to main content

SQL Server

Pre-requisites​

Check the supported versions​

DBmarlin supports versions of SQL Server from 2008 and above including SQL Server on Linux and cloud services such as Azure SQL and Amazon RDS SQL Server. Please check the list of supported platforms before continuing and contact us if you are not sure.

Create a monitoring user with the correct permissions​

Before adding a target MS SQL Server instance in the UI you should first create a dbmarlin user in the target database instance. This needs to be a SQL Server authenticated account (Windows Authentication not currently supported). Note you can choose to use a name other than dbmarlin if you prefer.

For SQL Server Self-hosted you can create a monitoring user like this:

CREATE LOGIN dbmarlin WITH PASSWORD = 'securepassword';
CREATE USER dbmarlin for login dbmarlin;
use master

EXEC sp_addsrvrolemember 'dbmarlin', 'sysadmin';
GO

For SQL Server cloud services such as Azure SQL and Amazon RDS SQL Server you can create a monitoring user like this:

For cloud platforms such where granting sysadmin is not possible, then a dbmarlin user with the following permissions will work. Remember that the last step of creating a dbmarlin USER to map to your dbmarlin LOGIN needs to be repeated in every database you want to monitor.

USE master;
CREATE LOGIN dbmarlin WITH PASSWORD = 'securepassword';

CREATE SERVER ROLE dbmarlin_role;
ALTER SERVER ROLE dbmarlin_role ADD MEMBER dbmarlin;
ALTER SERVER ROLE processadmin ADD MEMBER dbmarlin;

GRANT CONNECT SQL TO dbmarlin_role;
GRANT VIEW ANY DATABASE TO dbmarlin_role;
GRANT VIEW ANY DEFINITION TO dbmarlin_role;
GRANT VIEW SERVER STATE to dbmarlin_role;

-- For each database you are monitoring create a USER and map to the LOGIN you created above
USE {database};
CREATE USER dbmarlin;
ALTER USER dbmarlin WITH login = dbmarlin;

Adding the Database Target​

This is done through the User Interface using the Add Database screen