SlideShare a Scribd company logo
1 of 61
How a Developer Can Troubleshoot
a SQL Performing Poorly on a
Production DB
Carlos Sierra
• Oracle Performance and SQL Tuning
• Consultant/Developer/DBA
• eDB360 and eAdam
• SQLT and SQLHC
• Exadata
Carlos Sierra
Enkitec (c) 2014 2
Motivation
• Developers might need to do SQL Tuning
• Diagnostics Collection is key for SQL Tuning
• Developers have limited access to DB server
– OEM is usually off limits
• Developers need reliable SQL Tuning tools
• Developers need to learn about these tools
11/4/2014 Enkitec © 3
Common SQL Troubleshooting Steps
1. Implement proper code instrumentation
2. Find application SQL performing poorly
3. Gather diagnostics on SQL of concern
4. Determine root cause of poor performance
5. Fix root cause
11/4/2014 Enkitec © 4
Code Instrumentation
• Data elements available
– Service
– Client Identifier
– Client Info
– Module
– Action
• Data type and size: VARCHAR2(64)
11/4/2014 Enkitec © 5
Query Session Values
11/4/2014 Enkitec © 6
Service (1)
• Database logical name(s) set per instance
• GV$SYSTEM_PARAMETER2 “service_names”
11/4/2014 Enkitec © 7
Service (2)
• Service SYS$BACKGROUND
– Background Processes
• Service SYS$USERS
– Default when session is not associated to Service
• Package DBMS_SERVICE
– Start, stop, create, delete, modify, disconnect
11/4/2014 Enkitec © 8
PL/SQL Instrumentation APIs
• DBMS_SESSION.SET_IDENTIFIER
– Sets CLIENT_IDENTIFIER
• DBMS_APPLICATION_INFO.SET_CLIENT_INFO
– Sets CLIENT_INFO
• DBMS_APPLICATION_INFO.SET_MODULE
– Sets MODULE and ACTION
11/4/2014 Enkitec © 9
API usage Example for PL/SQL
• Set before application code
• Reset after application code and error
handling
11/4/2014 Enkitec © 10
Query V$ to finding SQL
• GV$SESSION
– Session Status
– Service, Module, Action, Client, User
• GV$SQL
– SQL Text
– Elapsed Time
11/4/2014 Enkitec © 11
Active SQL Statements
11/4/2014 Enkitec © 12
Some “safe” Diagnostics Tools
• SQL Trace and TKPROF
• Execution Plan and DBMS_XPLAN
• planx.sql, sqlmon.sql and sqlash.sql
• snapper.sql
• SQLHC and SQLTXPLAIN
11/4/2014 Enkitec © 13
Tracing Methods
• ALTER SESSION
– SQL_TRACE parameter
– Event 10046
• DBMS_SESSION
• DBMS_MONITOR (preferred)
• ORADEBUG
– Event 10046
11/4/2014 Enkitec © 14
SQL_TRACE Syntax
• ALTER SESSION SET SQL_TRACE = TRUE;
• ALTER SESSION SET SQL_TRACE = FALSE;
• Own Session
11/4/2014 Enkitec © 15
Event 10046 Syntax
• ALTER SESSION SET EVENTS '10046 TRACE
NAME CONTEXT FOREVER, LEVEL N';
• ALTER SESSION SET EVENTS '10046 TRACE
NAME CONTEXT OFF';
• Own Session
11/4/2014 Enkitec © 16
Event 10046 Levels
• 1: Performance metrics and Execution Plan metrics
– 10g: Execution Plan metrics for all executions
– 11g: Execution Plan metrics for 1st execution
• 4: Binds
• 8: Waits
• 16: Execution Plan metrics for each execution (11.1+)
• 64: Execution Plan metrics for 1st then each with DB
Time > 1min (11.2.0.2+)
11/4/2014 Enkitec © 17
Event 10046 Level Examples
• Execution Plan metrics + Binds + Waits
– Level 4 + 8 = 12
• 11.1+: Execution Plan metrics for 1st execution
• 10g: Execution Plan metrics for all executions
• Binds + Waits + 1st Exec + >1m Execs
– Level 4 + 8 + 64 = 76
• 11.2.0.2+
11/4/2014 Enkitec © 18
DBMS_SESSION APIs
• SESSION_TRACE_ENABLE
– waits (TRUE|FALSE)
– binds (FALSE|TRUE)
– plan_stat (FIRST_EXECUTION|ALL_EXECUTIONS)
• SESSION_TRACE_DISABLE
• Own Session
11/4/2014 Enkitec © 19
DBMS_MONITOR APIs
• Enable SQL Trace
– SERV_MOD_ACT_TRACE_ENABLE
– CLIENT_ID_TRACE_ENABLE
– SESSION_TRACE_ENABLE
• ENABLE and DISABLE versions
• TRACE and STAT versions
11/4/2014 Enkitec © 20
SERV_MOD_ACT_TRACE_ENABLE
• service_name (required)
• module_name (optional)
• action_name (optional)
• waits (TRUE|FALSE)
• binds (FALSE|TRUE)
• plan_stat (FIRST_EXECUTION|ALL_EXECUTIONS)
11/4/2014 Enkitec © 21
CLIENT_ID_TRACE_ENABLE
• client_id (required)
• waits (TRUE|FALSE)
• binds (FALSE|TRUE)
• plan_stat
– FIRST_EXECUTION|ALL_EXECUTIONS
11/4/2014 Enkitec © 22
SESSION_TRACE_ENABLE
• session_id (if null then own else sid)
• serial_num (if null then use sid only)
• waits (TRUE|FALSE)
• binds (FALSE|TRUE)
• plan_stat
– FIRST_EXECUTION|ALL_EXECUTIONS
11/4/2014 Enkitec © 23
Some related Views
• Active Tracing
– DBA_ENABLED_TRACES
• Collected Statistics
– V$SERV_MOD_ACT_STATS
– V$CLIENT_STATS
– V$SESSTAT
11/4/2014 Enkitec © 24
Trace Location
• 11g
– V$DIAG_INFO
– Name = 'Diag Trace'
• 10g
– V$PARAMETER2
– Name = 'user_dump_dest'
11/4/2014 Enkitec © 25
TKPROF Syntax
• tkprof tracefile outputfile [sort=option]
• sort=prsela fchela exeela
11/4/2014 Enkitec © 26
TKPROF Sample
11/4/2014 Enkitec © 27
TKPROF Execution Plan Sample
11/4/2014 Enkitec © 28
DBMS_XPLAN Table Functions
• DISPLAY
• DISPLAY_AWR
• DISPLAY_CURSOR
• DISPLAY_PLAN
• DISPLAY_SQL_PLAN_BASELINE
• DISPLAY_SQLSET
11/4/2014 Enkitec © 29
DBMS_XPLAN.DISPLAY_CURSOR
• sql_id (default: last executed session cursor)
• cursor_child_no (default: 0)
• format (default: typical)
– allstats (io and mem stats for all executions)
– allstats last (ditto for last execution)
– advanced (includes outline) both undocumented
11/4/2014 Enkitec © 30
11/4/2014 Enkitec © 31
11/4/2014 Enkitec © 32
11/4/2014 Enkitec © 33
11/4/2014 Enkitec © 34
planx.sql
• Installs nothing
• 10g and 11g
• Parameters
– Oracle Diagnostics Pack License? Y | N
– SQL_ID
• Free
11/4/2014 Enkitec © 35
planx.sql Execution Plan
• DBMS_XPLAN.DISPLAY
– GV$SQL_PLAN_STATISTICS_ALL
– ADVANCED ALLSTATS LAST
• DBMS_XPLAN.DISPLAY_AWR
– ADVANCED
11/4/2014 Enkitec © 36
planx.sql Views (1)
• GV$SQLSTATS (extended retention)
• GV$SQLSTATS_PLAN_HASH
• GV$SQL
• GV$ACTIVE_SESSION_HISTORY
11/4/2014 Enkitec © 37
planx.sql Views (2)
• DBA_HIST_SQLSTAT
• DBA_HIST_SQL_PLAN
• DBA_HIST_ACTIVE_SESS_HISTORY
11/4/2014 Enkitec © 38
planx.sql Views (3)
• DBA_TABLES
• DBA_INDEXES
• DBA_TAB_COLS
• DBA_IND_COLS
11/4/2014 Enkitec © 39
11/4/2014 Enkitec © 40
11/4/2014 Enkitec © 41
11/4/2014 Enkitec © 42
11/4/2014 Enkitec © 43
sqlmon.sql
• Installs nothing
• 10g and 11g
• Parameters
– Oracle Tuning Pack (required) License? Y | N
– SQL_ID
• Free
11/4/2014 Enkitec © 44
sqlmon.sql Output
• SQL Monitor Reports
– HTML
– Text
– List
– Detail
11/4/2014 Enkitec © 45
11/4/2014 Enkitec © 46
11/4/2014 Enkitec © 47
SQL Monitor Execution Plan
11/4/2014 Enkitec © 48
sqlash.sql
• Installs nothing
• 10g and 11g
• Parameters
– Oracle Diagnostics Pack (required) License? Y | N
– SQL_ID
• Free
11/4/2014 Enkitec © 49
sqlash.sql Output
• ASH Reports for one SQL
– Format
• HTML
• Text
– Source
• Memory
• AWR
11/4/2014 Enkitec © 50
11/4/2014 Enkitec © 51
Snapper
• Session Centric
• Installs nothing
• 10g and 11g
• 4 Parameters
• Does not require Diagnostics or Tuning Pack
• Free
Enkitec © 2014 52
Snapper Syntax
• Scope (‘all’ includes ASH and Stats)
• seconds_in_snap (30 is common)
• snap_count (between 1 and 5 are common)
• sid (session id)
• Execution Sample
– @snapper.sql all 30 1 50
11/4/2014 Enkitec © 53
11/4/2014 Enkitec © 54
SQLHC 1366133.1
• Installs nothing
• 10g and 11g
• Parameters
– Oracle Pack License? T | D | N
– SQL_ID
• Free (requires MOS account)
11/4/2014 Enkitec © 55
11/4/2014 Enkitec © 56
SQLTXPLAIN (SQLT) 215187.1
• Installs two schemas and many objects
• 10g and 11g
• Methods
– SQLT XTRACT (inputs SQL_ID)
– SQLT XECUTE (inputs SQL Text)
• Free (requires MOS account)
11/4/2014 Enkitec © 57
11/4/2014 Enkitec © 58
Summary
1. Implement proper code instrumentation
2. Find application SQL performing poorly
3. Gather diagnostics on SQL of concern
4. Determine root cause of poor performance
5. Fix root cause
11/4/2014 Enkitec © 59
References
• Oracle Documentation
• http://blog.tanelpoder.com/files/scripts/snap
per.sql
• http://carlos-sierra.net/ (look for cscripts)
• SQL Health-Check (SQLHC): MOS 1366133.1
• SQLXPLAIN (SQLT): MOS 215187.1
11/4/2014 Enkitec © 60
Contact Information
• carlos.sierra@enkitec.com
• carlos-sierra.net
• @csierra_usa
Enkitec (c) 2014 61

