Oracle查看trace檔案步驟____Oracle

來源:互聯網
上載者:User

Oracle查看trace 檔案步驟   1.獲得當前trace檔案產生路徑 SQL> select tracefile from v$process where addr in (select paddr from v$session where sid in (select sid from v$mystat));   TRACEFILE  www.2cto.com   ------------------------------------------------------------------------------------------------------------------------------- f:\oracle\administrator\diag\rdbms\orcl\orcl\trace\orcl_ora_1160.trc   2.開啟當前session的trace SQL> alter session set sql_trace=true; SQL> select count(*) from t1;   3.轉換trc檔案內容為可讀的輸出結果   C:\Documents and Settings\Administrator>tkprof f:\oracle\administrator\diag\rdbm s\orcl\orcl\trace\orcl_ora_1160.trc output=c:\aa.txt   TKPROF: Release 11.2.0.1.0 - Development on 星期六 10月 6 23:51:07 2012 Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.   4.開啟c:\aa.txt, 就會看到關於SQL語句 ‘ select count(*) from t1;’ 的執行計畫 [sql]  ********************************************************************************   SQL ID: 5bc0v4my7dvr5   Plan Hash: 3724264953   select count(*)   from    www.2cto.com    t1      call     count       cpu    elapsed       disk      query    current        rows   ------- ------  -------- ---------- ---------- ---------- ----------  ----------   Parse        1      0.00       0.04          0          1          0           0   Execute      1      0.00       0.00          0          0          0           0   Fetch        2      0.03       0.01          0       1070          0           1   ------- ------  -------- ---------- ---------- ---------- ----------  ----------   total        4      0.03       0.06          0       1071          0           1      Misses in library cache during parse: 1   Optimizer mode: ALL_ROWS   Parsing user id: 91        Rows     Row Source Operation   -------  ---------------------------------------------------         1  SORT AGGREGATE (cr=1070 pr=0 pw=0 time=0 us)     72597   TABLE ACCESS FULL T1 (cr=1070 pr=0 pw=0 time=172543 us cost=298 size=0 card=66014)       www.2cto.com   ********************************************************************************  

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.