--Fixed Memory structrue    
Global Area
*.Fixed SGA:
The structure of the fixed SGA is externalised in X$KSMFSV;
SELECT
        SUBSTR (ksmfsnam,1,20) AS "Name",
        SUBSTR (ksmfstyp,1,20) AS "Type",
        ksmfsadr AS "Address",
        ksmfssiz AS "Size"
    FROM x$ksmfsv 
*.Fixed PGA


The following command can be used to dump the global area 

    ALTER SESSION SET EVENTS 'immediate trace name global_area level level';
Levels are (bitmask)

Level Description 
1 Include PGA     --Fixed PAG(供后台进程使用的? 因为pga因该是Serverprocess_mem+userprocess_mem,select * from v$process_memory_detail(SMON))
2 Include SGA     --Fixed SGA(安装时创建编译号,作为bootsrap启动,包括指向SGA的其他组件Oracle内部使用select * from bootstrap$;)
4 Include UGA 
8 Include indirect memory dumps 
More detail is included at levels 0x08 0x10 0x18 (OR)          level8,16,24

--Variable Memory structure
Dump of heapdump
SGA,PGA,UGA

, 


*.shard pool
row_cache
library_cache
uga

*.buffer cache
buffers
buffer




An error stack describes the current state of a process. It includes the current SQL statement and the process state for the process.

heapdump level 1(pga 参照oradebug书)
select * from V$process_deail_memory(默认是SMON的Fixed PGA)

Buffer Cache Dumps:
       *.Multiple Buffers
       To dump buffer headers and buffer contents for buffers currently in the cache 
       
           ALTER SESSION SET EVENTS 'immediate trace name buffers level level';
       where level is one of the following 
       
       
       Level Description 
       1 Buffer headers only 
       2 Level 1 + block headers 
       3 Level 2 + block contents 
       4 Buffer headers only + hash chain 
       5 Level 1 + block headers + hash chain 
       6 Level 2 + block contents + hash chain 
       8 Buffer headers only + hash chain + users/waiters 
       9 Level 1 + block headers + hash chain + users/waiters 
       10 Level 2 + block contents + hash chain + users/waiters 
Individual Buffers
In Oracle 8.0 and above is is possible to dump buffer all buffers currently in the cache for a specific block 

For example where a block has been modified and is subject to consistent read from a number of transactions, there may be more than one copy of the block in the buffer cache 

First identify the tablespace number for the block e.g for tablespace TS01 

    SELECT ts# FROM sys.ts$
    WHERE name = 'TS01';
Set the tablespace number using 

    ALTER SESSION SET EVENTS 
    'immediate trace name set_tsn_p1 level level';
where level is the tablespace number + 1 

Identify the relative DBA for the block