#.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.

Slides:



Advertisements
Similar presentations
Focusing Your Oracle Database Tuning Efforts For PeopleSoft Applications Bobby Durrett U. S. Foodservice, Inc.
Advertisements

9 Copyright © 2006, Oracle. All rights reserved. Automatic Performance Management.
Module 13: Performance Tuning. Overview Performance tuning methodologies Instance level Database level Application level Overview of tools and techniques.
Overview of performance tuning strategies Oracle Performance Tuning Allan Young June 2008.
1 Wait Event Enhancements in Oracle 10g Terry Sutton and Roger Schrag Database Specialists, Inc.
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.
4 Copyright © 2005, Oracle. All rights reserved. Managing the Oracle Instance.
Royal London Group A group of specialist businesses where the bottom line is always financial sense Oracle Statistics – with a little bit extra on top.
Copyright © 2011 Accenture All Rights Reserved. Accenture, its logo, and High Performance Delivered are trademarks of Accenture. SQL Workshop Day 4.
The Self-managing Database: Automatic Performance Diagnosis Graham Wood Kyle Hailey Oracle Corporation Session id:
6 Copyright © 2006, Oracle. All rights reserved. Using Automatic Workload Repository.
ASH – Active Session History Feel the Power Kyle Hailey Embarcadero Technologies
9 Copyright © 2009, Oracle. All rights reserved. Managing Data Concurrency.
1 How to improve SQL Performance with new Health Check Tool? Carlos Sierra Consulting Technical Advisor © 2012 Oracle Corporation – Proprietary and Confidential.
1 Tuning PL/SQL procedures using DBMS_PROFILER 20-August 2009 Tim Gorman Evergreen Database Technologies, Inc. Northern California Oracle.
DB Audit Expert v1.1 for Oracle Copyright © SoftTree Technologies, Inc. This presentation is for DB Audit Expert for Oracle version 1.1 which.
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 – Active Session History Kyle Hailey Embarcadero Technologies
It’s time to do ASH! Tuesday, Februrary 8 th 2005 Gaja Krishna Vaidyanatha Principal, DBPerfMan LLC
This presentation will guide you though the initial stages of installation, through to producing your first report Click your mouse to advance the presentation.
12 Copyright © 2004, Oracle. All rights reserved. Automatic Management.
#.1 Oracle Wait Interface in Oracle 10g. #.2 Today’s Session  Twelve wait event interface enhancements in Oracle 10g that we really like.  Documentation.
12-Jun-2007 Sakai Metrics at Indiana University1 That Which is Monitored, Improves Dan McKee & Megan May.
1 Robert Wijnbelt Health Check your Database A Performance Tuning Methodology.
Part II : Waits Events Kyle Hailey
Physical Database Design & Performance. Optimizing for Query Performance For DBs with high retrieval traffic as compared to maintenance traffic, optimizing.
Performance Diagnostics using STATSPACK data 18-May 2006 Tim Gorman SageLogix, Inc. N. CA Oracle Users Group.
Oracle 10g Database Administrator: Implementation and Administration Chapter 2 Tools and Architecture.
Oracle9i Performance Tuning Chapter 12 Tuning Tools.
CERN - IT Department CH-1211 Genève 23 Switzerland t DB Development Tools Benthic SQL Developer Application Express WLCG Service Reliability.
Achieving Scalability, Performance and Availability on Linux with Oracle 9iR2-RAC Grant McAlister Senior Database Engineer Amazon.com Paper
1 06/05/08 Statspack Kyle Hailey
V.Sirotenko, July Status of Online Databases Currently there are 2 online Oracle Databases running on d0online cluster: 1.Production DB, d0onprd,
8 Copyright © 2005, Oracle. All rights reserved. Managing Data.
ASH – Active Session History Feel the Power Kyle Hailey
Oracle 10g Advanced Performance Tuning Kyle Hailey Delphix - wait events docs – tools S-ASH.
Average Active Sessions (AAS) The Golden Metric ? Kyle Hailey
3 Copyright © 2004, Oracle. All rights reserved. Working in the Forms Developer Environment.
#.6 Sampling Kyle Hailey
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 Advanced Performance Tuning Kyle Hailey - wait events docs – tools S-ASH and.
10G - New Manageability Features Presented by Lenka Vanek
#.1 ASH – Active Session History Feel the Power Kyle Hailey
CERN IT Department CH-1211 Genève 23 Switzerland t DBA Experience in a multiple RAC environment DM Technical Meeting, Feb 2008 Miguel Anjo.
Tracing Individual Users in Connection-pooled Environments with Oracle 10g Terry Sutton Database Specialists, Inc.
Transactions, Roles & Privileges Oracle and ANSI Standard SQL Lecture 11.
3 Copyright © 2006, Oracle. All rights reserved. Statistics and Wait Events.
#.1 Average Active Sessions (AAS) The Golden Metric ? Kyle Hailey
OEM 10g Performance and Tuning. #.2 Copyright 2006 Kyle Hailey Performance SQL Diagnostics SQLTuning Performance Session DB HOME.
1 3/21/2016 Average Active Sessions (AAS) The Golden Metric ? Kyle Hailey perfvision.com.
An overview of AWR, ASH and ADDM. Learning About AWR Real-World Performance Day with Tom Kyte The Independent Oracle Users Groups presents “A Day of Real-World.
SQL Advanced Monitoring Using DMV, Extended Events and Service Broker Javier Villegas – DBA | MCP | MCTS.
E Copyright © 2006, Oracle. All rights reserved. Using SQL Developer.
9 Copyright © 2004, Oracle. All rights reserved. Getting Started with Oracle Migration Workbench.
1 Copyright © 2005, Oracle. All rights reserved. Oracle Database Administration: Overview.
Performance Tuning Methodology Approach to Attacking Oracle Performance Problems.
C Copyright © 2009, Oracle. All rights reserved. Using SQL Developer.
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.
Understanding and Improving Server Performance
Developer 2000 CSE 4504/6504 Lab.
Introduction of Week 3 Assignment Discussion
Introduction of Week 10 Assignment Discussion
Wait Event Enhancements in Oracle 10g
Presentation transcript:

