SlideShare a Scribd company logo
Oracle Database Performance
Tuning
Presenter
Nitin Anjankar
Oracle
Databases
Performance
Agenda…
1. Finding the problem.
2. Approach towards resolution
3. Tool use for analysis
What Is Database Tuning?
The database tuning process consists of tasks such as:
 Balancing the different types of competing
resources in the database environment so that the
most important applications have priority access to
the resources they need to run.
 Identifying and eliminating resource bottlenecks.
 Optimizing the use of existing resources within the
database environment.
 Taking advantage of database features for the types
of work performed on the database.
What Are the Types of Performance
Tuning?
Tuning an Oracle database can involve tuning the application, the
instance, and the space usage in a database.
• Application/SQL Tuning –SQL Reuse Opportunities, Optimal
Data Access.
• Instance/Memory Tuning –Instance Parameter Optimizations.
• Space/Storage Management –Appropriate Space Management.
• OS Tuning –Tuning OS parameter like SWAP, Memory.
• Network Tuning –Network latency & loads.
Database Performance Analysis..
What data needs to be collect
1. Since when you are facing this slowness issue ?
2. Is the slowness persistent or does it varies based on the time of the day?
3. Is it happening with any specific user/s or across the globe ?
4. Is the complete application slow or issue with any specific module/operation/job ?
5. If it is with any specific module/operation/job then what queries are associated with this ? What actually it does ?
6. if its query specific, do we have the explain plan when it was working fine?
7. Is it newly added or old module/operation/job ?
8. What is its previous completion/response time ?
9. What is the current completion/response time ?
What data needs to be collect
10. Is there any changes happened at application/database/server level in recent past? If yes what kind of changes done ?
11. Is only one job/query slow or the entire database slow:
12. List of all tables used in your job:
13. Good Time (1 hour duration when the job was running fine):
14. Bad time (1 hour duration when the job was running the slowest):
15. After when has the issue started occurring, any particular date or database change or event ?
16. Will you be able to replicate the issue on the database at our will ?
17. Any select queries you can provide which are running slow ?
18. Have you connected with any other team. If yes, any findings from their side ?
Decentralize the issue..
Query Processing..
Oracle 10g+ uses something called the CBO (Cost-Based Optimizer) which determines the most efficient way to execute a
SQL statement after considering many factors related to the objects referenced and the conditions specified in the query.
This determination is an important step in the processing of any SQL statement and can greatly affect execution time.
A SQL statement can be executed in many different ways, including the following:
 Full table scans
 Index scans
 Nested loops
 Hash joins
The output from the optimizer is a plan that describes an optimum method of execution. The CBO formulates this plan
based on statistics. A combination of correct index-usage and decent statistics is key for well-performing queries.
Sometimes the CBO can make decisions that seem incorrect — this may be as a result of stale or inaccurate statistics.
Locating Slow Queries
Finding the guilty SQL is the first step in solving the issue. There are many approaches to this. Chances are if you
have a performance problem you already know the offending SQL.
The following are some simple ways of finding resource-intensive SQL.
1. Obtaining the Execution Plan
2. Enterprise Manager
3. AWR Views
4. ASH Reports
5. Real Time SQL Monitoring(SQL Trace)
Xplan for SQL
Plan hash value: 454993881
--------------------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
--------------------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 2 | 176 | 13 (16)| 00:00:01 |
| 1 | NESTED LOOPS | | 2 | 176 | 13 (16)| 00:00:01 |
|* 2 | HASH JOIN | | 1 | 65 | 11 (19)| 00:00:01 |
|* 3 | TABLE ACCESS FULL | PS_DEPT_TBL | 330 | 14850 | 6 (0)| 00:00:01 |
| 4 | VIEW | VW_SQ_1 | 660 | 13200 | 4 (25)| 00:00:01 |
| 5 | HASH GROUP BY | | 660 | 13860 | 4 (25)| 00:00:01 |
|* 6 | INDEX FAST FULL SCAN | PS1DEPT_TBL | 660 | 13860 | 3 (0)| 00:00:01 |
| 7 | TABLE ACCESS BY INDEX ROWID| PS_NAMES | 2 | 46 | 2 (0)| 00:00:01 |
|* 8 | INDEX RANGE SCAN | PS_NAMES | 2 | | 1 (0)| 00:00:01 |
--------------------------------------------------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
2 - access("D"."EFFDT"="VW_COL_1" AND SYS_OP_DESCEND("D"."EFFDT")=SYS_OP_DESCEND(
"VW_COL_1") AND "SETID"="D"."SETID" AND "DEPTID"="D"."DEPTID")
3 - filter("D"."EFF_STATUS"='A')
6 - filter(SYS_OP_UNDESCEND(SYS_OP_DESCEND("EFFDT"))<=SYSDATE@! AND
SYS_OP_DESCEND("EFFDT")>=SYS_OP_DESCEND(SYSDATE@!))
8 - access("N"."EMPLID"="D"."MANAGER_ID")
Xplan comparision
SQL_ID bxu9sk3q91trn
--------------------
INSERT INTO TMP_ACTSEARCH1 (ACTIVITY_PK) SELECT ACT.ACTIVITY_PK FROM
TBL_TMX_ACTIVITY ACT WHERE CONTAINS(ACT.ACTIVITYDESC, :B1 ) > 0
Plan hash value: 2274164979
--------------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
--------------------------------------------------------------------------------------
| 0 | INSERT STATEMENT | | | | 379K(100)| |
| 1 | TABLE ACCESS FULL| TBL_TMX_ACTIVITY | 1 | 74 | 379K (8)| 00:00:30 |
--------------------------------------------------------------------------------------
SQL_ID bxu9sk3q91trn
--------------------
INSERT INTO TMP_ACTSEARCH1 (ACTIVITY_PK) SELECT ACT.ACTIVITY_PK FROM
TBL_TMX_ACTIVITY ACT WHERE CONTAINS(ACT.ACTIVITYDESC, :B1 ) > 0
Plan hash value: 4216380757
--------------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)|
--------------------------------------------------------------------------------------
| 0 | INSERT STATEMENT | | | | 1 (100)|
| 1 | TABLE ACCESS BY INDEX ROWID| TBL_TMX_ACTIVITY | 1 | 73 | 0 (0)|
| 2 | DOMAIN INDEX | FT_TABLE_RAJLCU1R | | | 0 (0)|
--------------------------------------------------------------------------------------
Most possible/common causes..
There are many approaches to this finding issue and its possible solutions.
The following are some simple ways of possible causes.
1. Wait Events / Resource contention (Views: V$SESSION, V$LOCK, V$SQLTEXT, V$ACTIVE_SESSION_HISTORY,
V$SESSION_WAIT_HISTORY, GV$SESSION_WAIT)
2. Large number of long running scripts other than problematic one ( Views : V$SESSION, V$PROCESS)
3. Multiple Active & Inactive sessions counts. (Views : V$SESSION)
4. Old object(table/index/sys) statistics (Views : DBA_TAB_STATISTICS, DBA_IND_STATISTICS)
5. Incorrect optimization/execution plan(utility : dbms_xplan)
6. Fragmentation (Views : V$DBA_SEGMENTS, V$DBA_TABLES)
Most possible/common causes..
continue
8. Getting database I/O wrong (V$SQLAREA, V$SYSSTAT, PROCESS ,V$SESSION ,V$SESSTAT ,V$SESS_IO
,V$BGPROCESS)
9. Bad use of cursors and the shared pool (Parameter : CUSRSOR_SHARING , SGA, PGA)
10. High Amount of Recursive (SYS) SQL. (View : V$SYS_TIME_MODEL, V$SESS_TIME_MODEL)
11. Duplicate indexing / Full table scan (Views : V$OBJECT_USAGE, V$OBJECT_VIEW)
Recommended Database Parameters for
Oracle 10g and 11g
Some useful scripts..
Here are the links for all scripts mentioned in this document:
 Blocking/Waiting Sessions
 Detect long running scripts
 Index Usage
 Locks and inactive sessions
 Hit ratio and CPU usage
 Tablespace utilization
 Disk I/O
References
• http://www.oracle.com/technetwork/articles/schumacher-analysis-099313.html
• http://vsbabu.org/oracle/sect05.html
• http://www.dba-oracle.com/t_statistics_level_parameter.htm
• http://www.myoracletips.in/2013/02/what-is-pctfree-and-pctused-in-oracle.html
• http://rwijk.blogspot.com/2008/03/dbmsxplandisplaycursor.html
Ad

More Related Content

What's hot (20)

How a Developer can Troubleshoot a SQL performing poorly on a Production DB
How a Developer can Troubleshoot a SQL performing poorly on a Production DBHow a Developer can Troubleshoot a SQL performing poorly on a Production DB
How a Developer can Troubleshoot a SQL performing poorly on a Production DB
Carlos Sierra
 
Oracle database performance tuning
Oracle database performance tuningOracle database performance tuning
Oracle database performance tuning
Yogiji Creations
 
SQL Monitoring in Oracle Database 12c
SQL Monitoring in Oracle Database 12cSQL Monitoring in Oracle Database 12c
SQL Monitoring in Oracle Database 12c
Tanel Poder
 
Online index rebuild automation
Online index rebuild automationOnline index rebuild automation
Online index rebuild automation
Carlos Sierra
 
Survey of some free Tools to enhance your SQL Tuning and Performance Diagnost...
Survey of some free Tools to enhance your SQL Tuning and Performance Diagnost...Survey of some free Tools to enhance your SQL Tuning and Performance Diagnost...
Survey of some free Tools to enhance your SQL Tuning and Performance Diagnost...
Carlos Sierra
 
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
John Beresniewicz
 
Earl Shaffer Oracle Performance Tuning pre12c 11g AWR uses
Earl Shaffer Oracle Performance Tuning pre12c 11g AWR usesEarl Shaffer Oracle Performance Tuning pre12c 11g AWR uses
Earl Shaffer Oracle Performance Tuning pre12c 11g AWR uses
oramanc
 
Oracle Database performance tuning using oratop
Oracle Database performance tuning using oratopOracle Database performance tuning using oratop
Oracle Database performance tuning using oratop
Sandesh Rao
 
Oracle Performance Tools of the Trade
Oracle Performance Tools of the TradeOracle Performance Tools of the Trade
Oracle Performance Tools of the Trade
Carlos Sierra
 
SQL Tuning 101
SQL Tuning 101SQL Tuning 101
SQL Tuning 101
Carlos Sierra
 
EM12c: Capacity Planning with OEM Metrics
EM12c: Capacity Planning with OEM MetricsEM12c: Capacity Planning with OEM Metrics
EM12c: Capacity Planning with OEM Metrics
Maaz Anjum
 
Oracle Performance Tuning Fundamentals
Oracle Performance Tuning FundamentalsOracle Performance Tuning Fundamentals
Oracle Performance Tuning Fundamentals
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$ contention
Tanel Poder
 
AIOUG-GroundBreakers-Jul 2019 - 19c RAC
AIOUG-GroundBreakers-Jul 2019 - 19c RACAIOUG-GroundBreakers-Jul 2019 - 19c RAC
AIOUG-GroundBreakers-Jul 2019 - 19c RAC
Sandesh Rao
 
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
 
Performance Tuning With Oracle ASH and AWR. Part 1 How And What
Performance Tuning With Oracle ASH and AWR. Part 1 How And WhatPerformance Tuning With Oracle ASH and AWR. Part 1 How And What
Performance Tuning With Oracle ASH and AWR. Part 1 How And What
udaymoogala
 
A deep dive about VIP,HAIP, and SCAN
A deep dive about VIP,HAIP, and SCAN A deep dive about VIP,HAIP, and SCAN
A deep dive about VIP,HAIP, and SCAN
Riyaj Shamsudeen
 
Oracle RAC 19c and Later - Best Practices #OOWLON
Oracle RAC 19c and Later - Best Practices #OOWLONOracle RAC 19c and Later - Best Practices #OOWLON
Oracle RAC 19c and Later - Best Practices #OOWLON
Markus Michalewicz
 
Understanding oracle rac internals part 1 - slides
Understanding oracle rac internals   part 1 - slidesUnderstanding oracle rac internals   part 1 - slides
Understanding oracle rac internals part 1 - slides
Mohamed Farouk
 
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
Jeff Smith
 
How a Developer can Troubleshoot a SQL performing poorly on a Production DB
How a Developer can Troubleshoot a SQL performing poorly on a Production DBHow a Developer can Troubleshoot a SQL performing poorly on a Production DB
How a Developer can Troubleshoot a SQL performing poorly on a Production DB
Carlos Sierra
 
Oracle database performance tuning
Oracle database performance tuningOracle database performance tuning
Oracle database performance tuning
Yogiji Creations
 
SQL Monitoring in Oracle Database 12c
SQL Monitoring in Oracle Database 12cSQL Monitoring in Oracle Database 12c
SQL Monitoring in Oracle Database 12c
Tanel Poder
 
Online index rebuild automation
Online index rebuild automationOnline index rebuild automation
Online index rebuild automation
Carlos Sierra
 
Survey of some free Tools to enhance your SQL Tuning and Performance Diagnost...
Survey of some free Tools to enhance your SQL Tuning and Performance Diagnost...Survey of some free Tools to enhance your SQL Tuning and Performance Diagnost...
Survey of some free Tools to enhance your SQL Tuning and Performance Diagnost...
Carlos Sierra
 
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
John Beresniewicz
 
Earl Shaffer Oracle Performance Tuning pre12c 11g AWR uses
Earl Shaffer Oracle Performance Tuning pre12c 11g AWR usesEarl Shaffer Oracle Performance Tuning pre12c 11g AWR uses
Earl Shaffer Oracle Performance Tuning pre12c 11g AWR uses
oramanc
 
Oracle Database performance tuning using oratop
Oracle Database performance tuning using oratopOracle Database performance tuning using oratop
Oracle Database performance tuning using oratop
Sandesh Rao
 
Oracle Performance Tools of the Trade
Oracle Performance Tools of the TradeOracle Performance Tools of the Trade
Oracle Performance Tools of the Trade
Carlos Sierra
 
EM12c: Capacity Planning with OEM Metrics
EM12c: Capacity Planning with OEM MetricsEM12c: Capacity Planning with OEM Metrics
EM12c: Capacity Planning with OEM Metrics
Maaz Anjum
 
Oracle Performance Tuning Fundamentals
Oracle Performance Tuning FundamentalsOracle Performance Tuning Fundamentals
Oracle Performance Tuning Fundamentals
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$ contention
Tanel Poder
 
AIOUG-GroundBreakers-Jul 2019 - 19c RAC
AIOUG-GroundBreakers-Jul 2019 - 19c RACAIOUG-GroundBreakers-Jul 2019 - 19c RAC
AIOUG-GroundBreakers-Jul 2019 - 19c RAC
Sandesh Rao
 
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
 
Performance Tuning With Oracle ASH and AWR. Part 1 How And What
Performance Tuning With Oracle ASH and AWR. Part 1 How And WhatPerformance Tuning With Oracle ASH and AWR. Part 1 How And What
Performance Tuning With Oracle ASH and AWR. Part 1 How And What
udaymoogala
 
