dbms_profiler

@?/rdbms/admin/profload.sql

@?/rdbms/admin/proftab.sql

CREATE or replace PUBLIC SYNONYM plsql_profiler_runnumber FOR sys.plsql_profiler_runnumber;
CREATE or replace PUBLIC SYNONYM plsql_profiler_runs FOR sys.plsql_profiler_runs;
CREATE or replace PUBLIC SYNONYM plsql_profiler_units FOR sys.plsql_profiler_units;
CREATE or replace PUBLIC SYNONYM plsql_profiler_data FOR sys.plsql_profiler_data;


execute dbms_profiler.start_profiler('PRC_KC23_XYH_SJTB');

exec PRC_KC23_XYH_SJTB;

execute dbms_profiler.stop_profiler;

@chk_profile

--file_name: chk_profile.sql
set linesize 190
column text format a100 wrap
column total_time format 99999.9
column min_time format 99999.9
column max_time format 99999.9
select s.text ,
       p.total_occur ,
       p.total_time/1000000000 total_time,
       p.min_time/1000000000 min_time,
       p.max_time/1000000000 max_time
from plsql_profiler_data p, user_source s, plsql_profiler_runs r
where p.line# = s.line
and   p.runid = r.runid
and   r.run_comment = '&input_comment_name'
and   s.name =upper('&input_sp_name');

你可能感兴趣的:(dbms_profiler)