#.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 Copyright 2006 Kyle Hailey 10 Machines with 4 processors and 1 database each 1 DBA OEM $5,000 per pack unlimited users $2,500 per pack with minimum named users

#.3 Copyright 2006 Kyle Hailey Simulating ASH   ASH is new in 10g   ASH data exist since V7   Need Diagnostic Pack License    Collect it yourself   SASH – Simulated ASH   Graphical Monitor Consumes < 1% CPU for 10 active sessions (a lot)

#.4 4 Simulating ASH  Performance Package License?  $5000/pack/CPU ?  Not on 10g ?  Do it yourself  V$SESSION 10g most of ASH  Before 10g, join v$session and v$session_wait  Sample every second  Store in a table  Free PL/SQL package v$active_session_history v$session SESSION_ID SID SESSION_SERIAL# SERIAL# USER_ID USER# SQL_OPCODE COMMAND PROGRAM PROGRAM SESSION_TYPE TYPE SQL_ID SQL_ID SQL_CHILD_NUMBER SQL_CHILD_NUMBER MODULE MODULE ACTION ACTION CURRENT_OBJ# ROW_WAIT_OBJ# CURRENT_FILE# ROW_WAIT_FILE# CURRENT_BLOCK# ROW_WAIT_BLOCK# CLIENT_ID CLIENT_IDENTIFIER BLOCKING_SESSION BLOCKING_SESSION BLOCKING_SESSION_STATUS BLOCKING_SESSION_STATUS SEQ# SEQ# EVENT# EVENT# EVENT EVENT P1TEXT P1TEXT P1 P1 P2TEXT P2TEXT P2 P2 P3TEXT P3TEXT P3 P3 WAIT_CLASS_ID WAIT_CLASS_ID WAIT_CLASS WAIT_CLASS WAIT_TIME WAIT_TIME

#.5 5 ASH extra fields  v$session missing  V$session extras FORCE_MATCHING_SIGNATURE v$sql.sql_id = sql_id QC_SESSION_ID QCSID v$px_session.sid=sid, serial# QC_INSTANCE_ID QCINST_ID v$px_session.sid=sid, serial# SQL_PLAN_HASH_VALUE PLAN_HASH_VALUE v$sqlstats.sql_id v$sqlstats.sql_id = sql_id (PLAN_HASH_VALUE = x$ksuse.KSUSESPH) XID v$transaction.ADDR = taddr FIXED_TABLE_SEQUENCE - find sql executions ROW_WAIT_ROW# LAST_CALL_ET - how long in current state

#.6 Simulating – Key Ideas  session_state = decode(WAIT_TIME, 0,'WAITING', 'ON CPU')  v$session where status='ACTIVE' and ON CPU : wait_time != 0 or Waiting : wait_class != 'Idle‘ select sysdate sample_time, decode(s.WAIT_TIME, 0,'WAITING','ON CPU') "SESSION_STATE" decode(s.WAIT_TIME, 0,'WAITING','ON CPU') "SESSION_STATE" /* plus other fields */ /* plus other fields */ from v$session s from v$session s where sid != ( select sid from v$mystat where rownum < 2 ) where sid != ( select sid from v$mystat where rownum < 2 ) and ( ( s.status='ACTIVE' and wait_time != 0 ) and ( ( s.status='ACTIVE' and wait_time != 0 ) or s.wait_class!='Idle' ) ; or s.wait_class!='Idle' ) ; 9i – join v$session and v$session_wait

#.7 Copyright 2006 Kyle Hailey Sampling Method 7,8,9i, 10g select s.username, s.sid, s.serial#, s.sql_hash_value, decode(w.wait_time, 0, w.event, 'ON CPU'), w.p1 p1, w.p2 p2, w.p3 p3 select s.username, s.sid, s.serial#, s.sql_hash_value, decode(w.wait_time, 0, w.event, 'ON CPU'), w.p1, w.p2, w.p3 select s.username, s.sid, s.serial#, s.sql_hash_value, decode(w.wait_time, 0, w.event, 'ON CPU'), w.p1, w.p2, w.p3 from v$session s, v$session_wait w where w.sid=s.sid and s.status='ACTIVE' and s.type='USER' / from v$session s, v$session_wait w where w.sid=s.sid and s.status='ACTIVE' and s.type='USER' /

#.8 Copyright 2006 Kyle Hailey Sampling v$session10g select username, sid, serial#, sql_hash_value, decode(wait_time, 0, event, 'ON CPU'), p1,p2, p3 from v$session where status='ACTIVE' and name not in ( select event from v$event_name where wait_class='Idle' ) / select username, sid, serial#, sql_hash_value, decode(wait_time, 0, event, 'ON CPU'), p1,p2, p3 from v$session where status='ACTIVE' and name not in ( select event from v$event_name where wait_class='Idle' ) /

#.9 Copyright 2006 Kyle Hailey Example of Sampled Data From the above query we get output like USERNAME SID SERIAL HASH_VALUE EVENT P1 P2 P SYS PL/SQL lock timer SYS ON CPU STARGUS direct path write (CJQ0) rdbms ipc message Session SQL Wait USERNAME SID SERIAL HASH_VALUE EVENT P1 P2 P SYS PL/SQL lock timer SYS ON CPU STARGUS direct path write (CJQ0) rdbms ipc message USERNAME SID SERIAL HASH_VALUE EVENT P1 P2 P SYS PL/SQL lock timer SYS ON CPU STARGUS direct path write (CJQ0) rdbms ipc message

#.10 Copyright 2006 Kyle Hailey Example of Sampled Data From the above query we get output like USERNAME SID SERIAL HASH_VALUE EVENT P1 P2 P SYS buffer busy wait Wait file block Type USERNAME SID SERIAL HASH_VALUE EVENT P1 P2 P SYS buffer busy wait USERNAME SID SERIAL HASH_VALUE EVENT P1 P2 P SYS buffer busy wait SQL Session

#.11 Copyright 2006 Kyle Hailey V1 - SASH - Simulating ASH   Install ashpack.sh (UNIX only)  Automatically collects  Every 3 secs  v$session_wait + v$session  10g just uses v$session – faster  Every Hour collects  Top 20 SQL text  Top 20 SQL explain plans  Top 20 SQL stats  Top 20 Object names (not enabled)  Keeps 7 days, purges rest Needs Partitioning Option

#.12 Copyright 2006 Kyle Hailey SASH - Architecture # REPOSITORY REPO_SCHEMA=sash REPO_PW=sash REPO_SID=cdb REPO_HOST=cont01.perfvision.com REPO_PORT=1521 #TARGET TARG_SCHEMA=sys TARG_PW="sys as sysdba" TARG_HOST=`hostname` TARG_SID=$ORACLE_SID TARG_HOME=$ORACLE_HOME Define once And leave in script ashpack.sh

#.13 Copyright 2006 Kyle Hailey SASH - Architecturerepository target target target target Targets run jobs to insert data over db link ashpack.sh oracle ashpack.sh

#.14 Copyright 2006 Kyle Hailey SASH - Architecturerepository ASH data partitioned by DBID of Target Day of Week Makes purge fast Make queries fast

#.15 V2 SASH   Installs on any platform (no longer UNIX only)  Installs on Standard Edition  Uses “poor mans partitioning”  “v$active_session_history” is a union on SASH1-SASH7  Purging done by truncating the oldest SASH1-7 table Copyright 2006 Kyle Hailey

