Oracle Performance Firefighting
by Craig Shallahamer

Get the book here



Craig Shallahamer's Blog

You were brought to this page based on an internet search and as a free service to Oracle DBAs.

The text below is an except from the book, Oracle Performance Firefighting, written by Craig Shallahamer of OraPub, Inc. Figures and tables are not included on this page, only their reference.
To order the book in either print or PDF form, click here.


©2009, 2010 by Craig Shallahamer. This is copyrighted material.
Please—Out of respect for those involved in the creation of the book and also for their familes, we ask you to respect the copyright both in intent and deed. Thank you.

-------------------------------

Figure 7-12. Shown is an example of severe library cache contention when mutexes are enabled. The same exact load and reporting interval was used as in Figure 7-11.

As was shown in Figure 7-9, Oracle is very particular about what it considers a similar SQL statement. Every statement must be parsed, and if the cursor is not found in the library cache, the cursor must be completely built (a hard parse). Hard parsing requires library cache-related latches and locks, so if hard parsing becomes so intense the related wait events are driven to the top of our reports, we will look for ways to create similar SQL statements. Oracle provides two powerful methods to do this.

The first method is to simply use bind variables instead of literals. For example, the statement select * from employee where emp_no=100 uses a literal. If the statement select * from employee where emp_no=200 was then issued, because of Oracle's hashing algorithm, the two statements would have different hash values, reside in different buckets (probably), and have different handles. As you can imagine, during intensive online transaction activity, this will result in a tremendous amount of hard parsing. If the application developers can submit the SQL statement as select * from employee where emp_no=:b1 along with employee number, the cursor will not contain the employee number, and the cursor is highly likely to be reused (since regardless of the employee number, the same cursor will be reused). This dramatically reduces hard parsing.

©2009, 2010 by Craig Shallahamer. This is copyrighted material.
Please—Out of respect for those involved in the creation of the book and also for their familes, we ask you to respect the copyright both in intent and deed. Thank you.


Know what's important before it's too late!

OraPub's
Performance Training

is like no other...





More Class Pics...
Get student testimonials!