More Related Content

What's hot

Understanding SQL Trace, TKPROF and Execution Plan for beginners
Understanding SQL Trace, TKPROF and Execution Plan for beginnersUnderstanding SQL Trace, TKPROF and Execution Plan for beginners
Understanding SQL Trace, TKPROF and Execution Plan for beginnersCarlos Sierra
 
Oracle Performance Tuning Fundamentals
Oracle Performance Tuning FundamentalsOracle Performance Tuning Fundamentals
Oracle Performance Tuning FundamentalsEnkitec
 
Online index rebuild automation
Online index rebuild automationOnline index rebuild automation
Online index rebuild automationCarlos Sierra
 
Tanel Poder Oracle Scripts and Tools (2010)
Tanel Poder Oracle Scripts and Tools (2010)Tanel Poder Oracle Scripts and Tools (2010)
Tanel Poder Oracle Scripts and Tools (2010)Tanel Poder
 
Oracle Database Performance Tuning Advanced Features and Best Practices for DBAs
Oracle Database Performance Tuning Advanced Features and Best Practices for DBAsOracle Database Performance Tuning Advanced Features and Best Practices for DBAs
Oracle Database Performance Tuning Advanced Features and Best Practices for DBAsZohar Elkayam
 
Oracle sql high performance tuning
Oracle sql high performance tuningOracle sql high performance tuning
Oracle sql high performance tuningGuy Harrison
 
