1 oradebug介紹
oradebug主要是給Oracle技術服務人員使用的,儘管很早便有,但oracle官網很少有記載。他是個sql*plus命令列工具,有sysdba的許可權就可以登入,無需特別設定。他可以被用於:
1)追蹤進程,或者是你的,或者是外部的
2)確定進程往哪個trc檔案寫
3)轉儲:資料檔案頭、內部oracle結構等
4)掛起進程,暫時的
5)確定執行個體使用了哪些共用記憶體塊和訊號量
6)找出RAC執行個體使用了哪些互聯地址和協議
7)修改SGA中的資料結構
2 oradebug使用步驟
1)啟動sql*plus並以sysdba身份登入
2)串連到一個進程
3)設定一個事件或者進行診斷轉儲
4)檢索trc檔案名稱
5)與串連到的進程斷開
3 oradebug命令介紹
- sys@ORCL> oradebug help
- HELP [command] Describe one or all commands
- SETMYPID Debug current process
- SETOSPID <ospid> Set OS pid of process to debug
- SETORAPID <orapid> ['force'] Set Oracle pid of process to debug
- SHORT_STACK Dump abridged OS stack
- DUMP <dump_name> <lvl> [addr] Invoke named dump
- DUMPSGA [bytes] Dump fixed SGA
- DUMPLIST Print a list of available dumps
- EVENT <text> Set trace event in process
- SESSION_EVENT <text> Set trace event in session
- DUMPVAR <p|s|uga> <name> [level] Print/dump a fixed PGA/SGA/UGA variable
- DUMPTYPE <address> <type> <count> Print/dump an address with type info
- SETVAR <p|s|uga> <name> <value> Modify a fixed PGA/SGA/UGA variable
- PEEK <addr> <len> [level] Print/Dump memory
- POKE <addr> <len> <value> Modify memory
- WAKEUP <orapid> 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 <Inst-List | def | all> Parallel oradebug command prefix
- -R <Inst-List | def | all> Parallel oradebug prefix (return output
- SETINST <instance# .. | all> Set instance list in double quotes
- SGATOFILE <SGA dump dir> Dump SGA to file; dirname in double quotes
- DMPCOWSGA <SGA dump dir> Dump & map SGA as COW; dirname in double quotes
- MAPCOWSGA <SGA dump dir> 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 <ifname> <ofname> Helps translate PCs to names
- WATCH <address> <len> <self|exist|all|target> Watch a region of memory
- DELETE <local|global|target> watchpoint <id> Delete a watchpoint
- SHOW <local|global|target> 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 <func> [arg1] ... [argn] Invoke function with arguments