A deep dive about VIP,HAIP, and SCAN
A deep dive about VIP,HAIP, and SCAN A deep dive about VIP,HAIP, and SCAN
A deep dive about VIP,HAIP, and SCAN
Riyaj Shamsudeen
 
Oracle RAC 19c and Later - Best Practices #OOWLON
Oracle RAC 19c and Later - Best Practices #OOWLONOracle RAC 19c and Later - Best Practices #OOWLON
Oracle RAC 19c and Later - Best Practices #OOWLON
Markus Michalewicz
 
Understanding oracle rac internals part 1 - slides
Understanding oracle rac internals   part 1 - slidesUnderstanding oracle rac internals   part 1 - slides
Understanding oracle rac internals part 1 - slides
Mohamed Farouk
 
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
Jeff Smith
 

Similar to Oracle Database Performance Tuning Basics (20)

Presentación Oracle Database Migración consideraciones 10g/11g/12c
Presentación Oracle Database Migración consideraciones 10g/11g/12cPresentación Oracle Database Migración consideraciones 10g/11g/12c
Presentación Oracle Database Migración consideraciones 10g/11g/12c
Ronald Francisco Vargas Quesada
 
ebs-performance-tuning-part-1-470542.pdf
ebs-performance-tuning-part-1-470542.pdfebs-performance-tuning-part-1-470542.pdf
ebs-performance-tuning-part-1-470542.pdf
ElboulmaniMohamed
 
31063115_1679409488310Developer_Tuning_Tips_-_UTOUG_Mar_2023.pdf
31063115_1679409488310Developer_Tuning_Tips_-_UTOUG_Mar_2023.pdf31063115_1679409488310Developer_Tuning_Tips_-_UTOUG_Mar_2023.pdf
31063115_1679409488310Developer_Tuning_Tips_-_UTOUG_Mar_2023.pdf
TricantinoLopezPerez
 
Analyze database system using a 3 d method
Analyze database system using a 3 d methodAnalyze database system using a 3 d method
Analyze database system using a 3 d method
Ajith Narayanan
 
Oracle Query Optimizer - An Introduction
Oracle Query Optimizer - An IntroductionOracle Query Optimizer - An Introduction
Oracle Query Optimizer - An Introduction
adryanbub
 
collab2011-tuning-ebusiness-421966.pdf
collab2011-tuning-ebusiness-421966.pdfcollab2011-tuning-ebusiness-421966.pdf
collab2011-tuning-ebusiness-421966.pdf
ElboulmaniMohamed
 
T sql performance guidelines for better db stress powers
T sql performance guidelines for better db stress powersT sql performance guidelines for better db stress powers
T sql performance guidelines for better db stress powers
Shehap Elnagar
 
T sql performance guidelines for better db stress powers
T sql performance guidelines for better db stress powersT sql performance guidelines for better db stress powers
T sql performance guidelines for better db stress powers
Shehap Elnagar
 
T sql performance guidelines for better db stress powers
T sql performance guidelines for better db stress powersT sql performance guidelines for better db stress powers
T sql performance guidelines for better db stress powers
Shehap Elnagar
 
How should I monitor my idaa
How should I monitor my idaaHow should I monitor my idaa
How should I monitor my idaa
Cuneyt Goksu
 
Evolution of Performance Management: Oracle 12c adaptive optimizations - ukou...
Evolution of Performance Management: Oracle 12c adaptive optimizations - ukou...Evolution of Performance Management: Oracle 12c adaptive optimizations - ukou...
Evolution of Performance Management: Oracle 12c adaptive optimizations - ukou...
Nelson Calero
 
Dynamics ax performance tuning
Dynamics ax performance tuningDynamics ax performance tuning
Dynamics ax performance tuning
OutsourceAX
 
Top 10 tips for Oracle performance
Top 10 tips for Oracle performanceTop 10 tips for Oracle performance
Top 10 tips for Oracle performance
Guy Harrison
 
Sql and PL/SQL Best Practices I
Sql and PL/SQL Best Practices ISql and PL/SQL Best Practices I
Sql and PL/SQL Best Practices I
Carlos Oliveira
 
שבוע אורקל 2016
שבוע אורקל 2016שבוע אורקל 2016
שבוע אורקל 2016
Aaron Shilo
 
Oracle ebs capacity_analysisusingstatisticalmethods
Oracle ebs capacity_analysisusingstatisticalmethodsOracle ebs capacity_analysisusingstatisticalmethods
Oracle ebs capacity_analysisusingstatisticalmethods
Ajith Narayanan
 
Oracle Sql Tuning
Oracle Sql TuningOracle Sql Tuning
Oracle Sql Tuning
Chris Adkin
 
Free oracle performance tools
Free oracle performance toolsFree oracle performance tools
Free oracle performance tools
Rogerio Bacchi Eguchi
 
Getting optimal performance from oracle e-business suite presentation
Getting optimal performance from oracle e-business suite presentationGetting optimal performance from oracle e-business suite presentation
Getting optimal performance from oracle e-business suite presentation
Berry Clemens
 
Oracle EBS Production Support - Recommendations
Oracle EBS Production Support - RecommendationsOracle EBS Production Support - Recommendations
Oracle EBS Production Support - Recommendations
Vigilant Technologies
 
Presentación Oracle Database Migración consideraciones 10g/11g/12c
Presentación Oracle Database Migración consideraciones 10g/11g/12cPresentación Oracle Database Migración consideraciones 10g/11g/12c
Presentación Oracle Database Migración consideraciones 10g/11g/12c
Ronald Francisco Vargas Quesada
 
ebs-performance-tuning-part-1-470542.pdf
ebs-performance-tuning-part-1-470542.pdfebs-performance-tuning-part-1-470542.pdf
ebs-performance-tuning-part-1-470542.pdf
ElboulmaniMohamed
 
31063115_1679409488310Developer_Tuning_Tips_-_UTOUG_Mar_2023.pdf
31063115_1679409488310Developer_Tuning_Tips_-_UTOUG_Mar_2023.pdf31063115_1679409488310Developer_Tuning_Tips_-_UTOUG_Mar_2023.pdf
31063115_1679409488310Developer_Tuning_Tips_-_UTOUG_Mar_2023.pdf
TricantinoLopezPerez
 
Analyze database system using a 3 d method
Analyze database system using a 3 d methodAnalyze database system using a 3 d method
Analyze database system using a 3 d method
Ajith Narayanan
 
Oracle Query Optimizer - An Introduction
Oracle Query Optimizer - An IntroductionOracle Query Optimizer - An Introduction
Oracle Query Optimizer - An Introduction
adryanbub
 
collab2011-tuning-ebusiness-421966.pdf
collab2011-tuning-ebusiness-421966.pdfcollab2011-tuning-ebusiness-421966.pdf
collab2011-tuning-ebusiness-421966.pdf
ElboulmaniMohamed
 
T sql performance guidelines for better db stress powers
T sql performance guidelines for better db stress powersT sql performance guidelines for better db stress powers
T sql performance guidelines for better db stress powers
Shehap Elnagar
 
T sql performance guidelines for better db stress powers
T sql performance guidelines for better db stress powersT sql performance guidelines for better db stress powers
T sql performance guidelines for better db stress powers
Shehap Elnagar
 
T sql performance guidelines for better db stress powers
T sql performance guidelines for better db stress powersT sql performance guidelines for better db stress powers
T sql performance guidelines for better db stress powers
Shehap Elnagar
 
How should I monitor my idaa
How should I monitor my idaaHow should I monitor my idaa
How should I monitor my idaa
Cuneyt Goksu
 
Evolution of Performance Management: Oracle 12c adaptive optimizations - ukou...
Evolution of Performance Management: Oracle 12c adaptive optimizations - ukou...Evolution of Performance Management: Oracle 12c adaptive optimizations - ukou...
Evolution of Performance Management: Oracle 12c adaptive optimizations - ukou...
Nelson Calero
 
Dynamics ax performance tuning
Dynamics ax performance tuningDynamics ax performance tuning
Dynamics ax performance tuning
OutsourceAX
 
Top 10 tips for Oracle performance
Top 10 tips for Oracle performanceTop 10 tips for Oracle performance
Top 10 tips for Oracle performance
Guy Harrison
 
Sql and PL/SQL Best Practices I
Sql and PL/SQL Best Practices ISql and PL/SQL Best Practices I
Sql and PL/SQL Best Practices I
Carlos Oliveira
 
שבוע אורקל 2016
שבוע אורקל 2016שבוע אורקל 2016
שבוע אורקל 2016
Aaron Shilo
 
Oracle ebs capacity_analysisusingstatisticalmethods
Oracle ebs capacity_analysisusingstatisticalmethodsOracle ebs capacity_analysisusingstatisticalmethods
Oracle ebs capacity_analysisusingstatisticalmethods
Ajith Narayanan
 
Oracle Sql Tuning
Oracle Sql TuningOracle Sql Tuning
Oracle Sql Tuning
Chris Adkin
 
Getting optimal performance from oracle e-business suite presentation
Getting optimal performance from oracle e-business suite presentationGetting optimal performance from oracle e-business suite presentation
Getting optimal performance from oracle e-business suite presentation
Berry Clemens
 
Oracle EBS Production Support - Recommendations
Oracle EBS Production Support - RecommendationsOracle EBS Production Support - Recommendations
Oracle EBS Production Support - Recommendations
Vigilant Technologies
 
Ad

Recently uploaded (20)

How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...
How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...
How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...
Egor Kaleynik
 
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
Andre Hora
 
Societal challenges of AI: biases, multilinguism and sustainability
Societal challenges of AI: biases, multilinguism and sustainabilitySocietal challenges of AI: biases, multilinguism and sustainability
Societal challenges of AI: biases, multilinguism and sustainability
Jordi Cabot
 
Landscape of Requirements Engineering for/by AI through Literature Review
Landscape of Requirements Engineering for/by AI through Literature ReviewLandscape of Requirements Engineering for/by AI through Literature Review
Landscape of Requirements Engineering for/by AI through Literature Review
Hironori Washizaki
 
Secure Test Infrastructure: The Backbone of Trustworthy Software Development
Secure Test Infrastructure: The Backbone of Trustworthy Software DevelopmentSecure Test Infrastructure: The Backbone of Trustworthy Software Development
Secure Test Infrastructure: The Backbone of Trustworthy Software Development
Shubham Joshi
 
How to Optimize Your AWS Environment for Improved Cloud Performance
How to Optimize Your AWS Environment for Improved Cloud PerformanceHow to Optimize Your AWS Environment for Improved Cloud Performance
How to Optimize Your AWS Environment for Improved Cloud Performance
ThousandEyes
 
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdfMicrosoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
TechSoup
 
Exploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the FutureExploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the Future
ICS
 
Adobe After Effects Crack FREE FRESH version 2025
Adobe After Effects Crack FREE FRESH version 2025Adobe After Effects Crack FREE FRESH version 2025
Adobe After Effects Crack FREE FRESH version 2025
kashifyounis067
 
Sales Deck SentinelOne Singularity Platform.pptx
Sales Deck SentinelOne Singularity Platform.pptxSales Deck SentinelOne Singularity Platform.pptx
Sales Deck SentinelOne Singularity Platform.pptx
EliandoLawnote
 
Scaling GraphRAG: Efficient Knowledge Retrieval for Enterprise AI
Scaling GraphRAG:  Efficient Knowledge Retrieval for Enterprise AIScaling GraphRAG:  Efficient Knowledge Retrieval for Enterprise AI
Scaling GraphRAG: Efficient Knowledge Retrieval for Enterprise AI
danshalev
 
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Ranjan Baisak
 
Adobe Master Collection CC Crack Advance Version 2025
Adobe Master Collection CC Crack Advance Version 2025Adobe Master Collection CC Crack Advance Version 2025
Adobe Master Collection CC Crack Advance Version 2025
kashifyounis067
 
Revolutionizing Residential Wi-Fi PPT.pptx
Revolutionizing Residential Wi-Fi PPT.pptxRevolutionizing Residential Wi-Fi PPT.pptx
Revolutionizing Residential Wi-Fi PPT.pptx
nidhisingh691197
 
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Dele Amefo
 
Adobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage Dashboards
Adobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage DashboardsAdobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage Dashboards
Adobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage Dashboards
BradBedford3
 
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Andre Hora
 
Exploring Code Comprehension in Scientific Programming: Preliminary Insight...
Exploring Code Comprehension  in Scientific Programming:  Preliminary Insight...Exploring Code Comprehension  in Scientific Programming:  Preliminary Insight...
Exploring Code Comprehension in Scientific Programming: Preliminary Insight...
University of Hawai‘i at Mānoa
 
Get & Download Wondershare Filmora Crack Latest [2025]
Get & Download Wondershare Filmora Crack Latest [2025]Get & Download Wondershare Filmora Crack Latest [2025]
Get & Download Wondershare Filmora Crack Latest [2025]
saniaaftab72555
 
Download YouTube By Click 2025 Free Full Activated
Download YouTube By Click 2025 Free Full ActivatedDownload YouTube By Click 2025 Free Full Activated
Download YouTube By Click 2025 Free Full Activated
saniamalik72555
 
How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...
How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...
How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...
Egor Kaleynik
 
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
Andre Hora
 
Societal challenges of AI: biases, multilinguism and sustainability
Societal challenges of AI: biases, multilinguism and sustainabilitySocietal challenges of AI: biases, multilinguism and sustainability
Societal challenges of AI: biases, multilinguism and sustainability
Jordi Cabot
 
Landscape of Requirements Engineering for/by AI through Literature Review
Landscape of Requirements Engineering for/by AI through Literature ReviewLandscape of Requirements Engineering for/by AI through Literature Review
Landscape of Requirements Engineering for/by AI through Literature Review
Hironori Washizaki
 
Secure Test Infrastructure: The Backbone of Trustworthy Software Development
Secure Test Infrastructure: The Backbone of Trustworthy Software DevelopmentSecure Test Infrastructure: The Backbone of Trustworthy Software Development
Secure Test Infrastructure: The Backbone of Trustworthy Software Development
Shubham Joshi
 
How to Optimize Your AWS Environment for Improved Cloud Performance
How to Optimize Your AWS Environment for Improved Cloud PerformanceHow to Optimize Your AWS Environment for Improved Cloud Performance
How to Optimize Your AWS Environment for Improved Cloud Performance
ThousandEyes
 
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdfMicrosoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
TechSoup
 
Exploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the FutureExploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the Future
ICS
 
Adobe After Effects Crack FREE FRESH version 2025
Adobe After Effects Crack FREE FRESH version 2025Adobe After Effects Crack FREE FRESH version 2025
Adobe After Effects Crack FREE FRESH version 2025
kashifyounis067
 
Sales Deck SentinelOne Singularity Platform.pptx
Sales Deck SentinelOne Singularity Platform.pptxSales Deck SentinelOne Singularity Platform.pptx
Sales Deck SentinelOne Singularity Platform.pptx
EliandoLawnote
 
Scaling GraphRAG: Efficient Knowledge Retrieval for Enterprise AI
Scaling GraphRAG:  Efficient Knowledge Retrieval for Enterprise AIScaling GraphRAG:  Efficient Knowledge Retrieval for Enterprise AI
Scaling GraphRAG: Efficient Knowledge Retrieval for Enterprise AI
danshalev
 
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Ranjan Baisak
 
Adobe Master Collection CC Crack Advance Version 2025
Adobe Master Collection CC Crack Advance Version 2025Adobe Master Collection CC Crack Advance Version 2025
Adobe Master Collection CC Crack Advance Version 2025
kashifyounis067
 
Revolutionizing Residential Wi-Fi PPT.pptx
Revolutionizing Residential Wi-Fi PPT.pptxRevolutionizing Residential Wi-Fi PPT.pptx
Revolutionizing Residential Wi-Fi PPT.pptx
nidhisingh691197
 
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Dele Amefo
 
Adobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage Dashboards
Adobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage DashboardsAdobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage Dashboards
Adobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage Dashboards
BradBedford3
 
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Andre Hora
 
Exploring Code Comprehension in Scientific Programming: Preliminary Insight...
Exploring Code Comprehension  in Scientific Programming:  Preliminary Insight...Exploring Code Comprehension  in Scientific Programming:  Preliminary Insight...
Exploring Code Comprehension in Scientific Programming: Preliminary Insight...
University of Hawai‘i at Mānoa
 
Get & Download Wondershare Filmora Crack Latest [2025]
Get & Download Wondershare Filmora Crack Latest [2025]Get & Download Wondershare Filmora Crack Latest [2025]
Get & Download Wondershare Filmora Crack Latest [2025]
saniaaftab72555
 
Download YouTube By Click 2025 Free Full Activated
Download YouTube By Click 2025 Free Full ActivatedDownload YouTube By Click 2025 Free Full Activated
Download YouTube By Click 2025 Free Full Activated
saniamalik72555
 
Ad

