14
Module 15: Monitoring

Module 15: Monitoring. Overview Formulate requirements and identify resources to monitor in a database environment Types of monitoring that can be carried

Embed Size (px)

Citation preview

Page 1: Module 15: Monitoring. Overview Formulate requirements and identify resources to monitor in a database environment Types of monitoring that can be carried

Module 15: Monitoring

Page 2: Module 15: Monitoring. Overview Formulate requirements and identify resources to monitor in a database environment Types of monitoring that can be carried

Overview

Formulate requirements and identify resources to monitor in a database environment

Types of monitoring that can be carried out to ensure:

• Maximum availability

• Optimal performance

• Error-free operationsAvailability of tools for monitoring

Page 3: Module 15: Monitoring. Overview Formulate requirements and identify resources to monitor in a database environment Types of monitoring that can be carried

Monitoring Availability

Monitoring should cover availability, errors, and performance of all components of the database environment

Components to be monitored for availability are:

• Node or server – server hardware and all components in the path from the client

• Database listener – in SQL Server the listener is part of the database service

• Database monitoring• High-level – checks for existence of instance• Low-level – ensures work can be performed on the database

Page 4: Module 15: Monitoring. Overview Formulate requirements and identify resources to monitor in a database environment Types of monitoring that can be carried

Monitoring Errors

The database and its components return status when successful and error messages of when failure or events are encountered

Error messages in Oracle have an error code made up of a number and a descriptive error message

Error messages in SQL Server are composed of:

• Unique message number

• Severity level

• Error state number – identifies source

• Error message – description

Page 5: Module 15: Monitoring. Overview Formulate requirements and identify resources to monitor in a database environment Types of monitoring that can be carried

Error Logs

Oracle alert file (alert.log) has equivalent in error logs of SQL Server

• Logs can be read using SQL Server Management Studio or any text editor

Previous 6 error log files are kept by default but you can configure to keep more – up to 99

Trace files are not created by default but can be created manually using Performance Monitor or Profiler• Actually there is an automatic ‘BlackBox’ trace, but …

SQL Server also writes the useful information to the Microsoft Windows Application log which can be read using the Event Viewer

Page 6: Module 15: Monitoring. Overview Formulate requirements and identify resources to monitor in a database environment Types of monitoring that can be carried

Demonstration 1: Viewing Logs and Events

In this demonstration you will learn to:

Locate and Review SQL Server Logs

Page 7: Module 15: Monitoring. Overview Formulate requirements and identify resources to monitor in a database environment Types of monitoring that can be carried

Demonstration 2: Error Messages

In this demonstration you will learn to:

Create custom error messages

Use Try..Catch Blocks

Simulate data validation

Review SQL Server Log Entries

Page 8: Module 15: Monitoring. Overview Formulate requirements and identify resources to monitor in a database environment Types of monitoring that can be carried

Monitoring Performance

Database server has to be monitored for CPU, memory, processes, virtual memory, network, I/O, and storageTools and utilities for monitoring server resources are:

• Microsoft Windows – Task Manager, Performance Monitor, Windows Explorer

Monitoring database storage:

• Database Files – size, growth, free space, status, archiving of logs• Tablespaces or Filegroups – size, growth, fragmentation, status• Extents – size and number of extents allocated to objects,

performance of rollback, temporary and sort space

Page 9: Module 15: Monitoring. Overview Formulate requirements and identify resources to monitor in a database environment Types of monitoring that can be carried

Monitoring Performance – Database and Instance

Monitoring of database instance:

• Memory – performance of subcomponents of SGA (Oracle) and memory pool (SQL Server)• Processes – performance of background and server

processes (Oracle) or worker threads (SQL Server)• Sessions and Transactions – number and activity of

sessions and resource usage by transactions• Locks and Latches – waits for locks and latches, and

deadlocks• Parsing – parsing activity indicating performance of SQL

and cursors

Page 10: Module 15: Monitoring. Overview Formulate requirements and identify resources to monitor in a database environment Types of monitoring that can be carried

Monitoring Tools

Third-Party Tools• BMC Software—

Performance Manager for Databases

• Embarcadero—DBArtisan

• Computer Associates—Unicenter

• Quest Software—Spotlight

Microsoft Windows / SQL Server Tools• Activity Monitor• Data Collector /

Management Data Warehouse

• DBCC commands• Dynamic Management

Objects• Performance Monitor• Reports Dashboard in

Management Studio• SQL Server Agent • SQL Profiler

Page 11: Module 15: Monitoring. Overview Formulate requirements and identify resources to monitor in a database environment Types of monitoring that can be carried

Demonstration 3: Task Manager

In this demonstration you will learn to:

Observe SQL Server services with the Windows Task Manager

Page 12: Module 15: Monitoring. Overview Formulate requirements and identify resources to monitor in a database environment Types of monitoring that can be carried

Demonstration 4: Activity Monitor

In this demonstration you will learn to:

Use the new SQL Server 2008 Activity Monitor to observe specific resources and queries.

Page 13: Module 15: Monitoring. Overview Formulate requirements and identify resources to monitor in a database environment Types of monitoring that can be carried

Demonstration 5: Setting Alerts to Automate Monitoring

In this demonstration you will learn to:

Define a Database Mail Profile and Account

Create an Alert based on SQL Server counter events

Review an automatically generated e-mail to a database administrator.

Page 14: Module 15: Monitoring. Overview Formulate requirements and identify resources to monitor in a database environment Types of monitoring that can be carried

Review

We learned that server, database listener, and database are the components that need to be monitoredWe learned the types of monitoring cover availability, errors, and performanceWe saw the operating system tools to check performance of server hardware and operating system componentsWe learned how the various subcomponents of the database and instance can be monitored using counters and logsWe were introduced to tools for monitoring SQL Server database and servers such as Performance Monitor, the Data Collector and Performance Data Warehouse, SQL Server Agent, and SQL Profiler