oradehub命令

1> oradebug有哪些可用命令?

以sysdba身份登陆数据库,通过oradebug help可以看到oradebug常用命令

sqlplus / as sysdba

oradebug help

2> 跟踪当前会话信息

oradebug setmypid --跟踪当前会话

oradebug setospid --跟踪系统进程

oradebug setorapid --跟踪ORACLE进程

oradebug unlimit --取消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

posted @ 2019-12-13 15:00  Warden_king  阅读(173)  评论(0编辑  收藏  举报