Oracle oradebug命令使用說明
一,Oradebug 命令 幫助文件
SQL> 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
SETORAPNAME Set Oracle process name to debug
SHORT_STACK Get abridged OS stack--查詢系統記憶體堆疊
CURRENT_SQL Get current SQL
DUMP [addr] Invoke named dump
DUMPSGA [bytes] Dump fixed SGA
DUMPLIST Print a list of available dumps
EVENT Set trace event in process
SESSION_EVENT Set trace event in session
DUMPVAR [level] Print/dump a fixed PGA/SGA/UGA variable
DUMPTYPE
Print/dump an address with type info
SETVAR Modify a fixed PGA/SGA/UGA variable
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
DIRECT_ACCESS Fixed table access
CORE Dump core without crashing process
IPC Dump ipc information
UNLIMIT Unlimit the size of the trace file
PROCSTAT Dump process statistics
CALL [-t count] [arg1]...[argn] Invoke function with arguments
二, 跟蹤當前會話資訊
oradebug setmypid --跟蹤當前會話
oradebug setospid --跟蹤系統程式
oradebug setorapid --跟蹤ORACLE程式
oradebug unlimit --取消trace檔案大小限制
oradebug tracefile_name --檢視trace檔名及位置
三,用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檔案位置及檔名
四, 用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
五,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
六,獲取某程式的狀態資訊
oradebug setospid 22180
oradebug dump processstate 10
oradebug tracefile_name
七,獲取程式錯誤資訊狀態
oradebug setospid 22180
oradebug dump errorstack 3
八, 追蹤造成錯誤資訊的原因,如ORA-04031
oradebug event 4031 trace name errorstack level 3
九,例項:
sqlplus / as sysdba
SQL> oradebug setmypid
Statement processed.
SQL> oradebug hanganalyze 3
等1-2分鐘
SQL>oradebug hanganalyze 3
等1-2分鐘
SQL> oradebug tracefile_name
Hang Analysis in /usr/app/oracle/admin/ora10g/bdump/ora10g1_diag_7056.trc
SQL> exit
SQL> 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
SETORAPNAME Set Oracle process name to debug
SHORT_STACK Get abridged OS stack--查詢系統記憶體堆疊
CURRENT_SQL Get current SQL
DUMP [addr] Invoke named dump
DUMPSGA [bytes] Dump fixed SGA
DUMPLIST Print a list of available dumps
EVENT Set trace event in process
SESSION_EVENT Set trace event in session
DUMPVAR [level] Print/dump a fixed PGA/SGA/UGA variable
DUMPTYPE
Print/dump an address with type info
SETVAR Modify a fixed PGA/SGA/UGA variable
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
DIRECT_ACCESS Fixed table access
CORE Dump core without crashing process
IPC Dump ipc information
UNLIMIT Unlimit the size of the trace file
PROCSTAT Dump process statistics
CALL [-t count] [arg1]...[argn] Invoke function with arguments
二, 跟蹤當前會話資訊
oradebug setmypid --跟蹤當前會話
oradebug setospid --跟蹤系統程式
oradebug setorapid --跟蹤ORACLE程式
oradebug unlimit --取消trace檔案大小限制
oradebug tracefile_name --檢視trace檔名及位置
三,用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檔案位置及檔名
四, 用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
五,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
六,獲取某程式的狀態資訊
oradebug setospid 22180
oradebug dump processstate 10
oradebug tracefile_name
七,獲取程式錯誤資訊狀態
oradebug setospid 22180
oradebug dump errorstack 3
八, 追蹤造成錯誤資訊的原因,如ORA-04031
oradebug event 4031 trace name errorstack level 3
九,例項:
sqlplus / as sysdba
SQL> oradebug setmypid
Statement processed.
SQL> oradebug hanganalyze 3
等1-2分鐘
SQL>oradebug hanganalyze 3
等1-2分鐘
SQL> oradebug tracefile_name
Hang Analysis in /usr/app/oracle/admin/ora10g/bdump/ora10g1_diag_7056.trc
SQL> exit
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/25373498/viewspace-1836818/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Oracle oradebug 命令 使用說明Oracle
- wc 命令使用說明
- Oracle oradebug命令Oracle
- oracle orapwd使用說明Oracle
- mysql幫助命令使用說明MySql
- VI 命令簡易使用說明
- oracle之 oradebug 命令用法Oracle
- Oracle oradebug命令詳解Oracle
- dd命令說明
- Oracle OS Watcher使用說明Oracle
- goldengate常用命令使用說明Go
- linux的wget命令使用說明Linuxwget
- Memcached常用命令及使用說明
- Oracle RAC中Srvctl命令詳細說明(轉)Oracle
- ip 命令的說明
- lsof命令功能說明
- aix +oracle 記憶體使用說明AIOracle記憶體
- Oracle Audit 功能的使用和說明Oracle
- Oracle Latch 說明Oracle
- Oracle Namespace 說明Oraclenamespace
- Oracle 版本說明Oracle
- oracle oradebug使用詳解Oracle
- 使用Oradebug修改Oracle SCNOracle
- Linux: yum 命令說明Linux
- AIX errpt命令說明AI
- free命令的說明(ZT)
- Linux awk 命令 說明Linux
- 交換機配置命令說明
- ABAP-BITMAP的命令引數的使用說明
- linux系統vi命令詳細使用說明Linux
- WebApiClientCore使用說明WebAPIclient
- QLExpress使用說明Express
- postman 使用說明Postman
- Sqlite使用說明SQLite
- Oracle BBED 工具 說明Oracle
- ORACLE event和說明Oracle
- Oracle BBED 工具說明Oracle
- Oracle Logminer 說明Oracle