Oracle db performance tuning
Oracle db performance tuningOracle db performance tuning
Oracle db performance tuningSimon Huang
 
Same plan different performance
Same plan different performanceSame plan different performance
Same plan different performanceMauro Pagano
 
Oracle statistics by example
Oracle statistics by exampleOracle statistics by example
Oracle statistics by exampleMauro Pagano
 
Hitchhiker's Guide to free Oracle tuning tools
Hitchhiker's Guide to free Oracle tuning toolsHitchhiker's Guide to free Oracle tuning tools
Hitchhiker's Guide to free Oracle tuning toolsBjoern Rost
 
Tanel Poder - Troubleshooting Complex Oracle Performance Issues - Part 2
Tanel Poder - Troubleshooting Complex Oracle Performance Issues - Part 2Tanel Poder - Troubleshooting Complex Oracle Performance Issues - Part 2
Tanel Poder - Troubleshooting Complex Oracle Performance Issues - Part 2Tanel Poder
 
Introducing the eDB360 Tool
Introducing the eDB360 ToolIntroducing the eDB360 Tool
Introducing the eDB360 ToolCarlos Sierra
 
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...Aaron Shilo
 
DB Time, Average Active Sessions, and ASH Math - Oracle performance fundamentals
DB Time, Average Active Sessions, and ASH Math - Oracle performance fundamentalsDB Time, Average Active Sessions, and ASH Math - Oracle performance fundamentals
DB Time, Average Active Sessions, and ASH Math - Oracle performance fundamentalsJohn Beresniewicz
 
Tanel Poder - Performance stories from Exadata Migrations
Tanel Poder - Performance stories from Exadata MigrationsTanel Poder - Performance stories from Exadata Migrations
Tanel Poder - Performance stories from Exadata MigrationsTanel Poder
 
Oracle Drivers configuration for High Availability, is it a developer's job?
Oracle Drivers configuration for High Availability, is it a developer's job?Oracle Drivers configuration for High Availability, is it a developer's job?
Oracle Drivers configuration for High Availability, is it a developer's job?Ludovico Caldara
 
Ash masters : advanced ash analytics on Oracle
Ash masters : advanced ash analytics on Oracle Ash masters : advanced ash analytics on Oracle
Ash masters : advanced ash analytics on Oracle Kyle Hailey
 
