Monitoring SQL Server With Alerts and Notifications
Monitoring SQL Server With Alerts and Notifications
Monitoring SQL Server With Alerts and Notifications
• What Is an Error?
• Error Severity Levels
• Configuring the SQL Server Error Log
• Demonstration: Working with the Database Engine
Error Log
What Is an Error?
• SQL Server
creates a new
error log file
when it starts:
• Retains six log
files by default
• Uses sp_cycle_errorlog to force a new file
• Default size of each log is unlimited
SQL Log File Viewer
Lesson 2: Configuring Database Mail
EXECUTE
dbo.sysmail_delete_mailitems_sp
@sent_before = @CutoffDate;
EXECUTE dbo.sysmail_delete_log_sp
@logged_before = @CutoffDate;
Lesson 3: Operators, Alerts, and Notifications
• Alerts can:
• Notify an operator
• Start a job
WMI Event from 411 (Group Policy)
On Another Windows Note…
Creating Alerts
• Create alerts:
• Using SSMS
• Using sp_add_alert
• Actions:
• Execute a job
• Notify one or more operator
Logon Information
Virtual machine: 20764C-MIA-SQL
User name: ADVENTUREWORKS\Student
Password: Pa55w.rd