#.6 Sampling Kyle Hailey

Slides:



Advertisements
Similar presentations
CHAPTER 4 Tablespaces and Datafiles. Introduction After installing the binaries, creating a database, and configuring your environment, the next logical.
Advertisements

Overview of performance tuning strategies Oracle Performance Tuning Allan Young June 2008.
IO Waits Kyle Hailey #.2 Copyright 2006 Kyle Hailey Waits Covered in this Section  db file sequential read  db file scattered.
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.
1/43 Tanel PoderEoug User2User day Freelists vs ASSM in Oracle9i Tanel Poder independent technology consultant 20-Oct-03 OracleWorld.
5 Copyright © 2005, Oracle. All rights reserved. Managing Database Storage Structures.
13 Copyright © 2004, Oracle. All rights reserved. Monitoring and Managing Storage.
Buffer Cache Waits. #.2 Copyright 2006 Kyle Hailey Buffer Cache Waits Waits Disk I/O Buffer Busy Library Cache Enqueue SQL*Net Free Buffer Hot Blocks.
INTRODUCTION TO ORACLE Lynnwood Brown System Managers LLC Performance And Tuning – Lecture 7 Copyright System Managers LLC 2007 all rights reserved.
Page Footer Keed Education Oracle Database Administration Basic Copyright 2009 Keed Education BV Version Concept.
Basic Storage Concepts and Settings
The Self-managing Database: Automatic Performance Diagnosis Graham Wood Kyle Hailey Oracle Corporation Session id:
Harvard University Oracle Database Administration Session 9 Managing the Environment.
Harvard University Oracle Database Administration Session 2 System Level.
Harvard University Oracle Database Administration Session 5 Data Storage.
Average Session Load (ASL) The Golden Metric ? Kyle Hailey
Waits Events and the Geeks who love them Kyle Hailey
Waits Defined Kyle Hailey #.2 Copyright 2006 Kyle Hailey Top 36 Foreground Waits write complete waits library cache.
ASH Masters Kyle Hailey kylehailey.com slideshare.net/khailey 1 8/28/2015 ASH SQL Query Repository.
12 Copyright © 2004, Oracle. All rights reserved. Automatic Management.
Chapter Oracle Server An Oracle Server consists of an Oracle database (stored data, control and log files.) The Server will support SQL to define.
DBMS Transactions and Rollback Recovery Helia / Martti Laiho.
Part II : Waits Events Kyle Hailey
Wait-Time Based Oracle Performance Management Prepared for Ohio Oracle User Group Presented by Dean Richards Senior Engineer, Confio Software.
7202ICT Database Administration Lecture 7 Managing Database Storage Part 2 Orale Concept Manuel Chapter 3 & 4.
Extents, segments and blocks in detail. Database structure Database Table spaces Segment Extent Oracle block O/S block Data file logical physical.
Copyright © 2011 Accenture All Rights Reserved. Accenture, its logo, and High Performance Delivered are trademarks of Accenture. SQL Workshop Day 3.
Buffer Cache Waits. In This Section 1.latch: cache buffers chains 2.latch: cache buffers lru chain 3.Free Buffer Wait 4.Buffer Busy Wait 5.Write Complete.
Oracle Tuning Considerations. Agenda Why Tune ? Why Tune ? Ways to Improve Performance Ways to Improve Performance Hardware Hardware Software Software.
Buffer Cache Waits. #.2 In This Section 1.latch: cache buffers chains 2.latch: cache buffers lru chain 3.latch: cache buffer handles 4.Free Buffer Wait.
Oracle Tuning Ashok Kapur Hawkeye Technology, Inc.
An Oracle server:  Is a database management system that provides an open, comprehensive, integrated approach to information management.  Consists.
9 Storage Structure and Relationships. 9-2 Objectives Listing the different segment types and their uses Controlling the use of extents by segments Stating.
1 All Powder Board and Ski Oracle 9i Workbook Chapter 9: Database Administration Jerry Post Copyright © 2003.
Oracle9i Performance Tuning Chapter 12 Tuning Tools.
15 Copyright © 2006, Oracle. All rights reserved. Performance Tuning: Summary.
1 06/05/08 Statspack Kyle Hailey
Database structure and space Management. Database Structure An ORACLE database has both a physical and logical structure. By separating physical and logical.
Database structure and space Management. Segments The level of logical database storage above an extent is called a segment. A segment is a set of extents.
Oracle 10g Advanced Performance Tuning Kyle Hailey Delphix - wait events docs – tools S-ASH.
Week 3 Lecture 2 Basic Storage Concepts and Settings.
14 Copyright © 2006, Oracle. All rights reserved. Tuning Block Space Usage.
John Kanagaraj DB Soft Inc Session #206 BACK PORTING ADDM, AWR, ASH AND METRICS TO ORACLE 9I & 8I.
Troubleshooting 11i issues Adam Janbolat
Oracle 10g Database Administrator: Implementation and Administration Chapter 5 Basic Storage Concepts and Settings.
Managing Tablespaces and Data Files
10 Managing Rollback Segments Objectives Planning the number and size of rollback segments Creating rollback segments using appropriate storage.
G Copyright © 2006, Oracle. All rights reserved. Miscellaneous Topics.
#.1 SASH – Simulated ASH and other tools. #.2 OEMDB Optimizer Lab 128SASH performance$100,000$1500$500free SQL Tuning$100,000includedN/A Both$200,000$1500N/A.
3 Copyright © 2006, Oracle. All rights reserved. Statistics and Wait Events.
SQL*Net & Other Waits. #.2 Copyright 2006 Kyle Hailey SQL*Net Waits Session Shadow Log Buffer Buffer Cache Log Buffer Buffer Cache SGA Library Cache Host.
Physical Database Structure .
Same Plan Different Performance Mauro Pagano. Consultant/Developer/Analyst Oracle  Enkitec  Accenture DBPerf and SQL Tuning Training Tools (SQLT, SQLd360,
Oracle Database Architectural Components
1 PVSS Oracle scalability Target = changes per second (tested with 160k) changes per client 5 nodes RAC NAS 3040, each with one.
1 Chapters 19 and 20  Ch. 19: By What Authority? Users Roles Grant and revoke Synonyms  Ch. 20: Changing the Oracle Surroundings Indexes Clusters Sequences.
Chapter 21 SGA Architecture and Wait Event Summarized & Presented by Yeon JongHeum IDS Lab., Seoul National University.
SQL Trace and TKPROF.
Database structure and space Management
What Is a Latch? …and Why Do I Care? Eddie Wuerch, mcm
DB Issue Trouble Shooting Guideline
Using SQL Server through Command Prompt
Storage Structure and Relationships
Oracle 10g Database Administrator: Implementation and Administration
Kyle Hailey Enqueue Waits : Locks Kyle Hailey
What Is a Latch? …and Why Do I Care? Eddie Wuerch, mcm
Physical Database Structure .
Index Index.
ISYS366, Oracle Disk Internals
Presentation transcript:

#.6 Sampling Kyle Hailey

#.7 Example  Slowdown on Database  Look at Statspack: Copyright 2006 Kyle Hailey Top 5 Timed Events ~~~~~~~~~~~~~~~~~~ % Total Event Waits Time (s) Call Time buffer busy waits 2, CPU time free buffer waits 1, write complete waits log buffer space

#.8 What do we do?  How do we solve “buffer busy wait”  Need:  SQL  Sessions  Objects  Wait details  Type of buffer busy wait  File and block numbers  How do we get that information?  Not from Statspack  But from v$session_wait  And v$session starting in 10g Copyright 2006 Kyle Hailey

#.9 V$session_wait  Shows who is waiting  For example lists who is waiting on “buffer busy waits”  Data only exists while waits are happening  Data includes  Type of buffer busy wait  File and block involved in buffer busy wait  Problem: Once waits are over, data is gone  Solution: Sample data all the time Copyright 2006 Kyle Hailey

#.10 Sample Query Copyright 2006 Kyle Hailey select nvl(s.username,s.program) username, s.sid sid, s.serial# serial, s.sql_hash_value sql_hash_value, substr(decode(w.wait_time, 0, w.event, 'ON CPU'),1,15) event, w.p1 p1, w.p2 p2, w.p3 p3 from v$session s, v$session_wait w where w.sid=s.sid and s.status='ACTIVE' and s.type='USER'; This query works since v7 SQL identifier Waiting or on CPU?

#.11 Sampling Output Copyright 2006 Kyle Hailey USERNAME SID SERIAL SQL_HASH_V EVENT P1 P2 P SYS PL/SQL lock timer SYS ON CPU STARGUS direct path write (CJQ0) rdbms ipc message Run sample query every second and save into a table “v$ash”

#.12 Buffer busy block type Copyright 2006 Kyle Hailey SQL> Select count(*), p3 from v$ash where event = 'buffer busy waits' group by p3; COUNT(*) P On 9i P3 < 200 read problem P3 >= 200 write problem On 10g P3 is the block class which is better for diagnostics

#.13 Block Class SQL> select rownum, class from v$waitstat; ROWNUM CLASS data block 2 sort block 3 save undo block 4 segment header 5 save undo header 6 free list 7 extent map 8 1st level bmb 9 2nd level bmb 10 3rd level bmb 11 bitmap block 12 bitmap index block 13 file header block 14 unused 15 system undo header 16 system undo block 17 undo header 18 undo block Copyright 2006 Kyle Hailey

#.14 File and Block #s Copyright 2006 Kyle Hailey select count(*), p1 filen, p2 blockn from v$ash where event='buffer busy waits' group by p1, p2, hash_value; COUNT(*) FILEN BLOCKN Pick a File and Block to find object

#.15 Sampling Output Copyright 2006 Kyle Hailey column segment_name format a30 select owner, segment_name, segment_type, block_id, blocks+block_id from dba_extents where file_id = 11 and between block_id AND block_id + blocks-1; OWNER SEGMENT_NAME SEGMENT_TY BLOCK_ID BLOCKS+BLOCK_ID SYSTEM TOTO1 TABLE owner, segment_name, segment_type, block_id, blocks+block_id from dba_extents where file_id = 11 and between block_id AND block_id + blocks-1; OWNER SEGMENT_NAME SEGMENT_TY BLOCK_ID BLOCKS+BLOCK_ID SYSTEM TOTO1 TABLE Data block ( not header block ) COUNT(*) FILEN BLOCKN

#.16 What SQL ? Copyright 2006 Kyle Hailey SQL> select count(*), p1 filen, p2 blockn, sql_hash_value 2 from v$ash 3 where event='buffer busy waits' 4 group by p1, p2, hash_value; COUNT(*) FILEN BLOCKN SQL_HASH_VALUE All the same SQL, SQL_HASH_VALUE=

#.17 SQL Statement ? Copyright 2006 Kyle Hailey select sql_text from v$sqltext where hash_value= ; SQL_TEXT INSERT into toto1 values (:b1,lpad('a',1000,'a')) Insert statement getting write type buffer busy waits: problem with users inserting data into same block. Solution : configure inserts to uses different blocks with Freelists or ASSM

#.18 ASSM ? Copyright 2006 Kyle Hailey select FREELISTS, TABLESPACE_NAME from dba_tables where table_name='TOTO1' and owner='SCOTT'; FREELISTS TABLESPACE_NAME USERS Table only has 1 freelist The table is in tablespace Users Is it an ASSM tablespace ?

#.19 Sampling Output Copyright 2006 Kyle Hailey select tablespace_name, SEGMENT_SPACE_MANAGEMENT from dba_tablespaces; TABLESPACE_NAME SEGMEN SYSTEM MANUAL UNDOTBS1 MANUAL TEMP MANUAL USERS MANUAL TOOLS AUTO USERS tablespace is not in ASSM mode

#.20 Let’s add Freelists Copyright 2006 Kyle Hailey select count(*), sid, serial from v$ash where event='buffer busy waits‘ group by sid, serial; COUNT(*) SID SERIAL Max Concurrency is 4 Freelists >= 4 How many freelists?

#.21 DB Optimizer shows it all Copyright 2006 Kyle Hailey