来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/9240380/viewspace-1820305/,如需转载,请注明出处,否则将追究法律责任。
DUMPTYPE
SETVAR
PEEK
POKE
WAKEUP
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
-R
SETINST
SGATOFILE
DMPCOWSGA
MAPCOWSGA
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
WATCH
DELETE
SHOW
DIRECT_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]
SQL>
3,oradebug dumplist显示所有的dump,dump就是可以实时获取当行某些操作的一些动态执行信息,便于分析这个操作或对象的,进而进一步进行诊断
从dumplist显示结果而言,可以大致进行分类,有基于buffer cache,block,redo header,heap dump,rac css各种用途,可见oradebug强大相当牛比
SQL> oradebug dumplist
TRACE_BUFFER_ON
TRACE_BUFFER_OFF
LATCHES --latches哈哈
PROCESSSTATE --processstat
SYSTEMSTATE --systemstate
INSTANTIATIONSTATE
REFRESH_OS_STATS
CROSSIC
CONTEXTAREA
HANGDIAG_HEADER
HEAPDUMP --heapdump,heap就是存储对象的堆
HEAPDUMP_ADDR
POKE_ADDRESS --poke
POKE_LENGTH
POKE_VALUE
POKE_VALUE0
GLOBAL_AREA
REALFREEDUMP
FLUSH_JAVA_POOL
POOL_SIMULATOR --pga
PGA_DETAIL_GET
PGA_DETAIL_DUMP
PGA_DETAIL_CANCEL
PGA_SUMMARY
MODIFIED_PARAMETERS
EVENT_TSM_TEST
ERRORSTACK ---errorstack
CALLSTACK --callstack
TEST_STACK_DUMP
TEST_GET_CALLER
RECORD_CALLSTACK
EXCEPTION_DUMP
BG_MESSAGES
ENQUEUES --enqueues
KSTDUMPCURPROC
KSTDUMPALLPROCS
KSTDUMPALLPROCS_CLUSTER
SIMULATE_EOV
KSFQP_LIMIT
KSKDUMPTRACE
DBSCHEDULER
LDAP_USER_DUMP
LDAP_KERNEL_DUMP
DUMP_ALL_OBJSTATS
DUMPGLOBALDATA
HANGANALYZE --hanganalyze
HANGANALYZE_PROC --hanganalyze_proc
HANGANALYZE_GLOBAL --hanganalyze_global
GES_STATE --ges_state
OCR --ocr
CSS --css
CRS --crs
SYSTEMSTATE_GLOBAL
GIPC --related rac
MMAN_ALLOC_MEMORY --mman
MMAN_CREATE_DEF_REQUEST
MMAN_CREATE_IMM_REQUEST
MMAN_IMM_REQUEST
DUMP_ALL_COMP_GRANULE_ADDRS
DUMP_ALL_COMP_GRANULES
DUMP_ALL_REQS
DUMP_TRANSFER_OPS
DUMP_ADV_SNAPSHOTS
ADJUST_SCN --adjust scn,相当重要,推进SCN
NEXT_SCN_WRAP
CONTROLF--控制文件
FLUSH_CACHE --刷新缓冲池
FULL_DUMPS
BUFFERS
RECOVERY --恢复
SET_TSN_P1
BUFFER
PIN_BLOCKS --pin block
BC_SANITY_CHECK
PIN_RANDOM_BLOCKS
SET_NBLOCKS
CHECK_ROREUSE_SANITY
DUMP_PINNED_BUFFER_HISTORY --dump pinned buffer history
KCBO_OBJ_CHECK_DUMP
KCB_WORKING_SET_DUMP
REDOLOGS --redo logs
ARCHIVE_ERROR --archive errors
LOGHIST
REDOHDR --redo header
LOGERROR
OPEN_FILES
DATA_ERR_ON
DATA_READ_ERR_ON
DATA_ERR_OFF
BLK0_FMTCHG
UPDATE_BLOCK0_FORMAT ---update block format
TR_SET_BLOCK --tr
TR_SET_ALL_BLOCKS
TR_SET_SIDE
TR_CRASH_AFTER_WRITE
TR_READ_ONE_SIDE
TR_CORRUPT_ONE_SIDE
TR_RESET_NORMAL
TEST_DB_ROBUSTNESS
LOCKS --lock
GC_ELEMENTS --gc_elements
FILE_HDRS ---file header
KRB_CORRUPT_INTERVAL ---krb
KRB_CORRUPT_SIZE
KRB_CORRUPT_REPEAT
KRB_CORRUPT_OFFSET
KRB_PIECE_FAIL
KRB_OPTIONS
KRB_FAIL_INPUT_FILENO
KRB_SIMULATE_NODE_AFFINITY
KRB_TRACE
KRB_BSET_DAYS
KRB_SET_TIME_SWITCH
KRB_OVERWRITE_ACTION
KRB_CORRUPT_SPHEADER_INTERVAL
KRB_CORRUPT_SPHEADER_REPEAT
KRB_CORRUPT_SPBITMAP_INTERVAL
KRB_CORRUPT_SPBITMAP_REPEAT
KRB_CORRUPT_SPBAD_INTERVAL
KRB_CORRUPT_SPBAD_REPEAT
KRB_UNUSED_OPTION
KRBMRSR_LIMIT
KRBMROR_LIMIT
KRBABR_TRACE
KRDRSBF
KRC_TRACE
KRA_OPTIONS
KRA_TRACE
FBTAIL
FBINC
FBHDR
FLASHBACK_GEN
KTPR_DEBUG
DUMP_TEMP --dump temp
DROP_SEGMENTS --drop segment
TEST_SPACEBG
TREEDUMP --treedump ,for index
LONGF_CREATE
KDLIDMP
ROW_CACHE --row cache
LIBRARY_CACHE --library cache
LIBRARY_CACHE_OBJECT --library cache object
CURSORDUMP --cursor dump
CURSORTRACE --cursor trace
CURSOR_STATS --cursor state
XS_SESSION_STATE
SHARED_SERVER_STATE
LISTENER_REGISTRATION --listener registion
JAVAINFO
KXFPCLEARSTATS ---kxf
KXFPDUMPTRACE
KXFPBLATCHTEST
KXFXSLAVESTATE
KXFXCURSORSTATE
KXFRHASHMAP
WORKAREATAB_DUMP
KUPPLATCHTEST
OBJECT_CACHE --object cache
SAVEPOINTS
RULESETDUMP
RULESETDUMP_ADDR
FAILOVER
OLAP_DUMP
SELFTESTASM
ASMDISK_ERR_ON --asm
ASMDISK_READ_ERR_ON
ASMDISK_ERR_OFF
IOERREMUL
IOERREMULRNG
ALRT_TEST --alert
AWR_TEST --awr
AWR_FLUSH_TABLE_ON
AWR_FLUSH_TABLE_OFF
ASHDUMP ---ash
MMON_TEST --mmon
ATSK_TEST
HM_FW_TRACE
HM_FDG_VERS
IR_FW_TRACE
KSDTRADV_TEST
4,dump命令可以用上述dumplist指定的dump进行针对性的分析,也就是说学习要分类
SQL> oradebug help dump
DUMP
SQL>
我们以row_cache为例进行测试,一为了解命令用法,二了解如何深入掌握dumplist不同的dump的含义及用途,这是最重要的价值
SQL> oradebug setmypid
Statement processed.
SQL> oradebug dump row_cache 2;
Statement processed.
SQL> oradebug tracefile_name
/oracle/diag/rdbms/guowang/guowang/trace/guowang_ora_23113.trc
SQL>
摘取部分上述TRC文件内容,可见row cache也是采用hash table,和library cache相同,更一步引申,也就是说通过oradebug dump row_cache 2可以深入研究row cache的构成及原理
可以解决一些与row cache相关的故障或性能问题,这才是我们学习它的目的
ROW CACHE HASH TABLE: cid=35 ht=0xd5a624c0 size=512
Buckets with more than 20 objects:
NONE
Hash Chain Size Number of Buckets
--------------- -----------------
0 512
1 0
2 0
3 0
4 0
5 0
6 0
7 0
8 0
9 0
10 0
11 0
12 0
13 0
14 0
再看另一个dump,我们以poke_address为例
但是我们不知这个poke_address的含义是什么,但从oracebug help可知,里面有个poke命令,从字面上联系,我感觉poke_address与poke有关
所以我们先看看poke
SQL> oradebug dump poke_address
ORA-00073: command DUMP takes between 2 and 3 argument(s)
SQL>
--可见poke是修改内存内容的
SQL> oradebug help poke
POKE
那么既然要修改内存内容,我们先要确认内存地址,如下以LATCH地址为例
SQL> select addr,latch#,name from v$latch where rownum=1;
ADDR LATCH# NAME
---------------- ---------- --------------------------------------------------
0000000060001008 0 PC and Classifier lists for WLM
我想到,即使poke是修改内存内容,肯定有查看内存内容的,经查帮助手册,可知是peek
SQL> oradebug help peek
PEEK
我们就用peek查看下指定内存地址的内容,可见len是指定显示内存中的长度,它是字度的宽度,即多少个字节,可见每个部分(即用空格分割的8位十六进制数)4个字节,即每2个数字代表1个字节
SQL> oradebug setmypid
Statement processed.
SQL> oradebug peek 60001008 1
[003938AF0, 003938AF4) = 40958B4C
SQL> oradebug peek 60001008 10
[003938AF0, 003938AFC) = 40958B4C 48FFFFFF
SQL> oradebug peek 60001008 12
[003938AF0, 003938AFC) = 40958B4C 48FFFFFF E910C483
SQL> oradebug peek 60001008 16
[003938AF0, 003938B00) = 40958B4C 48FFFFFF E910C483 FFFFFCCC
SQL> oradebug peek 60001008 18
[003938AF0, 003938B04) = 40958B4C 48FFFFFF E910C483 FFFFFCCC
SQL> oradebug peek 60001008 20
[003938AF0, 003938B04) = 40958B4C 48FFFFFF E910C483 FFFFFCCC 48D88949
可见level不同级别不影响显示内容,当然也可能是针对不同的dump的level级别会有区别
SQL> oradebug peek 60001008 20
[003938AF0, 003938B04) = 40958B4C 48FFFFFF E910C483 FFFFFCCC 48D88949
SQL> oradebug peek 60001008 20 1
[003938AF0, 003938B04) = 40958B4C 48FFFFFF E910C483 FFFFFCCC 48D88949
SQL> oradebug peek 60001008 20 2
[003938AF0, 003938B04) = 40958B4C 48FFFFFF E910C483 FFFFFCCC 48D88949
SQL> oradebug peek 60001008 20 10
[003938AF0, 003938B04) = 40958B4C 48FFFFFF E910C483 FFFFFCCC 48D88949
SQL>
我们修改上述的指定latch的地址的内容,然后显示
SQL> oradebug peek 60001008 1
[003938AF0, 003938AF4) = 40958B4C
SQL> oradebug help poke
POKE
SQL> oradebug poke 0x0000000060001008 4 88888888
BEFORE: [060001008, 06000100C) = 00000000
AFTER: [060001008, 06000100C) = 054C5638
使用peek显示poke修改后的内存内容
SQL> oradebug peek 0x0000000060001008 4
[060001008, 06000100C) = 054C5638
SQL>
使用poke_address
SQL> oradebug dump poke_address 60001008 2
Statement processed.
SQL> oradebug tracefile_name
/oracle/diag/rdbms/guowang/guowang/trace/guowang_ora_25629.trc
摘录相关TRC文件,没看到有价值的内容,表明还没有搞清楚oradebug dump poke_address的含义是什么
*** 2015-10-31 01:44:20.104
Oradebug command 'poke 0x0000000060001008 4 88888888' console output:
BEFORE: [060001008, 06000100C) = 00000000
AFTER: [060001008, 06000100C) = 054C5638
*** 2015-10-31 01:45:18.106
Processing Oradebug command 'peek 60001008 1'
*** 2015-10-31 01:45:18.106
Oradebug command 'peek 60001008 1' console output:
[003938AF0, 003938AF4) = 40958B4C
*** 2015-10-31 01:46:41.610
Processing Oradebug command 'dump poke_address 60001008'
*** 2015-10-31 01:46:41.744
Error while executing Oradebug command 'dump poke_address 60001008':
ORA-00073: command POKE_ADDRESS takes between 2 and 2 argument(s)
我们换个思路,再看有关联的poke_length,仍然TRC文件没有有价值的内容
SQL> oradebug dump poke_length 3
Statement processed.
SQL> oradebug tracefile_name
/oracle/diag/rdbms/guowang/guowang/trace/guowang_ora_25629.trc
把poke修改内存后的内容回退回去,记得以before为基础
SQL> oradebug poke 0x0000000060001008 4 0x00000000
BEFORE: [060001008, 06000100C) = 054C5638
AFTER: [060001008, 06000100C) = 00000000
SQL>
SQL>
SQL> oradebug peek 0x0000000060001008 4
[060001008, 06000100C) = 00000000
再看看pin_blocks
SQL> oradebug dump pin_blocks 1
Statement processed.
SQL> oradebug tracefile_name
/oracle/diag/rdbms/guowang/guowang/trace/guowang_ora_26147.trc
个人简介:
项目经验:
查看上述的trc文件,有ORA-600报错信息
*** 2015-10-31 02:03:12.228
Incident 261392 created, dump file: /oracle/diag/rdbms/guowang/guowang/incident/incdir_261392/guowang_ora_26147_i261392.trc
ORA-00600: internal error code, arguments: [kssadf_numa: null parent], [], [], [], [], [], [], [], [], [], [], []
Force pin got error 600 for 4194306
转载于:http://blog.itpub.net/9240380/viewspace-1820305/