DBMS_HPROF Hierarchical Profiler for 11g
Submitted by dave on Wed, 04/07/2010 - 14:39
Setup
GRANT EXECUTE ON DBMS_HPROF TO ;
CREATE DIRECTORY PROFDIR AS '/tmp/profiler_output';
Starting the Profiler
DBMS_HPROF.START_PROFILER('PROFDIR','outputfile.trc');
Execute Your Code
Execute your code in the same session as you ran the START_PROFILER function.
If you need to profile data in another session you must either instrument your code to call START_PROFILER or create a logon trigger that can call it before the user executes any PL/SQL code.
Stopping the Profiler
DBMS_HPROF.STOP_PROFILING;
Generate Output from Trace File
plshprof -output report_file_name trace_file_name