Many times we have been called for the poor performance of a database and it has been narrowed down to a SQL statement. Subsequent analysis have shown that the execution plan has been changed and a wrong execution plan was being used. Resolution normally, is to fix the execution plan in 11g by running variable x…
When reviewing the performance of some queries, it is sometimes useful to review the sessions statistics for each execution of the query. I had a situation that required to look at these stats so I could see why one query would run fast and sometimes much slower. I wrote a simple wrapper ksh shell script for the query. It saves the session statistics in a table before and after the execution of the query and then prints out the statistics in a pivot report. This turned out to be very handy to me and therefore I chose to share it with the world :)
In this post I show you how to get SQL strings transformed in a way that resembles the result of cursor_sharing.