This tool is somewhat similar to DBMS_PROFILER, but it is too fine-grained than DBMS_PROFILER. There is no hierarchy and no summary, while DBMS_PROFILER can provide layer-by-layer summary information similar to the organization tree.
Steps for usage
- First create an external directory PLSHPROF_DIR (create or replace directory PLSHPROF_DIR as '/tmp'; )
- Assign read and write permissions to the directory to the specified database user (GRANT WRITE, READ ON DIRECTORY PLSHPROF_DIRTO apps;)
- Grant sys.dbms_hprof execution permission to the specified database user (grant execute on dbms_hprof to apps;)
- Execute the script @?/rdbms/admin/dbmshptab.sql to initialize the environment
- Open a session and execute dbms_hprof.start_profiling(location => 'PLSHPROF_DIR', filename => 'pwdbb
w.trc'); - In the same session, execute related stored procedures
- End: dbms_hprof.stop_profiling;
- Execute in the ORACLE_BIN directory: plshprof -output hprof pwdbbw.trc
- Where hprof is the name of the generated output html file, and pwdbbw.trc is the source tracking file
- View the generated html report