Module 15: Monitoring
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 operations Availability of tools for monitoring
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
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
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 SQL Server also writes the useful information to the Microsoft Windows Application log which can be read using the Event Viewer
Demonstration: Viewing Logs and Events In this demonstration you will learn to: Locate and Review SQL Server Logs
Demonstration: 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
Monitoring Performance Database server has to be monitored for CPU, memory, processes, virtual memory, network, I/O, and storage Tools 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
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
Monitoring Tools Microsoft Windows / SQL Server Tools Activity Monitor Performance Data Collector Management Data Warehouse DBCC commands Dynamic Management Objects Extended Events Performance Monitor SQL Server Agent SQL Profiler System Center Advisor Third-Party Tools BMC Software Performance Manager for Databases Embarcadero DBArtisan Computer Associates Unicenter Quest Software Spotlight Idera Diagnostic Manager
Demonstration: Activity Monitor In this demonstration you will learn to: Use SQL Server Activity Monitor to observe specific resources and queries.
Demonstration: Setting Alerts to Automate Monitoring In this demonstration you will learn to: Create an Alert based on SQL Server performance counter
Review We learned that server, database listener, and database are the components that need to be monitored We learned the types of monitoring cover availability, errors, and performance We saw the operating system tools to check performance of server hardware and operating system components We learned how the various subcomponents of the database and instance can be monitored using counters and logs We 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