home *** CD-ROM | disk | FTP | other *** search
/ Oracle Video Server 3.0.3.1 / OVS_3031_NT.iso / win32 / tracesvr / otrcrpt6.sql < prev    next >
Encoding:
Text File  |  1997-01-21  |  1.3 KB  |  33 lines

  1. rem Analyze SQL library cache performance.  There are two approaches:
  2. rem
  3. rem   1. See how many statement executions were marked as having the SQL 
  4. rem      missing from the library cache
  5. rem   2. Count how many library cache addresses a statement has
  6. rem
  7. rem To determine which statements have been swapped in and out of the library 
  8. rem cache, query the SQL Segment event table (v_192216243_f_5_e_7_7_3) using
  9. rem the statement identifier.
  10.  
  11. select sql_text_hash_end "SQL ID", count(*) "# Misses"
  12.     from v_192216243_f_5_e_9_7_3
  13.     where missed_end = 1
  14.     group by sql_text_hash_end
  15.     having count(*) > 1;
  16.  
  17. select distinct (et.sql_text_hash_end) "SQL ID", 
  18.        count(distinct et.lib_cache_addr_end) "Cache Addrs"
  19.        from v_192216243_f_5_e_9_7_3 et, v_192216243_f_5_e_9_7_3 ev,
  20.             epc_collection c
  21.        where et.sql_text_hash_end = ev.sql_text_hash_end and
  22.              c.collection_name = '&&cllctn' and
  23.              c.collection_id = et.collection_number and
  24.              c.collection_id = ev.collection_number
  25.        group by et.sql_text_hash_end 
  26.        having count(distinct ev.lib_cache_addr_end) > 1;
  27.  
  28. select count(distinct sql_text_hash_end) "# of SQL Stmts"
  29.        from v_192216243_f_5_e_9_7_3;
  30.  
  31. -- select sql_text from v_192216243_f_5_e_7_7_3 
  32. -- where sql_text_hash = <SQL ID>;
  33.