#.16 V2 SASH Repository  repo_0_user.sql  optional example of create the “sash” user on repository (as SYS or SYSTEM)  repo_1_tables.sql  install schema on repository database (run as SASH user) Monitored Database  targ_1_pkg.sql  install package database to be monitored (run as or sys)  targ_2_jobs.sql  start up collection in a job Optionally  repo_2_pkg.sql  Install purge procedure (on repository)  repo_3_jobs.sql  Run purge in job (on repository) Copyright 2006 Kyle Hailey

#.17 Copyright 2006 Kyle Hailey SASH - Architecturerepository target target target target Targets run jobs to insert data over db link repo_0_user.sql repo_1_tables.sql repo_2_pkg.sql repo_3_jobs.sql targ_1_pkg.sql targ_2_jobs.sql targ_1_pkg.sql targ_2_jobs.sql targ_1_pkg.sql targ_2_jobs.sql targ_1_pkg.sql targ_2_jobs.sql Oracle as SASH user Everything else as SYS or SYSTEM

#.18 Notes on Data Mining Now data extraction: S-ASH creates a view v$active_session_history  scripts are thus compatible with 10g ASH scripts  repo_4_waitgroups.sql  To be fully compatible with 10g ASH scripts  set up a simulated wait groups (don’t exist before 10g)  repo_5_curdb.sql  change the DBID in v$active_session_history view  S-ASH can collect data from multiple databases  To keep scripts compatible with 10g ASH scripts I define a filter on DBID in the view v$active_session_history Copyright 2006 Kyle Hailey HOST SFLKHAI01TORKHAI01ROMKHAI01 Enter value for host: SFLKHAI01 1 row deleted. 1 row created.

#.19 Copyright 2006 Kyle Hailey S-ASH – All HOST ASL GRAPH # of cpus bsn control cont bsn tsukuba limerock.13 2 bsn devnode.02 HOST ASL GRAPH # of cpus bsn control cont bsn tsukuba limerock.13 2 bsn devnode.02 1

#.20 Copyright 2006 Kyle Hailey Simulating ASH – All DB HOST EVENT ASL CNT bsn02 local write wait.00 1 buffer busy waits.01 5 db file sequential read.01 6 log file sync write complete waits free buffer waits CPU Sum.44 bsn08 buffer busy waits log buffer space log file sync enqueue db file scattered read rdbms ipc reply local write wait db file sequential read direct path write direct path read CPU Sum HOST EVENT ASL CNT bsn02 local write wait.00 1 buffer busy waits.01 5 db file sequential read.01 6 log file sync write complete waits free buffer waits CPU Sum.44 bsn08 buffer busy waits log buffer space log file sync enqueue db file scattered read rdbms ipc reply local write wait db file sequential read direct path write direct path read CPU Sum 1.38

#.21 Copyright 2006 Kyle Hailey SASH – DB Detailed Analysis Begin Time : :04:48 Analysis End Time : :19:45 Start time, mins ago: 15 Request Duration : 15 Collections : 528 Data Values : 3327 Elapsed Time: 15 mins WAIT_EVENT CNT % Active Ave_Act_Sess latch free log buffer space buffer busy waits db file scattered read library cache pin log file sync ON CPU enqueue db file sequential read sum Analysis Begin Time : :04:48 Analysis End Time : :19:45 Start time, mins ago: 15 Request Duration : 15 Collections : 528 Data Values : 3327 Elapsed Time: 15 mins WAIT_EVENT CNT % Active Ave_Act_Sess latch free log buffer space buffer busy waits db file scattered read library cache pin log file sync ON CPU enqueue db file sequential read sum 6.3

#.22 Copyright 2006 Kyle Hailey SASH – AAS over TM NPTS AVEACT GRAPH CPU WAITS AUG 13:00: AUG 14:00: AUG 15:00: AUG 16:00: AUG 17:00: AUG 18:00: AUG 19:00: AUG 20:00: AUG 21:00: AUG 22:00: AUG 23:00: AUG 00:00: AUG 01:00: AUG 02:00: AUG 03:00: AUG 04:00: AUG 05:00: AUG 06:00: AUG 07:00: AUG 08:00: AUG 09:00: TM NPTS AVEACT GRAPH CPU WAITS AUG 13:00: AUG 14:00: AUG 15:00: AUG 16:00: AUG 17:00: AUG 18:00: AUG 19:00: AUG 20:00: AUG 21:00: AUG 22:00: AUG 23:00: AUG 00:00: AUG 01:00: AUG 02:00: AUG 03:00: AUG 04:00: AUG 05:00: AUG 06:00: AUG 07:00: AUG 08:00: AUG 09:00:

#.23 Copyright 2006 Kyle Hailey SASH – AAS over time with TO_CHAR(STA AAS AAS1 FIRST AAS2 SECOND GRAPH :00: db file sequent.10 CPU :00: direct path wri.49 log file sync :00: direct path wri 1.93 log file sync :00: direct path wri.57 log file sync :00: log file sync.32 CPU :00: CPU.45 log file sync :00: log file sync.39 CPU :00: log file sync.27 CPU :00: log file sync.31 CPU :00: log file sync.41 CPU :00: log file sync.27 CPU :00: log file sync.27 CPU :00: log file sync.31 CPU :00: direct path wri.52 log file sync :00: direct path wri 1.58 log file sync :00: CPU.27 log file sync :00: CPU.83 enqueue TO_CHAR(STA AAS AAS1 FIRST AAS2 SECOND GRAPH :00: db file sequent.10 CPU :00: direct path wri.49 log file sync :00: direct path wri 1.93 log file sync :00: direct path wri.57 log file sync :00: log file sync.32 CPU :00: CPU.45 log file sync :00: log file sync.39 CPU :00: log file sync.27 CPU :00: log file sync.31 CPU :00: log file sync.41 CPU :00: log file sync.27 CPU :00: log file sync.27 CPU :00: log file sync.31 CPU :00: direct path wri.52 log file sync :00: direct path wri 1.58 log file sync :00: CPU.27 log file sync :00: CPU.83 enqueue

#.24 Copyright 2006 Kyle Hailey Aveact.sql

#.25 Copyright 2006 Kyle Hailey “-” = WAIT “+” = CPU which waits ? -> aveactn.sql

#.26 Aveactn.sql Copyright 2006 Kyle Hailey

#.27 Copyright 2006 Kyle Hailey SASH – SQL START_TIME COUNT(*) SQL_ID FIXED_TABLE_SEQUENCE TOPN JUN-01 02: JUN-01 02: JUN-01 02: JUN-01 02: JUN-01 02: JUN-01 02: JUN-01 02: START_TIME COUNT(*) SQL_ID FIXED_TABLE_SEQUENCE TOPN JUN-01 02: JUN-01 02: JUN-01 02: JUN-01 02: JUN-01 02: JUN-01 02: JUN-01 02: Using v$session fixed_table_sequence and sql_hash

#.28 Copyright 2006 Kyle Hailey ASHMON a free “OEM-lite”   Windows application  Monitors Oracle 10g or 11  Show “Top Activity” page from OEM Note: Can be used on any version of Oracle with performance repository available on

#.29 ASHMON 06/05/08

#.30 Swingbench  Simulated DB activity 

#.31 ASHMON  Aggregates  Drilldowns  Time Slicing  Guidance 31 1/15/2016

#.32 Copyright 2006 Kyle Hailey CPU > Max CPU

#.33 Copyright 2006 Kyle Hailey Radical Change in Profile

#.34 $5K/CPU Oracle Database = Copyright 2006 Kyle Hailey OEMASHMON DB Optimizer HSQL – local DB licensedsys/systemV$active_session_history FreesashV$active_session_history Free $1500 unlimited

#.35 Copyright 2006 Kyle Hailey Quest – Performance Analyzer  Good interface  SGA direct access only  Good – fast, low impact  Bad – difficult to install and administer

#.36 Copyright 2006 Kyle Hailey Quest

#.37 Copyright 2006 Kyle Hailey Quest

#.38 Copyright 2006 Kyle Hailey Symantec’s I3  End to End monitoring  Right Data  Complicated to Install and administer

#.39 Copyright 2006 Kyle Hailey Symantec

#.40 Copyright 2006 Kyle Hailey Symantec I3

#.41 Copyright 2006 Kyle Hailey Symantec I3

#.42 Copyright 2006 Kyle Hailey Lab 128  Easy  Fast  Cheap  Great data analysis  Collects right information  Complicated interface - “Geeks tool”  No Analysis

#.43 Copyright 2006 Kyle Hailey Confio’s Ignite

#.44 DB Optimizer Copyright 2006 Kyle Hailey

#.45 Copyright 2006 Kyle Hailey Lab128

#.46 Copyright 2006 Kyle Hailey Summary Tools Tools  Quest Performance Analyst  Confio’s Ignite  Symantec’s I3  Lab128  DB Optimizer Free but no graphics  SASH  Your custom queries  Simulated ASH

#.47 OEMDB Optimizer Lab 128SASH performance$100,000$1500$500free SQL Tuning$100,000includedN/A Both$200,000$1500N/A Copyright 2006 Kyle Hailey 10 Machines with 4 processors and 1 database each 1 DBA OEM $5,000 per pack unlimited users $2,500 per pack with minimum named users