Module 15 Monitoring SQL Server 2008 R2 with Alerts and Notifications.

Slides:



Advertisements
Similar presentations
Module 8 Importing and Exporting Data. Module Overview Transferring Data To/From SQL Server Importing & Exporting Table Data Inserting Data in Bulk.
Advertisements

Module 12: Auditing SQL Server Environments
Module 17 Tracing Access to SQL Server 2008 R2. Module Overview Capturing Activity using SQL Server Profiler Improving Performance with the Database Engine.
Database Mail. What is Database Mail? In a short answer, Database Mail is a feature of SQL Server which let Database sends Mail or SMS to anybody after.
Week 6: Chapter 6 Agenda Automation of SQL Server tasks using: SQL Server Agent Scheduling Scripting Technologies.
Module 5: Performing Administrative Tasks. Overview Configuration Tasks Routine SQL Server Administrative Tasks Automating Routine Maintenance Tasks Creating.
Maintaining and Automating SQL Server
SQL Server Agent Keith Binford. SQL Server Agent SQL Server Agent is a Windows service that can execute and schedule tasks and jobs.
Module 4 Working with Databases. Module Overview Overview of SQL Server Databases Working with Files and Filegroups Moving Database Files.
Module 20 Troubleshooting Common SQL Server 2008 R2 Administrative Issues.
SQL Server 2005 Implementation and Maintenance Chapter 10: Maintaining and Automating SQL Server.
Module 5 Understanding SQL Server 2008 R2 Recovery Models.
Using the Windows Event Viewer and Task Scheduler Chapter 5.
Module 14 Monitoring and Maintaining Windows Server® 2008 Servers.
Slide 1 of 9 Presenting 24x7 Scheduler The art of computer automation Press PageDown key or click to advance.
Configuring and Troubleshooting Identity and Access Solutions with Windows Server® 2008 Active Directory®
Today’s Agenda Chapter 12 Admin Tasks Chapter 13 Automating Admin Tasks.
Module 13 Automating SQL Server 2008 R2 Management.
Module 17 Storing XML Data in SQL Server® 2008 R2.
Course 6421A Module 7: Installing, Configuring, and Troubleshooting the Network Policy Server Role Service Presentation: 60 minutes Lab: 60 minutes Module.
Managing Client Access
Module 4 Managing Client Access. Module Overview Configuring the Client Access Server Role Configuring Client Access Services for Outlook Clients Configuring.
Module 15: Monitoring. Overview Formulate requirements and identify resources to monitor in a database environment Types of monitoring that can be carried.
Module 18 Monitoring SQL Server 2008 R2. Module Overview Monitoring Activity Capturing and Managing Performance Data Analyzing Collected Performance Data.
Implementing Secure Shared File Access
Module 12 Handling Errors in T-SQL Code. Module Overview Understanding T-SQL Error Handling Implementing T-SQL Error Handling Implementing Structured.
Securing Microsoft® Exchange Server 2010
It is one of the techniques to create a stand by server. Introduced in SQL 2000,enhanced in It is a High Availability as well as Disaster recovery.
Maintaining a Mirrored Database Tips and Tricks by Paul G. Hiles.
Configuring Encryption and Advanced Auditing
Module 7: Fundamentals of Administering Windows Server 2008.
Module 9 Configuring Messaging Policy and Compliance.
20411B 8: Installing, Configuring, and Troubleshooting the Network Policy Server Role Presentation: 60 minutes Lab: 60 minutes After completing this module,
Module 10: Monitoring ISA Server Overview Monitoring Overview Configuring Alerts Configuring Session Monitoring Configuring Logging Configuring.
Module 9 Designing and Implementing Stored Procedures.
Module 9 Authenticating and Authorizing Users. Module Overview Authenticating Connections to SQL Server Authorizing Logins to Access Databases Authorization.
Module 6 Backup of SQL Server 2008 R2 Databases. Module Overview Backing up Databases and Transaction Logs Managing Database Backups Working with Backup.
Learningcomputer.com SQL Server 2008 – Administration, Maintenance and Job Automation.
IT 456 Seminar 5 Dr Jeffrey A Robinson. Overview of Course Week 1 – Introduction Week 2 – Installation of SQL and management Tools Week 3 - Creating and.
Module 14 Configuring Security for SQL Server Agent.
Make SQL Server to talk you! Antonios Chatzipavlis Software Architect, Development Evangelist, IT Consultant MCT, MCITP, MCPD, MCSD, MCDBA, MCSA, MCTS,
Module 9 Configuring Messaging Policy and Compliance.
Module 16: Performing Ongoing Database Maintenance
1 Chapter Overview Performing Configuration Tasks Setting Up Additional Features Performing Maintenance Tasks.
Module 5 Managing Message Transport. Module Overview Overview of Message Transport Configuring Message Transport.
Module 14 Monitoring and Optimizing SharePoint Performance.
VERITAS Cluster Server for Solaris Event Notification.
Module 5 Managing Message Transport. Module Overview Overview of Message Transport Configuring Message Transport.
Module 3 Configuring File Access and Printers on Windows 7 Clients.
Module 7 Planning and Deploying Messaging Compliance.
37 Copyright © 2007, Oracle. All rights reserved. Module 37: Executing Workflow Processes Siebel 8.0 Essentials.
1 Chapter Overview Defining Operators Creating Jobs Configuring Alerts Creating a Database Maintenance Plan Creating Multiserver Jobs.
Configuring and Troubleshooting Identity and Access Solutions with Windows Server® 2008 Active Directory®
Module 1 Introduction to SQL Server® 2008 R2 and its Toolset.
Module 10: Windows Firewall and Caching Fundamentals.
Module 12: Configuring and Managing Storage Technologies
Module 6: Administering Reporting Services. Overview Server Administration Performance and Reliability Monitoring Database Administration Security Administration.
Microsoft ® Official Course Module 6 Managing Software Distribution and Deployment by Using Packages and Programs.
SQL Database Management
Module 1: SQL Server Overview
SQL Server Agent All the Knobs You Need to Know
Project Management: Messages
Deploying and Configuring SSIS Packages
Automating SQL Server Management
Module 5: Implementing Data Integrity by Using Constraints
Course: Module: Lesson # & Name Instructional Material 1 of 32 Lesson Delivery Mode: Lesson Duration: Document Name: 1. Professional Diploma in ERP Systems.
Module 10: Implementing Managed Code in the Database
Ch 10. Maintaining and Automating SQL Server
Presentation transcript:

Module 15 Monitoring SQL Server 2008 R2 with Alerts and Notifications

Module Overview Configuration of Database Mail Monitoring SQL Server Errors Configuring Operators, Alerts and Notifications

Lesson 1: Configuration of Database Mail Overview of Database Mail Database Mail Profiles Database Mail Security Database Mail Logs and Retention Demonstration 1A: Configuring Database Mail

Overview of Database Mail  Easily setup via the Database Mail Configuration Wizard Different profiles provided Background delivery using Service Broker  Used by SQL Server Agent Mail Sends Job and Alert notifications Requires a mail profile for the SQL Server Agent account Database Mail is an implementation of the standard SMTP protocol that enables database components to send s.

Database Mail Profiles  A Database Mail profile defines one or more accounts Defines configuration used to send mails Allows multiple Database Mail Accounts for reliability  Default profile for a login is used when not specified Profile TypeDescription Private Is accessible only to specific users or roles. A default private profile takes precedence over the default public profile Public Can be used by any user or role with permissions to use it

Database Mail Security Database mail:  Runs under the SQL Server Engine service account in an isolated process  Uses stored procedures that are disabled by default  Will only send mail for members of Databas UserRole in msdb. (Members of sysadmin server role can send by default)  Can prohibit the use of specific file extensions and file attachment sizes Private profiles are restricted to specific users or roles

Database Mail Logs and Retention Database Mail logs information for troubleshooting  Audits messages and attachments  A retention policy needs to be planned to limit msdb growth USE msdb; GO datetime ; = DATEADD(m, -1,GETDATE()); EXECUTE EXECUTE GO USE msdb; GO datetime ; = DATEADD(m, -1,GETDATE()); EXECUTE EXECUTE GO

Demonstration 1A: Configuring Database Mail In this demonstration, you will see:  How to configure Database Mail  How to configure SQL Server Agent to use the profile