Understanding How is that Adaptive Cursor Sharing (ACS) produces multiple Opt...
Understanding How is that Adaptive Cursor Sharing (ACS) produces multiple Opt...Understanding How is that Adaptive Cursor Sharing (ACS) produces multiple Opt...
Understanding How is that Adaptive Cursor Sharing (ACS) produces multiple Opt...Carlos Sierra
 
Troubleshooting Complex Performance issues - Oracle SEG$ contention
Troubleshooting Complex Performance issues - Oracle SEG$ contentionTroubleshooting Complex Performance issues - Oracle SEG$ contention
Troubleshooting Complex Performance issues - Oracle SEG$ contentionTanel Poder
 

What's hot (20)

Understanding SQL Trace, TKPROF and Execution Plan for beginners
Understanding SQL Trace, TKPROF and Execution Plan for beginnersUnderstanding SQL Trace, TKPROF and Execution Plan for beginners
Understanding SQL Trace, TKPROF and Execution Plan for beginners
 
Oracle Performance Tuning Fundamentals
Oracle Performance Tuning FundamentalsOracle Performance Tuning Fundamentals
Oracle Performance Tuning Fundamentals
 
Online index rebuild automation
Online index rebuild automationOnline index rebuild automation
Online index rebuild automation
 
Tanel Poder Oracle Scripts and Tools (2010)
Tanel Poder Oracle Scripts and Tools (2010)Tanel Poder Oracle Scripts and Tools (2010)
Tanel Poder Oracle Scripts and Tools (2010)
 
Oracle Database Performance Tuning Advanced Features and Best Practices for DBAs
Oracle Database Performance Tuning Advanced Features and Best Practices for DBAsOracle Database Performance Tuning Advanced Features and Best Practices for DBAs
Oracle Database Performance Tuning Advanced Features and Best Practices for DBAs
 
AWR and ASH Deep Dive
AWR and ASH Deep DiveAWR and ASH Deep Dive
AWR and ASH Deep Dive
 
Oracle sql high performance tuning
Oracle sql high performance tuningOracle sql high performance tuning
Oracle sql high performance tuning
 
Oracle db performance tuning
Oracle db performance tuningOracle db performance tuning
Oracle db performance tuning
 
Same plan different performance
Same plan different performanceSame plan different performance
Same plan different performance
 
Oracle statistics by example
Oracle statistics by exampleOracle statistics by example
Oracle statistics by example
 
Hitchhiker's Guide to free Oracle tuning tools
Hitchhiker's Guide to free Oracle tuning toolsHitchhiker's Guide to free Oracle tuning tools
Hitchhiker's Guide to free Oracle tuning tools
 
Tanel Poder - Troubleshooting Complex Oracle Performance Issues - Part 2
Tanel Poder - Troubleshooting Complex Oracle Performance Issues - Part 2Tanel Poder - Troubleshooting Complex Oracle Performance Issues - Part 2
Tanel Poder - Troubleshooting Complex Oracle Performance Issues - Part 2
 
Introducing the eDB360 Tool
Introducing the eDB360 ToolIntroducing the eDB360 Tool
Introducing the eDB360 Tool
 
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
 
DB Time, Average Active Sessions, and ASH Math - Oracle performance fundamentals
DB Time, Average Active Sessions, and ASH Math - Oracle performance fundamentalsDB Time, Average Active Sessions, and ASH Math - Oracle performance fundamentals
DB Time, Average Active Sessions, and ASH Math - Oracle performance fundamentals
 
Tanel Poder - Performance stories from Exadata Migrations
Tanel Poder - Performance stories from Exadata MigrationsTanel Poder - Performance stories from Exadata Migrations
Tanel Poder - Performance stories from Exadata Migrations
 
Oracle Drivers configuration for High Availability, is it a developer's job?
Oracle Drivers configuration for High Availability, is it a developer's job?Oracle Drivers configuration for High Availability, is it a developer's job?
Oracle Drivers configuration for High Availability, is it a developer's job?
 
Ash masters : advanced ash analytics on Oracle
Ash masters : advanced ash analytics on Oracle Ash masters : advanced ash analytics on Oracle
Ash masters : advanced ash analytics on Oracle
 
Understanding How is that Adaptive Cursor Sharing (ACS) produces multiple Opt...
Understanding How is that Adaptive Cursor Sharing (ACS) produces multiple Opt...Understanding How is that Adaptive Cursor Sharing (ACS) produces multiple Opt...
Understanding How is that Adaptive Cursor Sharing (ACS) produces multiple Opt...
 
Troubleshooting Complex Performance issues - Oracle SEG$ contention
Troubleshooting Complex Performance issues - Oracle SEG$ contentionTroubleshooting Complex Performance issues - Oracle SEG$ contention
Troubleshooting Complex Performance issues - Oracle SEG$ contention
 

Similar to How a Developer can Troubleshoot a SQL performing poorly on a Production DB

Introducing the eDB360 Tool
Introducing the eDB360 ToolIntroducing the eDB360 Tool
Introducing the eDB360 ToolCarlos Sierra
 
Oracle Performance Tools of the Trade
Oracle Performance Tools of the TradeOracle Performance Tools of the Trade
Oracle Performance Tools of the TradeEnkitec
 
20150110 my sql-performanceschema
20150110 my sql-performanceschema20150110 my sql-performanceschema
20150110 my sql-performanceschemaIvan Ma
 
MySQL Enterprise Portfolio
MySQL Enterprise PortfolioMySQL Enterprise Portfolio
MySQL Enterprise PortfolioAbel Flórez
 
SQL Tuning Tools of the Trade
SQL Tuning Tools of the TradeSQL Tuning Tools of the Trade
SQL Tuning Tools of the TradeEnkitec
 
Application High Availability and Upgrades Using Oracle GoldenGate
Application High Availability and Upgrades Using Oracle GoldenGateApplication High Availability and Upgrades Using Oracle GoldenGate
Application High Availability and Upgrades Using Oracle GoldenGateShane Borden
 
Getting optimal performance from oracle e business suite
Getting optimal performance from oracle e business suiteGetting optimal performance from oracle e business suite
Getting optimal performance from oracle e business suiteaioughydchapter
 
Getting optimal performance from oracle e business suite(aioug aug2015)
Getting optimal performance from oracle e business suite(aioug aug2015)Getting optimal performance from oracle e business suite(aioug aug2015)
Getting optimal performance from oracle e business suite(aioug aug2015)pasalapudi123
 
Oracle SQL Developer for the DBA
Oracle SQL Developer for the DBAOracle SQL Developer for the DBA
Oracle SQL Developer for the DBAJeff Smith
 
IOUG at Coors Field ASH and AWR in EM12c!
IOUG at Coors Field ASH and AWR in EM12c!IOUG at Coors Field ASH and AWR in EM12c!
IOUG at Coors Field ASH and AWR in EM12c!Kellyn Pot'Vin-Gorman
 
SQL Tuning made easier with SQLTXPLAIN (SQLT)
SQL Tuning made easier with SQLTXPLAIN (SQLT)SQL Tuning made easier with SQLTXPLAIN (SQLT)
SQL Tuning made easier with SQLTXPLAIN (SQLT)Carlos Sierra
 
Using MySQL Enterprise Monitor for Continuous Performance Improvement
Using MySQL Enterprise Monitor for Continuous Performance ImprovementUsing MySQL Enterprise Monitor for Continuous Performance Improvement
Using MySQL Enterprise Monitor for Continuous Performance ImprovementMark Matthews
 
MySQL Performance Schema : fossasia
MySQL Performance Schema : fossasiaMySQL Performance Schema : fossasia
MySQL Performance Schema : fossasiaMayank Prasad
 
Sql tuning tools of the trade
Sql tuning tools of the tradeSql tuning tools of the trade
Sql tuning tools of the tradeEnkitec
 
MySQL-Performance Schema- What's new in MySQL-5.7 DMRs
MySQL-Performance Schema- What's new in MySQL-5.7 DMRsMySQL-Performance Schema- What's new in MySQL-5.7 DMRs
MySQL-Performance Schema- What's new in MySQL-5.7 DMRsMayank Prasad
 
Oracle Warehouse Builder to Oracle Data Integrator 12c Migration Utility
Oracle Warehouse Builder to Oracle Data Integrator 12c Migration UtilityOracle Warehouse Builder to Oracle Data Integrator 12c Migration Utility
Oracle Warehouse Builder to Oracle Data Integrator 12c Migration UtilityNoel Sidebotham
 
Primavera P6 Tips and Tricks
Primavera P6 Tips and TricksPrimavera P6 Tips and Tricks
Primavera P6 Tips and Tricksp6academy
 
Sql tuning made easier with sqltxplain (sqlt)
Sql tuning made easier with sqltxplain (sqlt)Sql tuning made easier with sqltxplain (sqlt)
Sql tuning made easier with sqltxplain (sqlt)Enkitec
 
All of the Performance Tuning Features in Oracle SQL Developer
All of the Performance Tuning Features in Oracle SQL DeveloperAll of the Performance Tuning Features in Oracle SQL Developer
All of the Performance Tuning Features in Oracle SQL DeveloperJeff Smith
 
KoprowskiT_SQLRelay2014#4_Caerdydd_MaintenancePlansForBeginners
KoprowskiT_SQLRelay2014#4_Caerdydd_MaintenancePlansForBeginnersKoprowskiT_SQLRelay2014#4_Caerdydd_MaintenancePlansForBeginners
KoprowskiT_SQLRelay2014#4_Caerdydd_MaintenancePlansForBeginnersTobias Koprowski
 

Similar to How a Developer can Troubleshoot a SQL performing poorly on a Production DB (20)

Introducing the eDB360 Tool
Introducing the eDB360 ToolIntroducing the eDB360 Tool
Introducing the eDB360 Tool
 
Oracle Performance Tools of the Trade
Oracle Performance Tools of the TradeOracle Performance Tools of the Trade
Oracle Performance Tools of the Trade
 