Oracle Database Performance Tuning Basics

  • 3. Agenda… 1. Finding the problem. 2. Approach towards resolution 3. Tool use for analysis
  • 4. What Is Database Tuning? The database tuning process consists of tasks such as:  Balancing the different types of competing resources in the database environment so that the most important applications have priority access to the resources they need to run.  Identifying and eliminating resource bottlenecks.  Optimizing the use of existing resources within the database environment.  Taking advantage of database features for the types of work performed on the database.
  • 5. What Are the Types of Performance Tuning? Tuning an Oracle database can involve tuning the application, the instance, and the space usage in a database. • Application/SQL Tuning –SQL Reuse Opportunities, Optimal Data Access. • Instance/Memory Tuning –Instance Parameter Optimizations. • Space/Storage Management –Appropriate Space Management. • OS Tuning –Tuning OS parameter like SWAP, Memory. • Network Tuning –Network latency & loads.
  • 7. What data needs to be collect 1. Since when you are facing this slowness issue ? 2. Is the slowness persistent or does it varies based on the time of the day? 3. Is it happening with any specific user/s or across the globe ? 4. Is the complete application slow or issue with any specific module/operation/job ? 5. If it is with any specific module/operation/job then what queries are associated with this ? What actually it does ? 6. if its query specific, do we have the explain plan when it was working fine? 7. Is it newly added or old module/operation/job ? 8. What is its previous completion/response time ? 9. What is the current completion/response time ?
  • 8. What data needs to be collect 10. Is there any changes happened at application/database/server level in recent past? If yes what kind of changes done ? 11. Is only one job/query slow or the entire database slow: 12. List of all tables used in your job: 13. Good Time (1 hour duration when the job was running fine): 14. Bad time (1 hour duration when the job was running the slowest): 15. After when has the issue started occurring, any particular date or database change or event ? 16. Will you be able to replicate the issue on the database at our will ? 17. Any select queries you can provide which are running slow ? 18. Have you connected with any other team. If yes, any findings from their side ?
  • 10. Query Processing.. Oracle 10g+ uses something called the CBO (Cost-Based Optimizer) which determines the most efficient way to execute a SQL statement after considering many factors related to the objects referenced and the conditions specified in the query. This determination is an important step in the processing of any SQL statement and can greatly affect execution time. A SQL statement can be executed in many different ways, including the following:  Full table scans  Index scans  Nested loops  Hash joins The output from the optimizer is a plan that describes an optimum method of execution. The CBO formulates this plan based on statistics. A combination of correct index-usage and decent statistics is key for well-performing queries. Sometimes the CBO can make decisions that seem incorrect — this may be as a result of stale or inaccurate statistics.
  • 11. Locating Slow Queries Finding the guilty SQL is the first step in solving the issue. There are many approaches to this. Chances are if you have a performance problem you already know the offending SQL. The following are some simple ways of finding resource-intensive SQL. 1. Obtaining the Execution Plan 2. Enterprise Manager 3. AWR Views 4. ASH Reports 5. Real Time SQL Monitoring(SQL Trace)
  • 12. Xplan for SQL Plan hash value: 454993881 -------------------------------------------------------------------------------------------- | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | -------------------------------------------------------------------------------------------- | 0 | SELECT STATEMENT | | 2 | 176 | 13 (16)| 00:00:01 | | 1 | NESTED LOOPS | | 2 | 176 | 13 (16)| 00:00:01 | |* 2 | HASH JOIN | | 1 | 65 | 11 (19)| 00:00:01 | |* 3 | TABLE ACCESS FULL | PS_DEPT_TBL | 330 | 14850 | 6 (0)| 00:00:01 | | 4 | VIEW | VW_SQ_1 | 660 | 13200 | 4 (25)| 00:00:01 | | 5 | HASH GROUP BY | | 660 | 13860 | 4 (25)| 00:00:01 | |* 6 | INDEX FAST FULL SCAN | PS1DEPT_TBL | 660 | 13860 | 3 (0)| 00:00:01 | | 7 | TABLE ACCESS BY INDEX ROWID| PS_NAMES | 2 | 46 | 2 (0)| 00:00:01 | |* 8 | INDEX RANGE SCAN | PS_NAMES | 2 | | 1 (0)| 00:00:01 | -------------------------------------------------------------------------------------------- Predicate Information (identified by operation id): --------------------------------------------------- 2 - access("D"."EFFDT"="VW_COL_1" AND SYS_OP_DESCEND("D"."EFFDT")=SYS_OP_DESCEND( "VW_COL_1") AND "SETID"="D"."SETID" AND "DEPTID"="D"."DEPTID") 3 - filter("D"."EFF_STATUS"='A') 6 - filter(SYS_OP_UNDESCEND(SYS_OP_DESCEND("EFFDT"))<=SYSDATE@! AND SYS_OP_DESCEND("EFFDT")>=SYS_OP_DESCEND(SYSDATE@!)) 8 - access("N"."EMPLID"="D"."MANAGER_ID")
  • 13. Xplan comparision SQL_ID bxu9sk3q91trn -------------------- INSERT INTO TMP_ACTSEARCH1 (ACTIVITY_PK) SELECT ACT.ACTIVITY_PK FROM TBL_TMX_ACTIVITY ACT WHERE CONTAINS(ACT.ACTIVITYDESC, :B1 ) > 0 Plan hash value: 2274164979 -------------------------------------------------------------------------------------- | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | -------------------------------------------------------------------------------------- | 0 | INSERT STATEMENT | | | | 379K(100)| | | 1 | TABLE ACCESS FULL| TBL_TMX_ACTIVITY | 1 | 74 | 379K (8)| 00:00:30 | -------------------------------------------------------------------------------------- SQL_ID bxu9sk3q91trn -------------------- INSERT INTO TMP_ACTSEARCH1 (ACTIVITY_PK) SELECT ACT.ACTIVITY_PK FROM TBL_TMX_ACTIVITY ACT WHERE CONTAINS(ACT.ACTIVITYDESC, :B1 ) > 0 Plan hash value: 4216380757 -------------------------------------------------------------------------------------- | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| -------------------------------------------------------------------------------------- | 0 | INSERT STATEMENT | | | | 1 (100)| | 1 | TABLE ACCESS BY INDEX ROWID| TBL_TMX_ACTIVITY | 1 | 73 | 0 (0)| | 2 | DOMAIN INDEX | FT_TABLE_RAJLCU1R | | | 0 (0)| --------------------------------------------------------------------------------------
  • 14. Most possible/common causes.. There are many approaches to this finding issue and its possible solutions. The following are some simple ways of possible causes. 1. Wait Events / Resource contention (Views: V$SESSION, V$LOCK, V$SQLTEXT, V$ACTIVE_SESSION_HISTORY, V$SESSION_WAIT_HISTORY, GV$SESSION_WAIT) 2. Large number of long running scripts other than problematic one ( Views : V$SESSION, V$PROCESS) 3. Multiple Active & Inactive sessions counts. (Views : V$SESSION) 4. Old object(table/index/sys) statistics (Views : DBA_TAB_STATISTICS, DBA_IND_STATISTICS) 5. Incorrect optimization/execution plan(utility : dbms_xplan) 6. Fragmentation (Views : V$DBA_SEGMENTS, V$DBA_TABLES)
  • 15. Most possible/common causes.. continue 8. Getting database I/O wrong (V$SQLAREA, V$SYSSTAT, PROCESS ,V$SESSION ,V$SESSTAT ,V$SESS_IO ,V$BGPROCESS) 9. Bad use of cursors and the shared pool (Parameter : CUSRSOR_SHARING , SGA, PGA) 10. High Amount of Recursive (SYS) SQL. (View : V$SYS_TIME_MODEL, V$SESS_TIME_MODEL) 11. Duplicate indexing / Full table scan (Views : V$OBJECT_USAGE, V$OBJECT_VIEW)
  • 16. Recommended Database Parameters for Oracle 10g and 11g
  • 17. Some useful scripts.. Here are the links for all scripts mentioned in this document:  Blocking/Waiting Sessions  Detect long running scripts  Index Usage  Locks and inactive sessions  Hit ratio and CPU usage  Tablespace utilization  Disk I/O
  • 18. References • http://www.oracle.com/technetwork/articles/schumacher-analysis-099313.html • http://vsbabu.org/oracle/sect05.html • http://www.dba-oracle.com/t_statistics_level_parameter.htm • http://www.myoracletips.in/2013/02/what-is-pctfree-and-pctused-in-oracle.html • http://rwijk.blogspot.com/2008/03/dbmsxplandisplaycursor.html

Editor's Notes

  • #3: In Slide Show mode, click the arrow to enter the PowerPoint Getting Started Center.