Overview of performance tuning strategies Oracle Performance Tuning Allan Young June 2008.

Slides:



Advertisements
Similar presentations
Using the SQL Access Advisor
Advertisements

Focusing Your Oracle Database Tuning Efforts For PeopleSoft Applications Bobby Durrett U. S. Foodservice, Inc.
Refreshing Materialized Views
12 Copyright © 2005, Oracle. All rights reserved. Query Rewrite.
Performance Tuning Methods Author: Vladimir Andreev Semantec GmbH Lector: Stoyan Ivanov Semantec Bulgaria OOD Semantec GmbH Benzstr. 32 D Herrenberg,
Tuning Oracle SQL The Basics of Efficient SQLThe Basics of Efficient SQL Common Sense Indexing The Optimizer –Making SQL Efficient Finding Problem Queries.
1 Chapter 16 Tuning RMAN. 2 Background One of the hardest chapters to develop material for Tuning RMAN can sometimes be difficult Authors tried to capture.
1 Proven Process for SQL Tuning Dean Richards Senior DBA, Confio Software.
Introduction to SQL Tuning Brown Bag Three essential concepts.
Office of the Accountant General (A&E) Andhra Pradesh Hyderabad
Copyright 2007, Information Builders. Slide 1 Performance and Tuning Mark Nesson, Vashti Ragoonath June 2008.
9 Copyright © 2006, Oracle. All rights reserved. Automatic Performance Management.
13 Copyright © 2005, Oracle. All rights reserved. Monitoring and Improving Performance.
Oracle Wait Events That Everyone Should Know Kerry Osborne Senior Oracle Guy.
Module 13: Performance Tuning. Overview Performance tuning methodologies Instance level Database level Application level Overview of tools and techniques.
M ODULE 4 D ATABASE T UNING Section 3 Application Performance 1 ITEC 450 Fall 2012.
© Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi © Bharati Vidyapeeths Institute of Computer Applications and.
Database Performance Tuning and Query Optimization
©2010 PROS Holdings, Inc. All rights reserved. My JDBC Performance Sucks and What I Did About It!
1 Oracle 11g Results Cache Dean Richards Senior DBA, Confio Software.
Database System Concepts and Architecture
1 Wait Event Enhancements in Oracle 10g Terry Sutton and Roger Schrag Database Specialists, Inc.
An introduction to SQL*Trace, TKPROF and Execution Plans
Enqueue Waits : Locks. #.2 Copyright 2006 Kyle Hailey Wait Tree - Locks Waits Disk I/O Library Cache Enqueue Undo TX 6 Row Lock TX 4 ITL Lock HW Lock.
Enqueue Waits : Locks. #.2 Copyright 2006 Kyle Hailey Locks REDO Lib Cache Buffer Cache IO Locks Network.
Finding the Performance Bottlenecks in Your Application Ian Jones and Roger Schrag Database Specialists, Inc. IOUG-A Live! 1999 Paper.
1 Tuning with Oracle’s SQL Trace David Kurtz Go-Faster Consultancy Ltd.
1 Chapter 16 Latch and Mutex Contention. 2 Architecture Overview of Latches Protect Oracle’s SGA Prevent two processes from updating same area of SGA.
Copyright © 200\8 Quest Software High Performance PL/SQL Guy Harrison Chief Architect, Database Solutions.
Overview of Database Administrator (DBA) Tools
Oracle9i Database Administrator: Implementation and Administration 1 Chapter 2 Overview of Database Administrator (DBA) Tools.
INTRODUCTION TO ORACLE Lynnwood Brown System Managers LLC Performance And Tuning – Lecture 7 Copyright System Managers LLC 2007 all rights reserved.
Fundamentals, Design, and Implementation, 9/e Chapter 12 ODBC, OLE DB, ADO, and ASP.
1 - Oracle Server Architecture Overview
Fundamentals, Design, and Implementation, 9/e COS 346 DAY 22.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 11 Database Performance Tuning and Query Optimization.
DT228/3 Web Development Databases. Database Almost all web application on the net access a database e.g. shopping sites, message boards, search engines.
Oracle 10g Database Administrator: Implementation and Administration
Module 8: Monitoring SQL Server for Performance. Overview Why to Monitor SQL Server Performance Monitoring and Tuning Tools for Monitoring SQL Server.
1 Tuning PL/SQL procedures using DBMS_PROFILER 20-August 2009 Tim Gorman Evergreen Database Technologies, Inc. Northern California Oracle.
ORACLE ONLINE TRAINING Contact our Support Team : SOFTNSOL India: Skype id : softnsoltrainings id:
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.
By Lecturer / Aisha Dawood 1.  You can control the number of dispatcher processes in the instance. Unlike the number of shared servers, the number of.
1 Robert Wijnbelt Health Check your Database A Performance Tuning Methodology.
© Dennis Shasha, Philippe Bonnet – 2013 Communicating with the Outside.
Oracle9i Performance Tuning Chapter 1 Performance Tuning Overview.
Oracle Tuning Considerations. Agenda Why Tune ? Why Tune ? Ways to Improve Performance Ways to Improve Performance Hardware Hardware Software Software.
1 Oracle Architectural Components. 1-2 Objectives Listing the structures involved in connecting a user to an Oracle server Listing the stages in processing.
Oracle Tuning Ashok Kapur Hawkeye Technology, Inc.
Oracle9i Performance Tuning Chapter 12 Tuning Tools.
Achieving Scalability, Performance and Availability on Linux with Oracle 9iR2-RAC Grant McAlister Senior Database Engineer Amazon.com Paper
Communicating with the Outside. Hardware [Processor(s), Disk(s), Memory] Operating System Concurrency ControlRecovery Storage Subsystem Indexes Query.
Tracing Individual Users in Connection-pooled Environments with Oracle 10g Terry Sutton Database Specialists, Inc.
10g Tuning Highlights Presenter JEREMY SCHNEIDER Senior Consultant, ITC Technology Services.
Preface 1Performance Tuning Methodology: A Review Course Structure 1-2 Lesson Objective 1-3 Concepts 1-4 Determining the Worst Bottleneck 1-5 Understanding.
DB Tuning : Chapter 10. Optimizer Center for E-Business Technology Seoul National University Seoul, Korea 이상근 Intelligent Database Systems Lab School of.
Troubleshooting Dennis Shasha and Philippe Bonnet, 2013.
SQL Advanced Monitoring Using DMV, Extended Events and Service Broker Javier Villegas – DBA | MCP | MCTS.
3 Copyright © 2006, Oracle. All rights reserved. Designing and Developing for Performance.
4 Copyright © 2004, Oracle. All rights reserved. Managing the Oracle Instance.
Oracle Database Architectural Components
11 Copyright © 2009, Oracle. All rights reserved. Enhancing ETL Performance.
Chapter 21 SGA Architecture and Wait Event Summarized & Presented by Yeon JongHeum IDS Lab., Seoul National University.
SQL Trace and TKPROF.
RAC Performance Lab.
Oracle Architectural Components
Performance Tuning ETL Process
Presentation transcript:

