oracle实用工具:oradebug
1 oradebug介绍
oradebug主要是给oracle支持人员使用的,尽管很早便有,但oracle官网很少有记载。他是个sql*plus命令行工具,有sysdba的权限就可以登入,无需特别设置。他可以被用于:
1)追踪进程,或者是你的,或者是外部的
2)确定进程往哪个trc文件写
3)转储:数据文件头、内部oracle结构等
4)挂起进程,暂时的 www.2cto.com
5)确定实例使用了哪些共享内存块和信号量
6)找出RAC实例使用了哪些互联地址和协议
7)修改SGA中的数据结构
2 oradebug使用步骤
1)启动sql*plus并以sysdba身份登入
2)连接到一个进程
3)设置一个事件或者进行诊断转储
4)检索trc文件名
5)与连接到的进程断开
3 oradebug命令介绍
[sql]
sys@ORCL> oradebug help
HELP [command] Describe one or all commands
SETMYPID Debug current process
SETOSPID Set OS pid of process to debug
SETORAPID ['force'] Set Oracle pid of process to debug
SHORT_STACK Dump abridged OS stack
DUMP [addr] Invoke named dump
DUMPSGA [bytes] Dump fixed SGA www.2cto.com
DUMPLIST Print a list of available dumps
EVENT Set trace event in process
SESSION_EVENT Set trace event in session
DUMPVAR
DUMPTYPE Print/dump an address with type info
SETVAR
PEEK [level] Print/Dump memory
POKE Modify memory
WAKEUP Wake up Oracle process
SUSPEND Suspend execution
RESUME Resume execution
FLUSH Flush pending writes to trace file
CLOSE_TRACE Close trace file
TRACEFILE_NAME Get name of trace file
LKDEBUG Invoke global enqueue service debugger
NSDBX Invoke CGS name-service debugger
-G Parallel oradebug command prefix
-R Parallel oradebug prefix (return output
SETINST Set instance list in double quotes
SGATOFILE Dump SGA to file; dirname in double quotes
DMPCOWSGA Dump & map SGA as COW; dirname in double quotes
MAPCOWSGA Map SGA as COW; dirname in double quotes
HANGANALYZE [level] [syslevel] Analyze system hang
FFBEGIN Flash Freeze the Instance
FFDEREGISTER FF deregister instance from cluster
FFTERMINST Call exit and terminate instance
FFRESUMEINST Resume the flash frozen instance
FFSTATUS Flash freeze status of instance
SKDSTTPCS Helps translate PCs to names
WATCH Watch a region of memory
DELETE watchpoint Delete a watchpoint
SHOW watchpoints Show watchpoints
CORE Dump core without crashing process
IPC Dump ipc information
UNLIMIT Unlimit the size of the trace file
PROCSTAT Dump process statistics
CALL [arg1] ... [argn] Invoke function with arguments
4 连接到一个进程
在oradebug命令执行之前,你必须加入一个目标进程。这个目标进程有如下3种情况:
命令
目的 www.2cto.com
oradebug setmypid
连接到为你的sql*plus提供服务的进程
oradebug setorapid pid
连接到一个外部服务进程,且pid=v$process.pid
oradebug setospid spid
连接到