Oracle 开发篇+追踪PL/SQL执行情况(层次分析器)
发布日期:2021-06-29 12:02:36
浏览次数:2
分类:技术文章
本文共 1495 字,大约阅读时间需要 4 分钟。
说明:本文为面向PL/SQL开发初学者的指导手册 标签:dbms_hprof、层次分析器、查看执行情况、Tracing PL/SQL Execution 优点:该方法适合分析PL/SQL每个环节的用时详情 易学:文中删去了不需要的多余部分,让初学者一目了然一学就会 温馨提示:如果您发现本文哪里写的有问题或者有更好的写法请留言或私信我进行修改优化
--用途
分析PL/SQL每个环节的用时详情--授权+准备
grant dba to scott; create directory d as '/home/oracle/'; grant read,write on directory d to scott; grant execute on dbms_hprof to scott;--切换用户
conn scott/tiger--启动分析(大小写敏感)
--将分析输出到D目录下的指定文件中 exec dbms_hprof.start_profiling('D','s.txt');--删除存储过程
drop procedure p1; --创建存储过程 create or replace procedure p1 is begin update scott.emp set sal=sal+1; commit; end; /--停止分析
exec dbms_hprof.stop_profiling;--创建analyze表
@?/rdbms/admin/dbmshptab.sql--转换输出
begin dbms_output.put_line(dbms_hprof.analyze('D','s.txt')); end; /--查看输出(方法1)(html格式)
[oracle@main ~]$ $ORACLE_HOME/bin/plshprof -output scott_hprof s.txt PLSHPROF: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production [14 symbols processed] [Report written to 'scott_hprof.html'][oracle@main ~]$ ls scott_hprof*
scott_hprof_2c.html scott_hprof.html scott_hprof_nsc.html scott_hprof_tc.html scott_hprof_2f.html scott_hprof_md.html scott_hprof_nsf.html scott_hprof_td.html scott_hprof_2n.html scott_hprof_mf.html scott_hprof_nsp.html scott_hprof_tf.html scott_hprof_fn.html scott_hprof_ms.html scott_hprof_pc.html scott_hprof_ts.html --查看输出(方法2)(数据库表格式) select * from scott.dbmshp_runs; select * from scott.dbmshp_function_info; select * from scott.dbmshp_parent_child_info;
※ 如果您觉得文章写的还不错, 别忘了在文末给作者点个赞哦 ~
over
转载地址:https://blog.csdn.net/zzt_2009/article/details/114239877 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!
发表评论
最新留言
逛到本站,mark一下
[***.202.152.39]2024年04月14日 12时10分51秒
关于作者
喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!
推荐文章
MySQL DQL语句基础(随堂博客)
2019-04-29
MySQL基础练习
2019-04-29
利用MySQL进行数据复杂查询(1)
2019-04-29
利用MySQL进行数据复杂查询(2)
2019-04-29
MySQL 表与表之间的关系
2019-04-29
Python数据处理
2019-04-29
Java练习题(面向对象)
2019-04-29
Python 利用os和shutil复制系统文件
2019-04-29
Python 循环输出菱形字符串
2019-04-29
MySQL常见错误总结
2019-04-29
pymysql 的基础应用
2019-04-29
Html+Css实现 启橙装饰网 项目
2019-04-29
JavaScript 实现哥德巴赫猜想
2019-04-29
JavaScript DOM
2019-04-29
Python 管理程序改进——连接MYSQL
2019-04-29
Python 爬虫
2019-04-29
Python 爬虫-百度风云榜的电影top50
2019-04-29
Python 爬虫-豆瓣影星图片下载
2019-04-29
Excel数据基础操作
2019-04-29
网页端数据库操作界面—主题函数文件
2019-04-29