20150110 my sql-performanceschema
20150110 my sql-performanceschema20150110 my sql-performanceschema
20150110 my sql-performanceschema
 
MySQL Enterprise Portfolio
MySQL Enterprise PortfolioMySQL Enterprise Portfolio
MySQL Enterprise Portfolio
 
SQL Tuning Tools of the Trade
SQL Tuning Tools of the TradeSQL Tuning Tools of the Trade
SQL Tuning Tools of the Trade
 
Application High Availability and Upgrades Using Oracle GoldenGate
Application High Availability and Upgrades Using Oracle GoldenGateApplication High Availability and Upgrades Using Oracle GoldenGate
Application High Availability and Upgrades Using Oracle GoldenGate
 
Getting optimal performance from oracle e business suite
Getting optimal performance from oracle e business suiteGetting optimal performance from oracle e business suite
Getting optimal performance from oracle e business suite
 
Getting optimal performance from oracle e business suite(aioug aug2015)
Getting optimal performance from oracle e business suite(aioug aug2015)Getting optimal performance from oracle e business suite(aioug aug2015)
Getting optimal performance from oracle e business suite(aioug aug2015)
 
Oracle SQL Developer for the DBA
Oracle SQL Developer for the DBAOracle SQL Developer for the DBA
Oracle SQL Developer for the DBA
 
IOUG at Coors Field ASH and AWR in EM12c!
IOUG at Coors Field ASH and AWR in EM12c!IOUG at Coors Field ASH and AWR in EM12c!
IOUG at Coors Field ASH and AWR in EM12c!
 
SQL Tuning made easier with SQLTXPLAIN (SQLT)
SQL Tuning made easier with SQLTXPLAIN (SQLT)SQL Tuning made easier with SQLTXPLAIN (SQLT)
SQL Tuning made easier with SQLTXPLAIN (SQLT)
 
Using MySQL Enterprise Monitor for Continuous Performance Improvement
Using MySQL Enterprise Monitor for Continuous Performance ImprovementUsing MySQL Enterprise Monitor for Continuous Performance Improvement
Using MySQL Enterprise Monitor for Continuous Performance Improvement
 
MySQL Performance Schema : fossasia
MySQL Performance Schema : fossasiaMySQL Performance Schema : fossasia
MySQL Performance Schema : fossasia
 
Sql tuning tools of the trade
Sql tuning tools of the tradeSql tuning tools of the trade
Sql tuning tools of the trade
 
MySQL-Performance Schema- What's new in MySQL-5.7 DMRs
MySQL-Performance Schema- What's new in MySQL-5.7 DMRsMySQL-Performance Schema- What's new in MySQL-5.7 DMRs
MySQL-Performance Schema- What's new in MySQL-5.7 DMRs
 
Oracle Warehouse Builder to Oracle Data Integrator 12c Migration Utility
Oracle Warehouse Builder to Oracle Data Integrator 12c Migration UtilityOracle Warehouse Builder to Oracle Data Integrator 12c Migration Utility
Oracle Warehouse Builder to Oracle Data Integrator 12c Migration Utility
 
Primavera P6 Tips and Tricks
Primavera P6 Tips and TricksPrimavera P6 Tips and Tricks
Primavera P6 Tips and Tricks
 
Sql tuning made easier with sqltxplain (sqlt)
Sql tuning made easier with sqltxplain (sqlt)Sql tuning made easier with sqltxplain (sqlt)
Sql tuning made easier with sqltxplain (sqlt)
 
All of the Performance Tuning Features in Oracle SQL Developer
All of the Performance Tuning Features in Oracle SQL DeveloperAll of the Performance Tuning Features in Oracle SQL Developer
All of the Performance Tuning Features in Oracle SQL Developer
 
KoprowskiT_SQLRelay2014#4_Caerdydd_MaintenancePlansForBeginners
KoprowskiT_SQLRelay2014#4_Caerdydd_MaintenancePlansForBeginnersKoprowskiT_SQLRelay2014#4_Caerdydd_MaintenancePlansForBeginners
KoprowskiT_SQLRelay2014#4_Caerdydd_MaintenancePlansForBeginners
 

Recently uploaded

Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyFrank van der Linden
 
XpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsXpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsMehedi Hasan Shohan
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 

Recently uploaded (20)

Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The Ugly
 
XpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsXpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software Solutions
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 

