本文共 1636 字,大约阅读时间需要 5 分钟。
0> oradebug使用步骤
1)启动sql*plus并以sysdba身份登入 2)连接到一个进程 3)设置一个事件或者进行诊断转储 4)检索trc文件名 5)与连接到的进程断开 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
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/31383567/viewspace-2143669/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/31383567/viewspace-2143669/