创建MS SQL Server数据库监控用户脚本
注: 此适用于okp-docker-solo-1.0.3-beta11及以后版本监控及运维工具箱SQLSERVER全面巡检
USE [master]
CREATE LOGIN onekeeper WITH PASSWORD = ‘Onek11per’ , CHECK_POLICY=OFF;
GRANT VIEW ANY DEFINITION to [onekeeper]
GRANT VIEW SERVER STATE to [onekeeper]
Go
CREATE USER [onekeeper] FOR LOGIN [onekeeper]
EXEC sp_addrolemember N’db_datareader’, N’onekeeper’
GRANT execute on sys.xp_readerrorlog to onekeeper
Go
USE [msdb]
CREATE USER [onekeeper] FOR LOGIN [onekeeper]
EXEC sp_addrolemember N’db_datareader’, N’onekeeper’
Go