Automatic Performance Diagnosis and Tuning in Oracle 10g Graham Wood Oracle Corporation.

Slides:



Advertisements
Similar presentations
Performance Tuning Methods Author: Vladimir Andreev Semantec GmbH Lector: Stoyan Ivanov Semantec Bulgaria OOD Semantec GmbH Benzstr. 32 D Herrenberg,
Advertisements

DB-Time-based Oracle Performance Tuning: Theory and Practice
Be an Effective DBA using Oracle 10g Automatic Database Diagnostic Monitor Edward Hayrabedian Semantec Bulgaria OOD.
Database Tuning Principles, Experiments and Troubleshooting Techniques Baseado nos slides do tutorial com o mesmo nome da autoria de: Dennis Shasha
Advanced Oracle DB tuning Performance can be defined in very different ways (OLTP versus DSS) Specific goals and targets must be set => clear recognition.
Database Tuning. Objectives Describe the roles associated with database tuning. Describe the dependency between tuning in different development phases.
Copyright © SoftTree Technologies, Inc. DB Tuning Expert.
9 Copyright © 2006, Oracle. All rights reserved. Automatic Performance Management.
Chapter 9. Performance Management Enterprise wide endeavor Research and ascertain all performance problems – not just DBMS Five factors influence DB performance.
13 Copyright © 2005, Oracle. All rights reserved. Monitoring and Improving Performance.
Module 13: Performance Tuning. Overview Performance tuning methodologies Instance level Database level Application level Overview of tools and techniques.
Introduction CSCI 444/544 Operating Systems Fall 2008.
IBM Software Group ® Recommending Materialized Views and Indexes with the IBM DB2 Design Advisor (Automating Physical Database Design) Jarek Gryz.
Oracle 10.2 for z/OS and z/Linux Performance Update.
12 Copyright © 2005, Oracle. All rights reserved. Proactive Maintenance.
The Self-managing Database: Automatic Performance Diagnosis Graham Wood Kyle Hailey Oracle Corporation Session id:
Chapter 6: Database Evolution Title: AutoAdmin “What-if” Index Analysis Utility Authors: Surajit Chaudhuri, Vivek Narasayya ACM SIGMOD 1998.
Oracle 10g Database Administrator: Implementation and Administration Chapter 14 Proactive Maintenance.
Anton Topurov IT Department – DB Group Database Performance Tuning with EM12c.
Oracle 10g Database Administrator: Implementation and Administration
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.
Oracle 11g Real Application Testing: Avoiding Performance Regressions with SQL Performance Analyzer Khaled Yagoub, Pete Belknap, Benoit Dageville, Karl.
Maintaining a Microsoft SQL Server 2008 Database SQLServer-Training.com.
Database Advisors Automatic Database Diagnostic Monitor ( ADDM )
Introduction and simple using of Oracle Logistics Information System Yaxian Yao
12 Copyright © 2007, Oracle. All rights reserved. Database Maintenance.
15 Copyright © 2004, Oracle. All rights reserved. Proactive Maintenance.
Introduction Optimizing Application Performance with Pinpoint Accuracy What every IT Executive, Administrator & Developer Needs to Know.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 10 Database Performance Tuning and Query Optimization.
2 Copyright © 2006, Oracle. All rights reserved. Performance Tuning: Overview.
Chapter Oracle Server An Oracle Server consists of an Oracle database (stored data, control and log files.) The Server will support SQL to define.
Michael Sit Solution Specialists Manager Oracle Corporation.
1 Robert Wijnbelt Health Check your Database A Performance Tuning Methodology.
Oracle Administration and Monitoring Tools for Windows Administering and Monitoring Oracle with Windows Tools.
Oracle9i Performance Tuning Chapter 1 Performance Tuning Overview.
The Self-Managing Database: Guided Application and SQL Tuning Mohamed Ziauddin Consulting Member of Technical Staff Oracle Corporation Session id:
1.
Oracle Tuning Considerations. Agenda Why Tune ? Why Tune ? Ways to Improve Performance Ways to Improve Performance Hardware Hardware Software Software.
Oracle Tuning Ashok Kapur Hawkeye Technology, Inc.
Oracle9i Performance Tuning Chapter 12 Tuning Tools.
SEMANTEC 1 Oracle Performance Tuning - Part I Krasen Paskalev Oracle 8i Certified DBA.
Achieving Scalability, Performance and Availability on Linux with Oracle 9iR2-RAC Grant McAlister Senior Database Engineer Amazon.com Paper
ESRI User Conference 2004 ArcSDE. Some Nuggets Setup Performance Distribution Geodatabase History.
Power at Your Fingertips –Overlooked Gems in Oracle EM John Sheaffer Principal Sales Consultant – Oracle Corporation.
Process Architecture Process Architecture - A portion of a program that can run independently of and concurrently with other portions of the program. Some.
Troubleshooting SQL Server Performance: Tips &Tools Amit Khandelwal.
Copyright 2007, Information Builders. Slide 1 Machine Sizing and Scalability Mark Nesson, Vashti Ragoonath June 2008.
1 Copyright © 2005, Oracle. All rights reserved. Following a Tuning Methodology.
#.1 Average Active Sessions (AAS) The Golden Metric ? Kyle Hailey
Oracle9i Performance Tuning Chapter 4 Tuning the Shared Pool Memory.
Em Spatiotemporal Database Laboratory Pusan National University File Processing : Database Management System Architecture 2004, Spring Pusan National University.
Copyright Sammamish Software Services All rights reserved. 1 Prog 140  SQL Server Performance Monitoring and Tuning.
8 Copyright © 2006, Oracle. All rights reserved. Tuning the Shared Pool.
Troubleshooting Dennis Shasha and Philippe Bonnet, 2013.
Spark on Entropy : A Reliable & Efficient Scheduler for Low-latency Parallel Jobs in Heterogeneous Cloud Huankai Chen PhD Student at University of Kent.
1 PVSS Oracle scalability Target = changes per second (tested with 160k) changes per client 5 nodes RAC NAS 3040, each with one.
Chapter 21 SGA Architecture and Wait Event Summarized & Presented by Yeon JongHeum IDS Lab., Seoul National University.
Introduction.
SQL Server Monitoring Overview
Database Performance Tuning and Query Optimization
Introduction of Week 10 Assignment Discussion
Get Verified Oracle 1z0-062 Study Material - Oracle 1z0-062 Exam Dumps PDF Realexamdumps.com
Predictive Performance
Admission Control and Request Scheduling in E-Commerce Web Sites
Oracle Memory Internals
Managing Performance by SQL Tuning
Recommending Materialized Views and Indexes with the IBM DB2 Design Advisor (Automating Physical Database Design) Jarek Gryz.
Chapter 11 Database Performance Tuning and Query Optimization
Performance And Scalability In Oracle9i And SQL Server 2000
Presentation transcript:

Automatic Performance Diagnosis and Tuning in Oracle 10g Graham Wood Oracle Corporation

Agenda  Problem Definition  Tuning Goal: Database Time  Workload Repository  ADDM: Performance Tuning  Conclusion

DBA May Ask:  How can I make the application go faster?  How can I make the database server do less work for the same application workload? (I.e., how can I increase capacity with/without adding hardware?)  How can I improve response time for a specific user?

Traditional Performance Tuning Methodology  Performance and Workload Data Capture – System Statistics, Wait Information, SQL Statistics, etc.  Analysis – What types of operations database is spending most time on? – Which resources is the database bottlenecked on? – What is causing these bottlenecks? – What can be done to resolve the problem?  Problem Resolution – If multiple problems identified, which is most critical? – How much performance gain I expect if I implement this solution?

Problem Definition Performance Diagnosis & Tuning is complex  Needs in-depth knowledge of database internals  Lack of good performance metric to compare database components  Data capture too expensive, too high level requiring workload reply  Misguided tuning efforts waste time & money

Agenda  Problem Definition  Tuning Goal – Database Time  Performance Tuning: ADDM  The Workload Repository  More Complex Models  Conclusion

Database Time (DB Time)  Time spent by user sessions in database calls  DB Time / Wallclock time similar to Load Average  Only a portion of the User Response Time  Other components: – Browser – Network latency (WAN and LAN) – Application server  Often > 100% of elapsed time – Multiple sessions – Parallel operations by a single session

Checkout using ‘ one-click ’ DB Time User Response Time Browser WAN APPS Server APPS Server WAN LAN DB time

DB Time Query for Melanie Craft Novels Browse and Read Reviews Add item to cart Checkout using ‘ one-click ’ DB Time: Example for One Session

The Simple Computation Model  One “Process” per user connection  Process state may be: – On CPU – Waiting for a resource  Hardware resource (like I/O, CPU)  Software resource (like LOCK) – Idle (not part of DB time)  Waiting for user command

The Simple Computation Model User 1 User 2 User 3 User n Wait CPU The Parts of DB Time

DB Time: Common Currency  Measurement of work done by the server while users are waiting for results  Each database component is analyzed using its contribution to database time.  Tuning goal – reduce DB time

Agenda  Problem Definition  Tuning Goal – Database Time  Workload Repository  ADDM: Performance Tuning  Conclusion

Automatic Workload Repository (AWR)  Data to quantify the impact (in database time) of various database components  Data to find root cause and suggest remedies.  Gather data all the time so we can give “first occurrence” analysis  Non-intrusive, lightweight

How AWR Works  System instrumented to provide all needed statistics  Data captured by hourly snapshots out-of-the-box.  Data is stored in tables called “the workload repository”  Most data is cumulative so can compare any pair of snapshots

Types of Data in AWR  Database-time spent in various events/resources  Usage statistics (counts of occurrences)  Operating system resource usage  System configuration  Simulation data (what-if scenarios)  Sampled data (Active Session History)

Simulation data  Some system components are best analyzed through online simulations. – E.g. Buffer Cache Size  Simulations for various settings are run as part of normal system work.  Estimate the effect of each setting on database time.  We recommend the best setting based on cost and benefit in database time.

Sampled Data: Active Session History (ASH) Samples active sessions every second into memory Direct access to kernel structures Selected samples flushed to AWR Data captured includes: – Session ID – SQL Identifier – Application Information – CPU / Wait event – Object, File, Block being used at that moment – (Many more Oracle specific items)  Fine Grained fact table allows detailed analysis

DB Time Query for Melanie Craft Novels Browse and Read Reviews Add item to cart Checkout using ‘ one-click ’ Active Session History (ASH)

DB Time Query for Melanie Craft Novels Browse and Read Reviews WAITING State db file sequential readqa324jffritcf2137:38:26 EventSQL IDModuleSIDTime CPUaferv5desfzs5Get review id2137:42:35 WAITINGlog file syncabngldf95f4deOne click2137:52:33 WAITINGbuffer busy waithk32pekfcbdfrAdd to cart2137:50:59 Add item to cart Checkout using ‘ one-click ’ Book by author Active Session History (ASH)

Agenda  Problem Definition  Tuning Goal – Database Time  Workload Repository  ADDM: Performance Tuning  Conclusion

ADDM Design Highlights  Database-wide performance diagnostics  Data from AWR  DB Time as a common currency and target  Throughput centric top-down approach  Root Cause analysis  Problems/Findings with impact  Recommendations with benefit  Identify “No-Problem” areas

ADDM Architecture Automatic Diagnostic Engine  Classification tree based on decades of Oracle performance tuning expertise  Each Node looks at DB Time spent on a specific issue – Node’s DB Time is fully contained in its parent  DB Time based drilldowns – Branch Nodes => Symptoms – Leaf Nodes => Problems (Root cause)

Two Views of DB Time Breakdown  Phases of Execution – Connection Management (logon, logoff) – Parse (hard, soft, failed,..) – SQL, PLSQL and Java execution times User I/O Application CPU Concurrency SQL Exec PLSQL Exec Conn Mgmt Parse Java Exec  CPU and Wait Model – CPU – 800+ different wait events – 12 wait classes Root Top level nodes

ADDM Methodology Problem classification system  Decision tree based on the database-time breakdowns …… CPU/Wait Model CPU User I/O Concurrency …… Buffer Busy Parse Latches Buf Cache latches …… Root CausesSymptoms

ADDM Methodology Problem classification system  Decision tree based on the database-time breakdowns …… CPU User I/O Concurrency …… Buffer Busy Parse Latches Buf Cache latches …… Non - Problems areas. CPU/Wait Model

What ADDM Diagnoses (1)  CPU issues – capacity, run-queue, top SQL  I/O issues – capacity and background, top SQL, top objects, memory components, log file performance  Insufficient size of memory components – buffer caches, other shared/private components  Network issues Physical Resources

What ADDM Diagnoses (2)  Application contention – Application induced contention e.g table/user/row locks  Concurrency issues – Internal contention (e.g. internal locks)  Configuration issues – log file size, recovery settings  Cluster issues Server (Software) Resources

What ADDM Diagnoses (3)  Connection management  Parsing – Compilation and shared-plans issues  Execution phase – PL/SQL execution, JAVA execution, SQL execution  Top SQL by DB-Time Phases of Execution

Types of Findings  PROBLEM Root cause for a performance issue  SYMPTOM Provides inference path to root causes  WARNING Incomplete snapshots, deprecated or unsupported configuration (e.g., rollback segments)  INFORMATION and NO-PROBLEM Areas the DBA should not try to tune. Other informational messages.

Types of Recommendations  Hardware issues – Add CPUs, stripe files  Application changes – Use connection-pool instead of connect-per-request  Schema changes – Hash partition an index  Server configuration changes – Increase buffer cache size  Use SQL Tuning Advisor – Missing index / stale statistics / other optimizer issues  Use Other Advisors

Agenda  Problem Definition  Tuning Goal – Database Time  Performance Tuning: ADDM  The Workload Repository  More Complex Models  Conclusion

Background Activity  Foreground Sessions – User Requests – User scheduled jobs, replication target  Background Sessions – Most write I/O (in Oracle) – Maintenance jobs Background is not part of database time

Parallel Computation  A parallel computation consists of a coordinator session and slave sessions (processes)  The user waits for the query coordinator session  All sessions accumulate database time, and the sum of database time is charged for the parallel query A parallel computation is a trade-of between total throughput and response time.

Distributed System  Database time of all nodes (machines) is added for a total cost on the system.  Some database components can only be tuned at the cluster level – I/O (because of shared disk) – Network (always shared) – Buffer caches (because of “cache-fusion”)  Single user request can span multiple nodes Oracle uses a “ shared disk ” architecture

Agenda  Problem Definition  Tuning Goal – Database Time  Performance Tuning: ADDM  The Workload Repository  More Complex Models  Conclusion

Simple Idea First: Find a tuning goal that unifies all database activity and components Second: Drill down from generic components to specific issues affecting the system Always: Experts that know system internals are rare and expensive. Automate their task as much as possible.

Problem Solution  Instrumentation in RDBMS provides usage statistics  AWR provides lightweight, always on, data collection  ADDM analyzes data in AWR holistic time based analysis compares impact across components (unifying performance metric) in-depth knowledge of database internals reports top problems and solutions reports non-problem areas to avoid wasted efforts  Positive feedback both internally and from customers

Problem Solution: ADDM  In-depth knowledge of database internals automated problem diagnosis  Database wide view of operations is lacking holistic time based analysis compares impact across components (unifying performance metric)  Data overload rather than information reports top problems and solutions  Misguided tuning efforts reports non-problem areas

A Q & Q U E S T I O N S A N S W E R S

Contact Information For hiring questions and sending resumes: For hiring to the manageability and diagnoseability groups:

With Oracle 10g and Diagnostics Pack…. System is maxed out on CPU with most waits in the concurrency wait class.

ADDM Findings ADDM has automatically identified that high CPU utilization was caused by repeated hard parses ……

ADDM Findings …and recommends solution as well explain how it diagnosed the problem

Good Performance Page Once the solution is applied, CPU utilization falls dramatically..and waits disappeared

Life Before and After ADDM Before  Examine system utilization  Look at wait events  Observe latch contention  See waits on shared pool and library cache latch  Review v$sysstat  See “parse time elapsed” > “parse time cpu” and #hard parses greater than normal  Identify SQL by..  Identifying sessions with many hard parses and trace them, or  Reviewing v$sql for many statements with same hash plan  Examine and review SQL  Identify “hard parse” issue by observing the SQL contains literals  Enable cursor sharing Oracle10 G  Review ADDM recommendations  ADDM recommends use of cursor_sharing Scenario: Hard parse problems

ADDM Analysis AWR 9 am11 am10 am12 pm1 pm Advisor Framework ADDM Can do manual ADDM analysis MMON Slave (m00*) EM or addmrpt.sql using DBMS_ADVISOR