How a Developer can Troubleshoot a SQL performing poorly on a Production DB

  • 1. How a Developer Can Troubleshoot a SQL Performing Poorly on a Production DB Carlos Sierra
  • 2. • Oracle Performance and SQL Tuning • Consultant/Developer/DBA • eDB360 and eAdam • SQLT and SQLHC • Exadata Carlos Sierra Enkitec (c) 2014 2
  • 3. Motivation • Developers might need to do SQL Tuning • Diagnostics Collection is key for SQL Tuning • Developers have limited access to DB server – OEM is usually off limits • Developers need reliable SQL Tuning tools • Developers need to learn about these tools 11/4/2014 Enkitec © 3
  • 4. Common SQL Troubleshooting Steps 1. Implement proper code instrumentation 2. Find application SQL performing poorly 3. Gather diagnostics on SQL of concern 4. Determine root cause of poor performance 5. Fix root cause 11/4/2014 Enkitec © 4
  • 5. Code Instrumentation • Data elements available – Service – Client Identifier – Client Info – Module – Action • Data type and size: VARCHAR2(64) 11/4/2014 Enkitec © 5
  • 7. Service (1) • Database logical name(s) set per instance • GV$SYSTEM_PARAMETER2 “service_names” 11/4/2014 Enkitec © 7
  • 8. Service (2) • Service SYS$BACKGROUND – Background Processes • Service SYS$USERS – Default when session is not associated to Service • Package DBMS_SERVICE – Start, stop, create, delete, modify, disconnect 11/4/2014 Enkitec © 8
  • 9. PL/SQL Instrumentation APIs • DBMS_SESSION.SET_IDENTIFIER – Sets CLIENT_IDENTIFIER • DBMS_APPLICATION_INFO.SET_CLIENT_INFO – Sets CLIENT_INFO • DBMS_APPLICATION_INFO.SET_MODULE – Sets MODULE and ACTION 11/4/2014 Enkitec © 9
  • 10. API usage Example for PL/SQL • Set before application code • Reset after application code and error handling 11/4/2014 Enkitec © 10
  • 11. Query V$ to finding SQL • GV$SESSION – Session Status – Service, Module, Action, Client, User • GV$SQL – SQL Text – Elapsed Time 11/4/2014 Enkitec © 11
  • 13. Some “safe” Diagnostics Tools • SQL Trace and TKPROF • Execution Plan and DBMS_XPLAN • planx.sql, sqlmon.sql and sqlash.sql • snapper.sql • SQLHC and SQLTXPLAIN 11/4/2014 Enkitec © 13
  • 14. Tracing Methods • ALTER SESSION – SQL_TRACE parameter – Event 10046 • DBMS_SESSION • DBMS_MONITOR (preferred) • ORADEBUG – Event 10046 11/4/2014 Enkitec © 14
  • 15. SQL_TRACE Syntax • ALTER SESSION SET SQL_TRACE = TRUE; • ALTER SESSION SET SQL_TRACE = FALSE; • Own Session 11/4/2014 Enkitec © 15
  • 16. Event 10046 Syntax • ALTER SESSION SET EVENTS '10046 TRACE NAME CONTEXT FOREVER, LEVEL N'; • ALTER SESSION SET EVENTS '10046 TRACE NAME CONTEXT OFF'; • Own Session 11/4/2014 Enkitec © 16
  • 17. Event 10046 Levels • 1: Performance metrics and Execution Plan metrics – 10g: Execution Plan metrics for all executions – 11g: Execution Plan metrics for 1st execution • 4: Binds • 8: Waits • 16: Execution Plan metrics for each execution (11.1+) • 64: Execution Plan metrics for 1st then each with DB Time > 1min (11.2.0.2+) 11/4/2014 Enkitec © 17
  • 18. Event 10046 Level Examples • Execution Plan metrics + Binds + Waits – Level 4 + 8 = 12 • 11.1+: Execution Plan metrics for 1st execution • 10g: Execution Plan metrics for all executions • Binds + Waits + 1st Exec + >1m Execs – Level 4 + 8 + 64 = 76 • 11.2.0.2+ 11/4/2014 Enkitec © 18
  • 19. DBMS_SESSION APIs • SESSION_TRACE_ENABLE – waits (TRUE|FALSE) – binds (FALSE|TRUE) – plan_stat (FIRST_EXECUTION|ALL_EXECUTIONS) • SESSION_TRACE_DISABLE • Own Session 11/4/2014 Enkitec © 19
  • 20. DBMS_MONITOR APIs • Enable SQL Trace – SERV_MOD_ACT_TRACE_ENABLE – CLIENT_ID_TRACE_ENABLE – SESSION_TRACE_ENABLE • ENABLE and DISABLE versions • TRACE and STAT versions 11/4/2014 Enkitec © 20
  • 21. SERV_MOD_ACT_TRACE_ENABLE • service_name (required) • module_name (optional) • action_name (optional) • waits (TRUE|FALSE) • binds (FALSE|TRUE) • plan_stat (FIRST_EXECUTION|ALL_EXECUTIONS) 11/4/2014 Enkitec © 21
  • 22. CLIENT_ID_TRACE_ENABLE • client_id (required) • waits (TRUE|FALSE) • binds (FALSE|TRUE) • plan_stat – FIRST_EXECUTION|ALL_EXECUTIONS 11/4/2014 Enkitec © 22
  • 23. SESSION_TRACE_ENABLE • session_id (if null then own else sid) • serial_num (if null then use sid only) • waits (TRUE|FALSE) • binds (FALSE|TRUE) • plan_stat – FIRST_EXECUTION|ALL_EXECUTIONS 11/4/2014 Enkitec © 23
  • 24. Some related Views • Active Tracing – DBA_ENABLED_TRACES • Collected Statistics – V$SERV_MOD_ACT_STATS – V$CLIENT_STATS – V$SESSTAT 11/4/2014 Enkitec © 24
  • 25. Trace Location • 11g – V$DIAG_INFO – Name = 'Diag Trace' • 10g – V$PARAMETER2 – Name = 'user_dump_dest' 11/4/2014 Enkitec © 25
  • 26. TKPROF Syntax • tkprof tracefile outputfile [sort=option] • sort=prsela fchela exeela 11/4/2014 Enkitec © 26
  • 28. TKPROF Execution Plan Sample 11/4/2014 Enkitec © 28
  • 29. DBMS_XPLAN Table Functions • DISPLAY • DISPLAY_AWR • DISPLAY_CURSOR • DISPLAY_PLAN • DISPLAY_SQL_PLAN_BASELINE • DISPLAY_SQLSET 11/4/2014 Enkitec © 29
  • 30. DBMS_XPLAN.DISPLAY_CURSOR • sql_id (default: last executed session cursor) • cursor_child_no (default: 0) • format (default: typical) – allstats (io and mem stats for all executions) – allstats last (ditto for last execution) – advanced (includes outline) both undocumented 11/4/2014 Enkitec © 30
  • 35. planx.sql • Installs nothing • 10g and 11g • Parameters – Oracle Diagnostics Pack License? Y | N – SQL_ID • Free 11/4/2014 Enkitec © 35
  • 36. planx.sql Execution Plan • DBMS_XPLAN.DISPLAY – GV$SQL_PLAN_STATISTICS_ALL – ADVANCED ALLSTATS LAST • DBMS_XPLAN.DISPLAY_AWR – ADVANCED 11/4/2014 Enkitec © 36
  • 37. planx.sql Views (1) • GV$SQLSTATS (extended retention) • GV$SQLSTATS_PLAN_HASH • GV$SQL • GV$ACTIVE_SESSION_HISTORY 11/4/2014 Enkitec © 37
  • 38. planx.sql Views (2) • DBA_HIST_SQLSTAT • DBA_HIST_SQL_PLAN • DBA_HIST_ACTIVE_SESS_HISTORY 11/4/2014 Enkitec © 38
  • 39. planx.sql Views (3) • DBA_TABLES • DBA_INDEXES • DBA_TAB_COLS • DBA_IND_COLS 11/4/2014 Enkitec © 39
  • 44. sqlmon.sql • Installs nothing • 10g and 11g • Parameters – Oracle Tuning Pack (required) License? Y | N – SQL_ID • Free 11/4/2014 Enkitec © 44
  • 45. sqlmon.sql Output • SQL Monitor Reports – HTML – Text – List – Detail 11/4/2014 Enkitec © 45
  • 47. 11/4/2014 Enkitec © 47 SQL Monitor Execution Plan
  • 49. sqlash.sql • Installs nothing • 10g and 11g • Parameters – Oracle Diagnostics Pack (required) License? Y | N – SQL_ID • Free 11/4/2014 Enkitec © 49
  • 50. sqlash.sql Output • ASH Reports for one SQL – Format • HTML • Text – Source • Memory • AWR 11/4/2014 Enkitec © 50
  • 52. Snapper • Session Centric • Installs nothing • 10g and 11g • 4 Parameters • Does not require Diagnostics or Tuning Pack • Free Enkitec © 2014 52
  • 53. Snapper Syntax • Scope (‘all’ includes ASH and Stats) • seconds_in_snap (30 is common) • snap_count (between 1 and 5 are common) • sid (session id) • Execution Sample – @snapper.sql all 30 1 50 11/4/2014 Enkitec © 53
  • 55. SQLHC 1366133.1 • Installs nothing • 10g and 11g • Parameters – Oracle Pack License? T | D | N – SQL_ID • Free (requires MOS account) 11/4/2014 Enkitec © 55
  • 57. SQLTXPLAIN (SQLT) 215187.1 • Installs two schemas and many objects • 10g and 11g • Methods – SQLT XTRACT (inputs SQL_ID) – SQLT XECUTE (inputs SQL Text) • Free (requires MOS account) 11/4/2014 Enkitec © 57
  • 59. Summary 1. Implement proper code instrumentation 2. Find application SQL performing poorly 3. Gather diagnostics on SQL of concern 4. Determine root cause of poor performance 5. Fix root cause 11/4/2014 Enkitec © 59
  • 60. References • Oracle Documentation • http://blog.tanelpoder.com/files/scripts/snap per.sql • http://carlos-sierra.net/ (look for cscripts) • SQL Health-Check (SQLHC): MOS 1366133.1 • SQLXPLAIN (SQLT): MOS 215187.1 11/4/2014 Enkitec © 60
  • 61. Contact Information • carlos.sierra@enkitec.com • carlos-sierra.net • @csierra_usa Enkitec (c) 2014 61