Create the profiler tables from the table creation script available in oracle home directory
@C:\orclee18c\WINDOWS.X64_180000_db_home_ORACLE18C\rdbms\admin\proftab.sql
** Search for "proftab.sql" in your oracle home directory
Scripts to clear the profiler tables
truncate table plsql_profiler_data;
delete from plsql_profiler_units;
delete from plsql_profiler_runs;
Invoke "dbms_profiler.start_profiler" to start the profiler and "dbms_profiler.stop_profiler" to stop the profiler.Sample code give below,
exec dbms_profiler.start_profiler ('MY_TEST_PERFORMANCE_RUN1');
exec proc_a;
exec dbms_profiler.stop_profiler();
Query to find the line wise time taken
SELECT
plsql_profiler_runs.RUN_DATE,
plsql_profiler_runs.RUN_COMMENT,
plsql_profiler_units.UNIT_TYPE,
plsql_profiler_units.UNIT_NAME,
plsql_profiler_data.LINE#,
plsql_profiler_data.TOTAL_OCCUR,
plsql_profiler_data.TOTAL_TIME,
plsql_profiler_data.MIN_TIME,
plsql_profiler_data.MAX_TIME,
round(plsql_profiler_data.total_time/1000000000) total_time_in_sec,
trunc(((plsql_profiler_data.total_time)/(sum(plsql_profiler_data.total_time) over()))*100,2) pct_of_time_taken
FROM
plsql_profiler_data,plsql_profiler_runs,plsql_profiler_units
where plsql_profiler_data.total_time > 0
and plsql_profiler_data.runid = plsql_profiler_runs.runid
and plsql_profiler_units.UNIT_NUMBER = plsql_profiler_data.UNIT_NUMBER
and plsql_profiler_units.runid = plsql_profiler_runs.runid
ORDER BY
plsql_profiler_data.total_time DESC;
very clear explanation .keep going.
ReplyDeleteVery Good Explanation.
ReplyDeleteThank you for posting hand on queries here keep going your good work
ReplyDeleteThanks a lot Siva!!!
ReplyDeleteVery good explanation.Thanks Siva.
ReplyDeleteToo good
ReplyDeleteHi .. Its great to learn with great explanation. Can we have video of detailed explanation of how to analyze explain plan and AWR report step by step for performance issues. Really appreciate for all these.
ReplyDeletehow can i tune plsql code while its running and i have no control over it ?
ReplyDeleteExcellent explanation for Exp people
ReplyDeleteExcellent explanation. looking forward to see more videos related to PT.
ReplyDeleteThanks in Advance
Sir, your are my Guru for PLSQL. Keep rocking
ReplyDeleteGreat learning concepts
ReplyDeleteHi siva,
ReplyDeleteReally good explanation.
Very very excellent teaching methodology.
ReplyDeleteI wish I had found this site earlier.
I follow your channel regularly. This is one of the best I've come across for practical solutions. Keep helping us with your guidance, it helps.
ReplyDelete