Overview of performance tuning strategies Oracle Performance Tuning Allan Young June 2008

What is tuning? Group of activities used to optimize and homogenize the performance of a database Maximize use of system resources to perform work as efficiently and rapidly as possible Goals – Minimizing response time – Increasing throughput – Increasing load capabilities – Decreasing recovery time 2

Who tunes? Application Designers Application Developers Database Administrators System Administrators System Architects 3

Methodology Ratios – Buffer Cache in high 90s for OLTP – Dictionary Cache Wait Interface – db file sequential read – db file scattered read – buffer busy wait Good Book Oracle Wait Interface: A Practical Guide to Performance Diagnostics & Tuning – Oracle Press 4

What tools? Statspack / AWR / ASH Utlbstat/utlestat Alert log – (ora-600/ora-7445), archive log location full Trace files tkprof Views – dba_blockers/dba_waiters/V$Session/V$Session_Wait 5

Tuning Steps 6 Specify tuning scope Collect data View and edit data and rules Analyse data Review recommendations Implement recommendations

Quick Checks for Performance Alert log for errors Unix / Windows system logs for errors Vmstat perfmon 7

Session Tracing Event – Level 1Enable SQL Tracing – Level 4Level 1 + bind variable information – Level 8Level 1 + wait event statistics – Level 12Level 1 + bind variable information + wait event statistics Alter Session – Alter session set events trace name context forever, level 12; DBMS_System – exec dbms_system.set_ev(SID,SERIAL#,10046,12,); 8

tkprof Used to format trace files Can sort trace file by elapsed parsing/executing/fetching – Type tkprof to see full list Can show explain plan information Usage : – tkprof dbateam_ora_686.trc allan.txt sys=no 9

tkprof output Rows Row Source Operation SORT AGGREGATE (cr=7 pr=0 pw=0 time=222 us) 1 TABLE ACCESS FULL TEST (cr=7 pr=0 pw=0 time=192 us) ******************************************************************************** select * from test call count cpu elapsed disk query current rows Parse Execute Fetch total Misses in library cache during parse: 1 Optimizer mode: ALL_ROWS Parsing user id: 78 Rows Row Source Operation TABLE ACCESS FULL TEST (cr=7 pr=0 pw=0 time=50 us) Elapsed times include waiting on following events: Event waited on Times Max. Wait Total Waited Waited SQL*Net message to client SQL*Net message from client

Why didnt you may the index From the plan Rows Row Source Operation TABLE ACCESS FULL TEST (cr=7 pr=0 pw=0 time=50 us) It is not using an index But why? No where clause Stats not up to date Cheaper cost to get data back from full table scan then index lookups Function around indexed column – WHERE UPPER(COL1) = UPPERTEXT Is NULL Use of != or <> Did you create the index in the correct schema 11

Bind Variables Bind variables are substitution variables used are used in place of literals Prepare ONCE execute MANY CURSOR_SHARING=SIMILAR/FORCE/EXACT – SIMILAR Causes statements that may differ in some literals, but are otherwise identical, to share a cursor, unless the literals affect either the meaning of the statement or the degree to which the plan is optimized – FORCE Forces statements to share cursors (in the where clause) – EXACT Only statements that are identical can share the cursor You cant substitute object names only literals – e.g. you cant substitute a table name 12

Bind Variable Example No Bind Variables select Col1 from test where Col1='Test1'; COL Test1 With Bind Variables variable col1var varchar2(100) exec :col1var := 'Test1'; select * from test where Col1=:col1var COL Test1 13

Bind Variables Example Continued 1 PL/SQL by default allows the use of bind variables create procedure test1(pv_bind varchar2) AS begin update test set col1 = 1 where col1 = pv_bind; commit; end; / 14

Bind Variable Example Continued 2 How to bypass bind variables in PL/SQL PL/SQL :- execute immediate update test set col1 = 1 where col1 = ||pv_bind; To use bind variables execute immediate update test set col1 = 1 where col1 = :x1 using pv_bind; Almost all programming languages have the ability to use bind variables, as access to the database is provided through vendor specific APIs… the question is are the developers using them! Oracle provide JDBC/ODBC/.Net drivers which support bind variables JBDC has a preparedstatement which allows the use of bind variables 15

Top 10 Issues … Bad Connection Management 2.Bad use of Cursors and Shared pool 3.Bad SQL - Consuming more resources than required 4.Non standard initialisation parameters 5.Getting database I/O wrong 16

Top 10 Issues … Redo log problems 7.Serialization of data blocks in the buffer cache due to lock of free lists/free list groups/transaction slots 8.Long full table scans 9.High amounts of recursive SQL executed as SYS 10.Deployment / Migration errors 17

Questions Any Questions? 18