Call now: 252-767-6166  
Oracle Training Oracle Support Development Oracle Apps

Free Oracle Tips

HTML Text

 Home
 E-mail Us
 Oracle Articles


 Oracle Training
 Oracle News

 Oracle Forum
 Class Catalog


 Our Staff
 Our Prices
 Help Wanted!

 Remote DBA
 Oracle Tuning
 Emergency 911
 RAC Support
 Apps Support
 Analysis
 Design
 Implementation
 Oracle Support


 SQL Tuning
 Security

 UNIX
 Oracle UNIX
 Linux
 Oracle Linux
 Monitoring
 Remote help

 Remote plans
 Remote
services
 Oracle C++
 Oracle Java
 Apache
 JDeveloper
 App Server

 Applications
 Oracle Forms
 Oracle Portal
 11i Upgrades
 SQL Server
 Oracle Concepts
 HTML-DB Tips
 Software Help

 Remote Help  
 Development  

 Implementation


 Financials Training
 Oracle 11i
 Oracle Apps 11i
 Oracle Workflow
 Oracle AR 11i Class
 Oracle AP 11i class
 Oracle GL 11i class
 Oracle HR 11i class
 Oracle FA 11i class
 11i Project Mgt
 11i procurement
 11i collections


 Oracle Posters
 Oracle Books

 Oracle Tuning Book
 Oracle RAC Book
 Oracle Security
 Easy Oracle Books
 Oracle Scripts
 SQL Server DBA
 SQL Design Patterns
 Ion
 Excel-DB   


 BC Oracle News


 Rednecks!
 Dress code
 Arabian Stallion

 Burleson Arabians
 Guide Horses
 Don Burleson Blog
 Golf & Travel


 Privacy Policy
 

 

 
 

Find sub-optimal Oracle SQL

Oracle Tips by Burleson Consulting
July 15, 2003
Don Burleson

Before you can identify problem SQL in your database, you have to ask the question of what is ‘bad SQL.’  What criteria do you use when you begin the hunt for problem SQL in your critical systems? 

Understand that even the seasoned experts disagree on what constitutes efficient and inefficient SQL; so there’s no way to sufficiently answer this question to every Oracle professional’s satisfaction.  What follows are some general criteria you can use when evaluating the output from various database monitors or personal diagnostic scripts:   

  • Overall Response (Elapsed) Time – This is how much time the query took to parse, execute, and fetch the data needed to satisfy the query.  It should not include the network time needed to make the round trip from the requesting client workstation to the database server.

  • CPU Time – This is how much CPU time the query took to parse, execute, and fetch the data needed to satisfy the query.

  • Physical I/O – Often used as the major statistic in terms of identifying good vs. bad SQL, this is a measure of how many disk reads the query caused to satisfy the user’s request.  While you certainly want to control disk I/O where possible, it’s important that you not focus solely on physical I/O as the single benchmark of inefficient SQL.  Make no mistake, disk access is slower than memory access and also consumes processing time making the physical to logical transition, but you need to look at the entire I/O picture of a SQL statement, which includes looking at a statements’ logical I/O as well. 

  • Logical I/O – This is a measure of how many memory reads the query took to satisfy the user’s request.  The goal of tuning I/O for a query should be to examine both logical and physical I/O, and use appropriate mechanisms to keep both to a minimum.

  • Repetition – This is a measure of how often the query has been executed.  A problem in this area isn’t as easy to spot as the others unless you know your application well.  A query that takes a fraction of a second to execute may still be causing a headache on your system if it’s executed erroneously (for example, a query that executes in a runaway PL/SQL loop) over and over again 

There are other criteria that you can examine, like sort activity or access plan statistics (that show items such as Cartesian joins  and the like), but more often than not, these measures are reflected in the criteria listed above.

Fortunately, Oracle records all the above measures (at least Oracle9i does), which makes tracking the SQL that’s been submitted against an Oracle database a lot easier. 



 

 

 

Oracle performance tuning software 
 
 

Oracle performance tuning book

 

 
 
 
 

Search oracle
 
Oracle performance Tuning 10g reference poster
 
 
 
Oracle training in Linux commands
 
Oracle training Excel
 
Oracle training & performance tuning books
 

 

Note: This Oracle documentation was created as a support and Oracle training reference for use by our DBA performance tuning consulting professionals.  Feel free to ask questions on our Oracle forum.

Verify experience! Anyone considering using the services of an Oracle support expert should independently investigate their credentials and experience, and not rely on advertisements and self-proclaimed expertise. All legitimate Oracle experts publish their Oracle qualifications.

Errata?  Oracle technology is changing and we strive to update our BC Oracle support information.  If you find an error or have a suggestion for improving our content, we would appreciate your feedback.  Just  e-mail:  and include the URL for the page.
 
 


Burleson Consulting

The Oracle of Database Support

&

Oracle Performance Tuning


 

Copyright © 1996 -  2009 by Burleson Enterprises, Inc. All rights reserved.

Oracle © is the registered trademark of Oracle Corporation.