TA的每日心情 | 开心 2023-8-9 11:05 |
---|
|
Heap Dumps Interpreting HeapDumps Note:35084.1
~~~~~~~~~~ Dump subheap by ADDR Event:HEAPDUMP_ADDR
You need to make sure that the database has been started with a very large
MAX_DUMP_FILE_SIZE or trace files may get truncated. Also ensure the
DUMP_DEST parameters point to where there is LOTS of disk space.
Levels (use the relevant level in the examples below as <LEVEL>)
~~~~~~
Warning: 'WITH CONTENTS' dumps a hex dump of each chunk of memory in
the heap. (not a good idea for the SGA)
* 9205 onwards: As 8.0 onwards below but you can add in:
0x10000000 (268435456) to also dump the 5 largest subheaps.
0x20000000 (536870912) to also dump the 5 largest subheaps
AND the 5 largest within each of those.
eg: 0x10000001 would dump PGA and its 5 largest subheaps.
You need the low order bit/s to say what to dump.
* 8.0 onwards: This is a BITWISE flag: Notification: 8.0 differs from 7.3
Heap Level With Contents
~~~~ Hex Dec Hex Dec
top PGA 0x01 1 0x401 1025
top SGA 0x02 2 0x802 2050
top UGA 0x04 4 0x1004 4100
Current call 0x08 8 0x2008 8200
User call 0x10 16 0x4010 16400
Large Pool 0x20 32 0x8020 32800
Streams Pool 0x40 64 0x10040 65600 * 10g+ only
Java Pool 0x80 128 0x20080 131200 * 10g+ only
* 7.3 onwards: This is a BITWISE flag:
Heap Level With Contents
~~~~ Hex Dec Hex Dec
top PGA 0x01 1 0x21 33
top SGA 0x02 2 0x42 66
top UGA 0x04 4 0x84 132
Current call 0x08 8 0x108 264
User call 0x10 16 0x210 528
To dump sub-heaps in 7.3 first dump the relevant top heap then see
Event:HEAPDUMP_ADDR
* Pre 7.3: (Bits cannot be OR'ed)
Heap Level With Contents
~~~~ Hex Dec Dec
top PGA 0x03 3 1000000003
top SGA 0x01 1 1000000001
top UGA 0x02 2 1000000002
top call 0x04 4 1000000004
OTHER is address of heap to dump
To Dump a Heap:
~~~~~~~~~~~~~~~
*SQL Session:
alter session set events 'immediate trace name heapdump level <LEVEL>';
*Dump HEAPDUMP on a given error:
In init.ora: Eg: event="4031 trace name HEAPDUMP level 2"
In session: Eg: alter session set events '4031 trace name HEAPDUMP level 2';
*To dump another processes HEAP (UGA etc..):
Find the process ID / name of the process you need to dump
(select SPID ,pid,username,program from v$process where ... )
*SQLPLUS (8.0+ generic)
$ sqlplus /nolog
connect / as sysdba
oradebug setospid <process ID>
oradebug unlimit
oradebug dump heapdump <LEVEL>
*Server Manager (7.3+ generic) Note:29786.1
$ svrmgrl
connect internal
oradebug setospid <process ID>
oradebug unlimit
oradebug dump heapdump <LEVEL>
*ORADBX (Unix): Note:28863.1
$ oradbx
(oradbx) debug <process ID>
(oradbx) unlimit trace
(oradbx) event immediate trace name heapdump level <LEVEL>
(oradbx) exit
Additional Notes
~~~~~~~~~~~~~~~~
For memory growth / leak type issues it can be helpful to
have the instance running with Event:10235 set at level 65536.
This level causes KGH memory allocations for PERM space to
include comments against each allocation where possible.
The comments show as "cprm" chunks under the "perm" chunks
in the PERMANENT section of the heapdump.
It can also be helpful, where present, to add 0x20000000 to
the level so that largest subheaps are also dumped.
|
|