警告の登録

  • 重大度に応じた警告の設定

下記のコマンドで警告を設定します。

USE [msdb]
GO

/****** Object:  Alert [Sev. 19 Errors]    Script Date: 2015/11/23 21:07:46 ******/
EXEC msdb.dbo.sp_add_alert @name=N'Sev. 19 Errors', 
		@message_id=0, 
		@severity=19, 
		@enabled=1, 
		@delay_between_responses=10, 
		@include_event_description_in=5, 
		@category_name=N'[Uncategorized]', 
		@job_id=N'00000000-0000-0000-0000-000000000000'
GO

/****** Object:  Alert [Sev. 20 Errors]    Script Date: 2015/11/23 21:07:46 ******/
EXEC msdb.dbo.sp_add_alert @name=N'Sev. 20 Errors', 
		@message_id=0, 
		@severity=20, 
		@enabled=1, 
		@delay_between_responses=10, 
		@include_event_description_in=5, 
		@category_name=N'[Uncategorized]', 
		@job_id=N'00000000-0000-0000-0000-000000000000'
GO

/****** Object:  Alert [Sev. 21 Errors]    Script Date: 2015/11/23 21:07:46 ******/
EXEC msdb.dbo.sp_add_alert @name=N'Sev. 21 Errors', 
		@message_id=0, 
		@severity=21, 
		@enabled=1, 
		@delay_between_responses=10, 
		@include_event_description_in=5, 
		@category_name=N'[Uncategorized]', 
		@job_id=N'00000000-0000-0000-0000-000000000000'
GO

/****** Object:  Alert [Sev. 22 Errors]    Script Date: 2015/11/23 21:07:46 ******/
EXEC msdb.dbo.sp_add_alert @name=N'Sev. 22 Errors', 
		@message_id=0, 
		@severity=22, 
		@enabled=1, 
		@delay_between_responses=10, 
		@include_event_description_in=5, 
		@category_name=N'[Uncategorized]', 
		@job_id=N'00000000-0000-0000-0000-000000000000'
GO

/****** Object:  Alert [Sev. 23 Errors]    Script Date: 2015/11/23 21:07:46 ******/
EXEC msdb.dbo.sp_add_alert @name=N'Sev. 23 Errors', 
		@message_id=0, 
		@severity=23, 
		@enabled=1, 
		@delay_between_responses=10, 
		@include_event_description_in=5, 
		@category_name=N'[Uncategorized]', 
		@job_id=N'00000000-0000-0000-0000-000000000000'
GO

/****** Object:  Alert [Sev. 24 Errors]    Script Date: 2015/11/23 21:07:46 ******/
EXEC msdb.dbo.sp_add_alert @name=N'Sev. 24 Errors', 
		@message_id=0, 
		@severity=24, 
		@enabled=1, 
		@delay_between_responses=10, 
		@include_event_description_in=5, 
		@category_name=N'[Uncategorized]', 
		@job_id=N'00000000-0000-0000-0000-000000000000'
GO

/****** Object:  Alert [Sev. 25 Errors]    Script Date: 2015/11/23 21:07:46 ******/
EXEC msdb.dbo.sp_add_alert @name=N'Sev. 25 Errors', 
		@message_id=0, 
		@severity=25, 
		@enabled=1, 
		@delay_between_responses=10, 
		@include_event_description_in=5, 
		@category_name=N'[Uncategorized]', 
		@job_id=N'00000000-0000-0000-0000-000000000000'
GO

alerts

 

重大度についてはこちらのサイトを参考にしてください。

https://msdn.microsoft.com/ja-jp/library/ms164086%28v=sql.120%29.aspx


管理人 has written 31 articles