Lesson 2: Monitoring SQL Server Errors What is in an Error? Error Severity Levels Configuring the SQL Server Error Log Demonstration 2A: Cycling the Error Log

What's in an Error? Errors raised by the database engine have the following attributes: AttributeDescription Error numberEach error message has a unique error number Error MessageString containing diagnostic info about the cause of the error SeverityIndicates how serious the error is StateValue used to determine the location in code at which an error occurred Procedure NameName of the stored procedure or trigger in which the error occurred (if applicable) Line NumberIndicates which line of a batch, stored procedure, trigger or function the error was fired

Error Severity The severity of an error indicates the type of problem encountered by SQL Server Error Number Range Description 0 to 9Informational messages 10Informational messages that return status information 11 to 16Errors that can be corrected by the user 17 to 19Software errors that cannot be corrected by the user 20 to 24Serious system errors 25SQL Server service terminating error

Configuring the SQL Server Error Log Severe Errors are written to both Application and SQL Server Logs  Can be configured using sp_altermessage New SQL Server error log file is created with every instance restart  Six log files are kept by default  Use sp_cycle_errorlog to change to a new log file

Demonstration 2A: Cycling the Error Log In this demonstration you will see:  How to view the error log using a text editor and SSMS  How to cycle the log file

Lesson 3: Configuring Operators, Alerts and Notifications SQL Server Agent Operator Overview Demonstration 3A: Configuring SQL Server Agent Operators Overview of SQL Server Alerts Creating Alerts Configuring Alert Actions Troubleshooting Alerts and Notifications Demonstration 3B: Alerts and Notifications

SQL Server Agent Operator Overview Operators can be notified using: Pager Net Send (avoid this option) A Fail-safe operator can be configured A SQL Server Agent Operator is a person or group that can receive notifications from a job or an alert.

Demonstration 3A: Configuring SQL Server Agent Operators In this demonstration, you will see:  How to create an Operator  How to use an Operator in a SQL Server Agent Job

Overview of SQL Server Alerts Alerts can be triggered by: Application log events Performance conditions WMI events Alerts can: Notify an operator Start a job An Alert is a predefined response to an event.

Create an Alert EXEC Transaction GO EXEC Transaction GO Created using SSMS or sp_add_alert Define how to detect and action to be taken Created using SSMS or sp_add_alert Define how to detect and action to be taken

Configuring Alert Actions EXEC = N'AdventureWorks2008R2 Transaction Log = 1; GO EXEC = N'AdventureWorks2008R2 Transaction Log = 1; GO Jobs can be started Jobs can use details from the calling step via tokens Operators can be notified Jobs can be started Jobs can use details from the calling step via tokens Operators can be notified

Troubleshooting Alerts and Notifications 1. Ensure that SQL Server Agent is running 2. Check that error message is written to Application Log  Check Application Log configuration 3. Ensure that the alert is enabled 4. Check that the alert was raised (last fired)  Ensure that delay between responses is not set too high 5. If the alert was raised but no action was taken  Check the job  Check database mail and SMTP Server configuration  Test the database mail profile used in SSMS

Demonstration 3B: Alerts and Notifications In this demonstration, you will see how to create an Alert to send a notification when a transaction log becomes full

Lab 15: Monitoring SQL Agent Jobs with Alerts and Notifications Exercise 1: Configure Database Mail Exercise 2: Implement Notifications Challenge Exercise 3: Implement Alerts (Only if time permits) Logon information Estimated time: 45 minutes

Lab Scenario You have configured automated management tasks using SQL Server Agent and have configured security for those tasks. You now need to configure alerts and notifications for your Proseware system. The IT Support team at AdventureWorks has a defined escalation policy for SQL Server systems. As Proseware is part of the group of companies owned by AdventureWorks, you need to implement the relevant parts of this policy. The IT Support team has supplied you with details from the policy that they have determined are needed for your Proseware server. For some automated tasks, notifications need to be sent every time the tasks are completed, whether or not the tasks work as expected. For other tasks, notifications only need to be sent if the tasks fail for some reason. If you have enough time, you should also configure SQL Server to alert you if severe errors occur on the server.

Lab Review SQL Server has Database Mail and SQL Mail. Which should you configure? Why is the option to use NET SEND for notifications not very useful?

Module Review and Takeaways Review Questions Best Practices