Skip to content

Instantly share code, notes, and snippets.

@matthew-n
Last active January 20, 2021 18:57
Show Gist options
  • Save matthew-n/0baa6ea7cf1d8682e1604d8f003320ab to your computer and use it in GitHub Desktop.
Save matthew-n/0baa6ea7cf1d8682e1604d8f003320ab to your computer and use it in GitHub Desktop.
ozar_toolkit_setup

Setting up for minimal user (non-dba) permissions

One-time steps

USE master;
GO

CREATE CERTIFICATE diagnostics_cert
    ENCRYPTION BY PASSWORD = '5OClockSomewhere'
    WITH SUBJECT = 'Certificate for sp_BlitzFirst',
    START_DATE = '20130711', EXPIRY_DATE = '21000101';
GO

CREATE LOGIN diagnostics_login FROM CERTIFICATE diagnostics_cert;
GO

CREATE USER sp_BlitzFirst_login FROM CERTIFICATE diagnostics_cert;
GO
-- add database exec permissions
GRANT EXECUTE ON dbo.sp_BlitzFirst TO sp_BlitzFirst_login;
GRANT EXECUTE ON dbo.sp_BlitzCache TO sp_BlitzFirst_login;
GRANT EXECUTE ON dbo.sp_BlitzIndex TO sp_BlitzFirst_login;
GRANT EXECUTE ON dbo.sp_Blitz TO sp_BlitzFirst_login;
GO

GRANT EXECUTE ON dbo.sp_BlitzFirst TO [diagnostic_user];
GO

Install Toolkit

-- install Toolkit

ADD SIGNATURE TO sp_BlitzFirst BY CERTIFICATE sp_BlitzFirst_cert WITH PASSWORD = '5OClockSomewhere';
GO
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment