执行前需要运行$ORACLE_HOME/rdbms/admin/proftab.sql 创建一些关键表. BEGIN DBMS_PROFILER.START_PROFILER('MY_APPLICATION'||TO_CHAR(SYSDATE,'YYYYMMDD HH24:MI:SS')); --执行程序 MY_APPLICATION_CODE; DBMS_PROFILER.END_PROFILER; END; SELECT to_char(p1.total_time/10000000,'99999999') ||'-' ||to_char(p1.total_occur) AS time_count, SUBSTR (p2.unit_owner,1,20) ||'.' ||DECODE(p2.unit_name,'','<anonymous>',SUBSTR(p2.unit_name,1,20)) AS unit, to_char(p1.line#)|| '-'||p3.text text FROM plsql_profiler_data p1 ,plsql_profiler_units p2 ,all_source p3 ,(SELECT SUM(total_time) AS grand_total FROM plsql_profiler_units) p4 WHERE p2.unit_owner NOT IN('SYS','SYSTEM') AND P1.RUNID=3 AND (P1.TOTAL_TIME >=P4.grand_total/100) AND P1.RUNID=P2.RUNID AND P2.UNIT_NUMBER=P1.UNIT_NUMBER AND P3.TYPE='PACKAGE BODY' AND P3.OWNER=P2.UNIT_OWNER AND p3.line=p1.line# AND p3.name=p2.unit_name ORDER BY p1.total_time DESC;
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。