使用圖形化界面工具實施PL/SQL Profiler 易用直覺,但是并不是所有的環境都可以使用圖形界面軟體連接配接到資料庫。對于隻能在指令行下進行剖析又需要直覺呈現剖析結果的情形,Oracle為我們提供了腳本來直接生成html文檔。本文即是基于這種情形進行示範并加以說明。
有關PL/SQL Profiler的文章可以參考:
1、實施PL/SQL Profiler步驟
--下面的步驟直接參考了Metalink文檔(ID 243755.1)
a、If needed, create the PL/SQL Profiler Tables under your application schema: @?/rdbms/admin/proftab.sql
b、If needed, install the DBMS_PROFILER API, connected as SYS: @?/rdbms/admin/profload.sql
c、Start PL/SQL Profiler in your application: EXEC DBMS_PROFILER.START_PROFILER('optional comment');
d、Execute your transaction to be profiled. Calls to PL/SQL Libraries are expected.
e、Stop PL/SQL Profiler: EXEC DBMS_PROFILER.STOP_PROFILER;
f、Connect as your application user, execute script profiler.sql provided in this document: @profiler.sql
g、Provide to profiler.sql the "runid" out of a displayed list.
h、Review HTML report generated by profiler.sql.
2、示範PL/SQL Profiler
3、Profiler剖析報告結果樣例

單擊相關的top下對應的id,或者Total Time對應的連結即可跳轉到相應的代碼部分,如下:
更多參考
<a target="_blank" href="http://blog.csdn.net/leshami/article/details/12100235">使用 DBMS_PROFILER 定位 PL/SQL 瓶頸代碼</a>
<a target="_blank" href="http://blog.csdn.net/leshami/article/details/12110195">對比 PL/SQL profiler 剖析結果</a>
<a target="_blank" href="http://blog.csdn.net/robinson_0612/article/details/7783724">DML Error Logging 特性 </a>
<a target="_blank" href="http://blog.csdn.net/robinson_0612/archive/2010/12/15/6078622.aspx">PL/SQL --> 遊标</a>
<a target="_blank" href="http://blog.csdn.net/robinson_0612/archive/2010/12/22/6092066.aspx">PL/SQL --> 隐式遊标(SQL%FOUND)</a>
<a target="_blank" href="http://blog.csdn.net/robinson_0612/article/details/7536926">批量SQL之 FORALL 語句</a>
<a target="_blank" href="http://blog.csdn.net/robinson_0612/article/details/7545597">批量SQL之 BULK COLLECT 子句</a>
<a target="_blank" href="http://blog.csdn.net/robinson_0612/article/details/7372061">PL/SQL 集合的初始化與指派</a>
<a target="_blank" href="http://blog.csdn.net/robinson_0612/article/details/7372061">PL/SQL 聯合數組與嵌套表</a>
<a target="_blank" href="http://blog.csdn.net/robinson_0612/article/details/7387647">PL/SQL 變長數組</a>
<a target="_blank" href="http://blog.csdn.net/robinson_0612/article/details/6084390">PL/SQL --> PL/SQL記錄</a>
<a target="_blank" href="http://blog.csdn.net/robinson_0612/article/details/7422254">SQL tuning 步驟</a>
<a target="_blank" href="http://blog.csdn.net/robinson_0612/article/details/7406672">高效SQL語句必殺技</a>
<a target="_blank" href="http://blog.csdn.net/robinson_0612/article/details/6893477">父遊标、子遊标及共享遊标</a>
<a target="_blank" href="http://blog.csdn.net/robinson_0612/article/details/6904229">綁定變量及其優缺點</a>
<a target="_blank" href="http://blog.csdn.net/robinson_0612/article/details/6866925">dbms_xplan之display_cursor函數的使用</a>
<a target="_blank" href="http://blog.csdn.net/robinson_0612/article/details/6866870">dbms_xplan之display函數的使用</a>
<a target="_blank" href="http://blog.csdn.net/robinson_0612/article/details/6860007">執行計劃中各字段各子產品描述</a>
<a target="_blank" href="http://blog.csdn.net/robinson_0612/article/details/6837771">使用 EXPLAIN PLAN 擷取SQL語句執行計劃</a>