1、以sysdba用户sys运行profload脚本。
该脚本位于@?/rdbms/admin/profload.sql
2、在需要进行存储过程性能测试的用户下运行proftab脚本,创建三个必须的表:
PLSQL_PROFILER_DATA
PLSQL_PROFILER_RUNS
PLSQL_PROFILER_UNITS
该脚本位于@?/rdbms/admin/proftab.sql
3、查询
select runid,run_date,run_comment from plsql_profiler_runs order by runid;
select p.unit_name,p.occured,p.tot_time,p.line# line,substr(s.text,1,75) text
from
(select u.unit_name,d.total_occur occured,
(d.total_time/1000000000) tot_time,d.line#
from plsql_profiler_units u,plsql_profiler_data d
where d.runid=u.runid and d.unit_number=u.unit_number
and d.total_occur>0
and u.runid=&run_id) p,
user_source s
where p.unit_name=s.name(+) and p.line#=s.line(+)
order by p.unit_name,p.line#;
该脚本位于@?/rdbms/admin/profload.sql
2、在需要进行存储过程性能测试的用户下运行proftab脚本,创建三个必须的表:
PLSQL_PROFILER_DATA
PLSQL_PROFILER_RUNS
PLSQL_PROFILER_UNITS
该脚本位于@?/rdbms/admin/proftab.sql
3、查询
select runid,run_date,run_comment from plsql_profiler_runs order by runid;
select p.unit_name,p.occured,p.tot_time,p.line# line,substr(s.text,1,75) text
from
(select u.unit_name,d.total_occur occured,
(d.total_time/1000000000) tot_time,d.line#
from plsql_profiler_units u,plsql_profiler_data d
where d.runid=u.runid and d.unit_number=u.unit_number
and d.total_occur>0
and u.runid=&run_id) p,
user_source s
where p.unit_name=s.name(+) and p.line#=s.line(+)
order by p.unit_name,p.line#;