oracle之 oradebug 命令用法

來源:互聯網
上載者:User

標籤:進程   debug   systems   系統進程   limit   查看   eve   ror   擷取   

1> oradebug有哪些可用命令?

以sysdba身份登陸資料庫,通過oradebug help可以看到oradebug常用命令
sqlplus / as sysdba
oradebug help

2> 跟蹤當前會話資訊
oradebug setmypid --跟蹤當前會話
oradebug setospid --跟蹤系統進程
oradebug setorapid --跟蹤ORACLE進程
oradebug unlimit --取消trace檔案大小限制
oradebug close_trace -- 關閉 trace
oradebug tracefile_name --查看trace檔案名稱及位置

3> 用oradebug做session級10046或10053
oradebug setmypid
oradebug unlimit
oradebug session_event 10046 trace name context forever ,level 4 --啟用會話級10046
oradebug event 10046 trace name context off --關閉10046事件
oradebug tracefile_name --查看tracefile檔案位置及檔案名稱

4> 用oradebug做oracle process級10046
oradebug setorapid
oradebug unlimit
oradebug event 10046 trace name context forever ,level 4
oradebug event 10046 trace name context off
oradebug tracefile_name

5> oradebug系統hang住原因分析
如果系統HANG住,只要sys使用者可以登陸,那麼用oradebug做原因分析是非常有用的
oradebug setmypid
oradebug unlimit
oradebug setinst all --RAC環境
oradebug hanganalyze 3 -- 層級一般指定為3足夠了
oradebug -g def dump systemstate 10 --RAC環境
oradebug tracefile_name

6> 擷取某進程的狀態資訊
oradebug setospid 22180
oradebug dump processstate 10
oradebug tracefile_name

7> 擷取進程錯誤資訊狀態
oradebug setospid 22180
oradebug dump errorstack 3

8> 追蹤造成錯誤資訊的原因,如ORA-04031
oradebug event 4031 trace name errorstack level 3

9> 跟蹤oracle進程範例:
oradebug setorapid 120
oradebug unlimit
oradebug event 10046 trace name context forever ,level 4
oradebug event 10046 trace name context off
oradebug tracefile_name

 

oracle之 oradebug 命令用法

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.