IO figyelmeztetések

Az alábbi figyelmeztetéseket ajánlott minden SQL Server esetében beállítani. A kód kommentjeiben van leírás mindegyikről, illetve a hozzá tartozó Technet cikk is megtalálható. Az értesítéshez emailt használ az alábbi kód, mely feltételezi, hogy a Database Mail szolgáltatás engedélyezve van és beállításra is került.

DECLARE @EmailAddress varchar(100);
SET @EmailAddress = '<your email address>';

/*
A Windows read or write request has failed. 
The error code that is returned by Windows and the corresponding text are inserted into the message. 
In the read case, SQL Server will have already retried the read request four times. 
This error is often the result of a hardware error, but may be caused by the device driver. 
For more information about error 823, see http://support.microsoft.com/kb/828339. 
*/
USE [msdb];

EXEC msdb.dbo.sp_add_alert @name=N'ERROR_823', 
            @message_id=823, 
            @severity=0, 
            @enabled=1, 
            @delay_between_responses=0, 
            @include_event_description_in=1, 
            @job_id=N'00000000-0000-0000-0000-000000000000';
            
EXEC msdb.dbo.sp_add_notification @alert_name=N'ERROR_823', @operator_name=@EmailAddress, @notification_method = 1;
/*
This error indicates that Windows reports that the page is successfully read from disk, 
but SQL Server has discovered something wrong with the page. 
This error is similar to error 823 except that Windows did not detect the error. 
This usually indicates a problem in the I/O subsystem, such as a failing disk drive, disk firmware problems, faulty device driver, and so on.
http://msdn.microsoft.com/en-us/library/aa337274.aspx
*/
EXEC msdb.dbo.sp_add_alert @name=N'ERROR_824', 
            @message_id=824, 
            @severity=0, 
            @enabled=1, 
            @delay_between_responses=0, 
            @include_event_description_in=1, 
            @job_id=N'00000000-0000-0000-0000-000000000000';
            
EXEC msdb.dbo.sp_add_notification @alert_name=N'ERROR_824', @operator_name=@EmailAddress, @notification_method = 1;

/*
This message indicates that the read operation had to be reissued at least one time, and indicates a major problem with the disk hardware. 
This message does not currently indicate a SQL Server problem, but the disk problem could cause data loss or database corruption if it is not resolved. 
The system event log may contain related events that help to diagnose the problem. 
http://msdn.microsoft.com/en-us/library/aa337447.aspx
*/
EXEC msdb.dbo.sp_add_alert @name=N'ERROR_825', 
            @message_id=825, 
            @severity=0, 
            @enabled=1, 
            @delay_between_responses=0, 
            @include_event_description_in=1, 
            @job_id=N'00000000-0000-0000-0000-000000000000';
            
EXEC msdb.dbo.sp_add_notification @alert_name=N'ERROR_825', @operator_name=@EmailAddress, @notification_method = 1;

/*
This message indicates that SQL Server has issued a read or write request from disk, and that the request has taken longer than 15 seconds to return. 
This error is reported by SQL Server and indicates a problem with the IO subsystem.

Possible Causes
This problem can be caused system performance issues, hardware errors, firmware errors, device driver problems, or filter driver intervention in the IO process.

http://msdn.microsoft.com/en-us/library/aa337269.aspx
*/
EXEC msdb.dbo.sp_add_alert @name=N'ERROR_833', 
            @message_id=833, 
            @severity=0, 
            @enabled=1, 
            @delay_between_responses=0, 
            @include_event_description_in=1, 
            @job_id=N'00000000-0000-0000-0000-000000000000';
            
EXEC msdb.dbo.sp_add_notification @alert_name=N'ERROR_833', @operator_name=@EmailAddress, @notification_method = 1;

Add comment