Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I think this <em>approaches</em> what you're after:</p> <pre><code>-- View lines of code profiled, along with run times, next to the complete, ordered source.. -- Provides an annotated view of profiled packages, procs, etc. -- Only the first line of a multiline SQL statement will register with timings. SELECT u.UNIT_OWNER || '.' || u.UNIT_NAME AS "Unit" , s.line , CASE WHEN d.TOTAL_OCCUR &gt;= 0 THEN 'C' ELSE ' ' END AS Covered , s.TEXT , TO_CHAR(d.TOTAL_TIME / (1000*1000*1000), 'fm990.000009') AS "Total Time (sec)" , CASE WHEN NVL(d.TOTAL_OCCUR, 1) &gt; 0 THEN d.TOTAL_OCCUR ELSE 1 END AS "# Iterations" , TO_CHAR(CASE WHEN d.TOTAL_OCCUR &gt; 0 THEN d.TOTAL_TIME / (d.TOTAL_OCCUR * (1000*1000*1000)) ELSE NULL END, 'fm990.000009') AS "Avg Time (sec)" FROM all_source s LEFT JOIN plsql_profiler_units u ON s.OWNER = u.UNIT_OWNER AND s.NAME = u.UNIT_NAME AND s.TYPE = u.UNIT_TYPE LEFT JOIN plsql_profiler_data d ON u.UNIT_NUMBER = d.UNIT_NUMBER AND s.LINE = d.LINE# AND d.RUNID = u.RUNID WHERE u.RUNID = ? -- Add RUNID of profiler run to investigate here ORDER BY u.UNIT_NAME , s.LINE </code></pre> <p>There are few issues to keep in mind.</p> <p>1) Many rows in the <code>plsql_profiler_data</code> table will <strong>NOT</strong> have accurate values in their <code>TOTAL_TIME</code> column because they executed faster than the resolution of the timer.</p> <p><a href="http://asktom.oracle.com/pls/asktom/f?p=100:11:0%3a%3a%3a%3aP11_QUESTION_ID:2468040431316#2513208067625" rel="nofollow">Ask Tom re: timings</a>:</p> <blockquote> <p>The timings are collected using some unit of time, typically only granular to the HSECS.</p> <p>That means that many discrete events that take less then 1/100th of a second, appear to take ZERO seconds.</p> <p>Many discrete events that take less then 1/100ths of a second may appear to take 1/100th of a second.</p> </blockquote> <p>2) Only the <strong>FIRST</strong> line in a multiline statement will show as covered. So if you split an <code>INSERT</code> or whatever across multiple lines, I don't know of any easy way to have <em>every</em> line of that statement to show as profiled in an Annotated Source style of report.</p> <p>Also, check out Oracle's <a href="http://docs.oracle.com/cd/E11882_01/appdev.112/e25788/d_profil.htm#sthref6972" rel="nofollow">dbms_profiler</a> documentation and <a href="http://psoug.org/reference/dbms_profiler.html" rel="nofollow">this</a> useful package reference for help crafting queries against the collected profiler data.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload