Agenda for Today Do Chapter 14 Final Project Review for Final.

Slides:



Advertisements
Similar presentations
Chapter 9. Performance Management Enterprise wide endeavor Research and ascertain all performance problems – not just DBMS Five factors influence DB performance.
Advertisements

Module 13: Performance Tuning. Overview Performance tuning methodologies Instance level Database level Application level Overview of tools and techniques.
A Guide to SQL, Seventh Edition. Objectives Use joins to retrieve data from more than one table Use the IN and EXISTS operators to query multiple tables.
MCTS GUIDE TO MICROSOFT WINDOWS 7 Chapter 10 Performance Tuning.
© 2006 ITT Educational Services Inc. Course Name: IT390 Business Database Administration Unit 10 Slide 1 IT390 Business Database Administration Unit 10:
Module 20 Troubleshooting Common SQL Server 2008 R2 Administrative Issues.
SQL Server 2005 Implementation and Maintenance Chapter 10: Maintaining and Automating SQL Server.
6. Monitoring SQL Server Performance
Module 15: Managing Transactions and Locks. Overview Introduction to Transactions and Locks Managing Transactions SQL Server Locking Managing Locks.
70-290: MCSE Guide to Managing a Microsoft Windows Server 2003 Environment Chapter 11: Monitoring Server Performance.
Chapter 14 Chapter 14: Server Monitoring and Optimization.
11 MONITORING MICROSOFT WINDOWS SERVER 2003 Chapter 3.
Microsoft SQL Server Administration for SAP SQL Server Architecture.
Anil Desai Austin CodeCamp  Anil Desai ◦ Independent consultant (Austin, TX) ◦ Author of several SQL Server books ◦ Instructor, “Implementing and.
Working with SQL and PL/SQL/ Session 1 / 1 of 27 SQL Server Architecture.
Chapter 9 Overview  Reasons to monitor SQL Server  Performance Monitoring and Tuning  Tools for Monitoring SQL Server  Common Monitoring and Tuning.
Module 8: Monitoring SQL Server for Performance. Overview Why to Monitor SQL Server Performance Monitoring and Tuning Tools for Monitoring SQL Server.
SQL Server Performance Audit and Tuning Jason Pack.
Today’s Agenda Chapter 12 Admin Tasks Chapter 13 Automating Admin Tasks.
Virtual Memory Tuning   You can improve a server’s performance by optimizing the way the paging file is used   You may want to size the paging file.
Module 15: Monitoring. Overview Formulate requirements and identify resources to monitor in a database environment Types of monitoring that can be carried.
Module 8: Server Management. Overview Server-level and instance-level resources such as memory and processes Database-level resources such as logical.
Module 18 Monitoring SQL Server 2008 R2. Module Overview Monitoring Activity Capturing and Managing Performance Data Analyzing Collected Performance Data.
Chapter 4 SQL. SQL server Microsoft SQL Server is a client/server database management system. Microsoft SQL Server is a client/server database management.
Introduction to Databases Chapter 8: Improving Data Access.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 10 Database Performance Tuning and Query Optimization.
MCTS Guide to Microsoft Windows 7
Key Concepts About Performance Factors Affecting SQL Performance SQL Performance Tuning Methodologies SQL Performance Tuning Tools 1.
PHP Programming with MySQL Slide 8-1 CHAPTER 8 Working with Databases and MySQL.
Chapter Oracle Server An Oracle Server consists of an Oracle database (stored data, control and log files.) The Server will support SQL to define.
© Wiley Inc All Rights Reserved. MCSE: Windows Server 2003 Active Directory Planning, Implementation, and Maintenance Study Guide, Second Edition.
70-290: MCSE Guide to Managing a Microsoft Windows Server 2003 Environment, Enhanced Chapter 11: Monitoring Server Performance.
Agenda for Today Chapter 5 –Skip Lesson 2 Review questions Midterm Chapter 6 Review questions.
1 Intro to JOINs SQL INNER JOIN SQL OUTER JOIN SQL FULL JOIN SQL CROSS JOIN Intro to VIEWs Simple VIEWs Considerations about VIEWs VIEWs as filters ALTER.
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.
Learningcomputer.com SQL Server 2008 – Profiling and Monitoring Tools.
Module 16: Performing Ongoing Database Maintenance
© 2008 Quest Software, Inc. ALL RIGHTS RESERVED. Perfmon and Profiler 101.
1 Chapter Overview Preparing to Upgrade Performing a Version Upgrade from Microsoft SQL Server 7.0 Performing an Online Database Upgrade from SQL Server.
1 Chapter Overview Performing Configuration Tasks Setting Up Additional Features Performing Maintenance Tasks.
70-290: MCSE Guide to Managing a Microsoft Windows Server 2003 Environment, Enhanced Chapter 11: Monitoring Server Performance.
By Shanna Epstein IS 257 September 16, Cnet.com Provides information, tools, and advice to help customers decide what to buy and how to get the.
14.70 © 2004 Pearson Education, Inc. Exam Managing and Maintaining a Microsoft® Windows® Server 2003 Environment Lesson 14: Monitoring Windows Server.
Week 7 : Chapter 7 Agenda SQL 710 Maintenance Plan:
Windows Server 2003 系統效能監視 林寶森
MISSION CRITICAL COMPUTING Siebel Database Considerations.
1 Chapter Overview Developing a Performance Monitoring Methodology Choosing Among Monitoring Tools Performing Monitoring Tasks.
A Guide to SQL, Eighth Edition Chapter Five Multiple-Table Queries.
1 Copyright © 2005, Oracle. All rights reserved. Following a Tuning Methodology.
Presented by Vishy Grandhi.  Lesson 1: AX Overview  Lesson 2: Role based security  Lesson 3: Monitoring  Troubleshooting.
Module 14 Monitoring and Maintaining Windows Server® 2008 Servers.
Module 11: Managing Transactions and Locks
Module 6: Administering Reporting Services. Overview Server Administration Performance and Reliability Monitoring Database Administration Security Administration.
Module 14: Managing Transactions and Locks. Overview Introducing Transactions and Locks Managing Transactions Understanding SQL Server Locking Architecture.
1 Chapter Overview Monitoring Access to Shared Folders Creating and Sharing Local and Remote Folders Monitoring Network Users Using Offline Folders and.
Page 1 Monitoring, Optimization, and Troubleshooting Lecture 10 Hassan Shuja 11/30/2004.
Copyright Sammamish Software Services All rights reserved. 1 Prog 140  SQL Server Performance Monitoring and Tuning.
SQL SERVER MAINTENANCE PLANS Kat
SQL Advanced Monitoring Using DMV, Extended Events and Service Broker Javier Villegas – DBA | MCP | MCTS.
SQL Database Management
Monitoring Windows Server 2012
Curacao SQL Saturday June 11, 2016
Query Performance Tuning: Start to Finish
SQL Server Monitoring Overview
Designing Database Solutions for SQL Server
MONITORING MICROSOFT WINDOWS SERVER 2003
Introduction of Week 3 Assignment Discussion
Dynamics AX Performance
Chapter 11 Managing Databases with SQL Server 2000
Presentation transcript:

Agenda for Today Do Chapter 14 Final Project Review for Final

Monitoring and optimization Monitoring is important for peak performance and activity Optimize database performance. Choices are Use Windows monitoring tools like System Monitor, Task Manager etc. Use SQL Server monitoring tools like SQL Profilers, Enterprise Manager etc.

Optimization Goals –Optimizing response time –Optimizing throughput –Maximizing availability What to watch –Database, log, and file sizes –Data consistency issues –User activity –Server performance

Performance bottlenecks Hardware bottlenecks –Disk throughput –Memory usage –Processor usage SQL Server bottlenecks –Locking conflicts –Resource contention –tempdb activity

Key factors SQL Server configuration and activity Database design and implementation End-user applications Network throughput Server hardware Server operating system

Monitoring Tools System Monitor Task Manager SQL Profiler Query Analyzer Enterprise Manager DBCC commands

Using System Monitor Gathering baseline values Monitoring Windows NT/Windows 2000 counters Isolating bottlenecks Comparing server performance Monitoring critical resources

System Monitor - continued System Monitor includes Performance Objects which correspond to hardware resources - Table 14-1 has more info Counters that are data items with specific information on a component Instances are objects of the same type like databases, hard disks etc

System Monitor

Performance counters

Memory Object Counters Memory:Available Bytes Memory:Pages/sec Process:Page Faults/sec Process:Working Set SQLServer:Buffer Manager:Buffer Cache Hit Ratio SQLServer:Buffer Manager:Total Pages More info in Table 14-7

I/O Object Counters PhysicalDisk:% Disk Time PhysicalDisk:Avg. Disk Queue Length PhysicalDisk:Current Disk Queue Length Memory:Page Faults/sec SQLServer:Buffer Manager:Page Reads/sec SQLServer:Buffer Manager:Page Writes/sec Table 14-8

Processor Object Counter Processor:% Processor Time Processor:% Privileged Time Processor:% User Time System:% Total Processor Time System:Context Switches/sec System:Processor Queue Length More in Table 14-9

Event Viewer Event Viewer logs –Security log –System log –Application log

SQL Profiler Very Important Monitoring Tool Primarily used to monitor stored procedures, connections,SQL batches Uses a number of filters to isolated the problem Profiler uses what called a trace to capture SQL Server events The trace can be paused and replayed Events that can be monitored are listed in Table 14-2

Trace General properties

Trace Events properties

Trace Data Columns properties

Trace Filters properties

Standard templates (Profiler) SQLProfilerSP_Counts SQLProfilerStandard SQLProfilerTSQL SQLProfilerTSQL_Duration SQLProfilerTSQL_Grouped SQLProfilerTSQL_Replay SQLProfilerTSQL_SPs SQLProfilerTuning

Class Assignments Page 532 Page 537 Take a break

Other SQL Server tools System stored procedures Table 14-4 has more info. Sp_who and sp_lock are important ones DBCC commands These act as the “database consistency checker” for SQL Server Table 14-5 has more info on these commands

DBCC commands DBCC HELP Help on syntax for DBCC commands syntax: DBCC HELP ('dbcc_statement') DBCC CHECKALLOC Checks the allocation and use of all pages in the specified database syntax: DCC CHECKALLOC ('database'[, NOINDEX | REPAIR_ALLOW_DATA_LOSS | REPAIR_FAST | REPAIR_REBUILD]

DBCC commands DBCC CHECKDB syntax: DBCC CHECKDB ('database'[, NOINDEX | REPAIR_ALLOW_DATA_LOSS | REPAIR_FAST | REPAIR_REBUILD] ) [WITH [ALL_ERRORMSGS | NO_INFOMSGS] [, TABLOCK][, ESTIMATEONLY][, PHYSICAL_ONLY] DBCC CHECKFILEGROUP syntax: DBCC CHECKFILEGROUP ('filegroup'|filegroup_id [, NOINDEX] ) [WITH [ALLERRORMSGS | NO_INFOMSGS] [, TABLOCK][,ESTIMATEONLY]]

Current activity and Locking

Process ID - all current conn

Locks / Process ID - SPID’s

Locks / Object - info on Locks

Issuing locks Locking ensures correct updates SQL Server can issue locks for: –A row identifier (RID), locking a single row in a table –A table, which locks all data rows and indexes –A database, which is used when restoring a database –A page, locking an 8-KB data or index page –An extent, locking a contiguous group of pages during space allocation

Lock types Basic locks –Shared –Exclusive Special locks –Intent –Intent exclusive –Shared with intent exclusive –Update –Schema –Bulk update

Lock information – T-SQL Use sp_who to retrieve information about users and processes. sp_who ['login_name'] Use sp_lock to view lock information. sp_lock [spid]

Clearing deadlocks 1.The deadlocked transaction is rolled back. 2.The application initiating the transaction is notified of the rollback with a message number The transaction’s current request is cancelled.

Joining tables Joins are created through instructions in the SELECT clause. Joins connect two or more tables by using a join operator. Joins exist only for the duration of that query. Joins do not make changes to any database tables.

Join columns The order of columns displayed is the order of columns chosen in the SELECT clause, with * choosing all columns in the order of the base table. All tables being joined must be named in the FROM clause. Create aliases for table names to reduce typing and make queries easier to read. If NULLs are allowed in either connecting column, matches are not made with other NULLs.

Types of Joins INNER JOIN OUTER JOIN –LEFT OUTER JOIN –RIGHT OUTER JOIN

Inner joins Only those rows that satisfy the join condition are displayed in the result. Inner join syntax: SELECT select_list FROM table_or_view [INNER] JOIN table_or_view ON (join_condition)

Outer joins LEFT OUTER JOIN (LEFT JOIN) –All rows from the left table named in the LEFT OUTER JOIN clause are returned in the result set. LEFT JOIN syntax: SELECT select_list FROM table_or_view LEFT [OUTER] JOIN table_or_view ON (join_condition)

Outer joins RIGHT OUTER JOIN (RIGHT JOIN) –All rows from the right table named in the RIGHT OUTER JOIN clause are returned in the result set. RIGHT JOIN syntax: SELECT select_list FROM table_or_view RIGHT [OUTER] JOIN table_or_view ON (join_condition)

Outer joins FULL OUTER JOIN (FULL JOIN) –All rows from both tables are returned by a FULL OUTER JOIN clause. FULL JOIN syntax: SELECT select_list FROM table_or_view FULL [OUTER] JOIN table_or_view ON (join_condition)

Class Assignments Page 543 Try the Join examples included in the word document Use Query Analyzer for this Take a break

Final Test Next week (5:30 - 7:30) Chapter 8-14 Open Book Open Notes Straight Scale >90 = A, >80 = B and so on In class material (slides and handout) 100 Questions (multiple choice) 200 points Any questions?