10.07.2015 Views

Expert Oracle Exadata - Parent Directory

Expert Oracle Exadata - Parent Directory

Expert Oracle Exadata - Parent Directory

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

CHAPTER 16 UNLEARNING SOME THINGS WE THOUGHT WE KNEWOn most <strong>Exadata</strong> implementations, a fairly high percentage of long-running queries are offloaded.You can check to see what percentage of your long-running SQL statements have been offloaded byselecting all the statements from v$sql (or from the AWR table DBA_HIST_SQLSTAT) that have an averagerun time of over some number of seconds, or that have an average logical I/O value that is greater thansome reasonable value. Actually, the logical I/O is a better metric to use, as some of the offloadedstatements will run very quickly and may not meet your minimum time criteria, which will give you adistorted perspective on the percentage of statements that are being offloaded. Here’s an example (notethat the scripts are included in the online code repository):SYS@SANDBOX1> @offload_percentEnter value for sql_text:Enter value for min_etime:Enter value for min_avg_lio: 500000TOTAL OFFLOADED OFFLOADED_%-------------------------------13 11 84.62%SYS@SANDBOX1> /Enter value for sql_text: SELECT%Enter value for min_etime:Enter value for min_avg_lio: 500000TOTAL OFFLOADED OFFLOADED_%-------------------------------11 11 100%The listing makes use of the offload_percent.sql script, which calculates a percentage ofstatements currently in the shared pool that have been offloaded. We initially used it to evaluate allstatements that had over 500,000 logical I/Os. We then ran it a second time and limited our investigationto statements that begin with the word SELECT. In the next listing we’ve made use of a script (fsxo.sql)that allows us to see the actual statements that contribute to the OFFLOAD_% calculated in the previouslisting.SYS@SANDBOX1> @fsxoEnter value for sql_text:Enter value for sql_id:Enter value for min_etime:Enter value for min_avg_lio: 500000Enter value for offloaded:SQL_ID EXECS AVG_ETIME OFFLOAD IO_SAVED_% SQL_TEXT----------------------------------------------------------------------------0bvt5z48t18by 1 .10 Yes 100.00 select count(*) from skew3 whe0jytfr1y0jdr1 1 .09 Yes 100.00 select count(*) from skew3 whe12pkwt8zjdhbx 1 .09 Yes 100.00 select count(*) from skew3 whe2zbt555tg123s 2 4.37 Yes 71.85 select /*+ parallel (a 8) */ a412n404yughsy 1 .09 Yes 100.00 select count(*) from skew3 whe515

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!