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/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- oradebug的使用說明
- oracle oradebug使用詳解Oracle
- oracle orapwd使用說明Oracle
- wc 命令使用說明
- ORACLE EVENT && ORADEBUGOracle
- Oracle Latch 說明Oracle
- 【ROWID】Oracle rowid說明Oracle
- Linux: yum 命令說明Linux
- linux常見命令說明Linux
- 使用說明
- ABAP-BITMAP的命令引數的使用說明
- Oracle Table建立引數說明Oracle
- Oracle 官方文件 結構說明Oracle
- 【ORACLE】Oracle常用SQL及重點功能說明OracleSQL
- Linux sed命令詳細說明Linux
- FreeSql 使用說明SQL
- postman 使用說明Postman
- QLExpress使用說明Express
- WebApiClientCore使用說明WebAPIclient
- Jupiter 使用說明
- certbot 使用說明
- cmake使用說明
- ApplicationContextAware使用說明APPContext
- 【Datapump】Oracle資料泵遷移資料命令參考(expdp/impdp說明)Oracle
- RU 和 RUR oracle補丁說明Oracle
- 【NETWORK】Oracle RAC 心跳地址配置說明Oracle
- axios使用說明書iOS
- JPA EntityManager使用說明
- markdown使用小說明
- 【MEMORY】Oracle 共享池堆簡單說明Oracle
- 【UNDO】Oracle系統回滾段說明Oracle
- 【TABLESPACE】Oracle 表空間結構說明Oracle
- 【PDB】Oracle 建立pdb說明(create pluggable database)OracleDatabase
- MySQL EXPLAIN命令的主要專案說明MySqlAI
- linux 常見命令及說明雜記Linux
- LightDB常用備份恢復命令說明
- C# BitmapData使用說明C#
- jarsigner 簡單使用說明JAR
- OpenGrok簡單使用說明