continued to ask me three questions
1、What's the meaning of an extent map purpose however of an extent map since we have BMB blocks which already cover many extents as you mentioned?
2、Do we have always an extent map for every table or only if we allocate more extents except the initial allocation during table creation?
3、I checked the buffer touch counts for the staging table in my application and I noticed that extent map is not loaded in the buffer cache. I am wondering why
The answers are:
1、Extent map blocks are used where the extent map can no longer fit within the segment header. Extent map blocks are extent maps that overflow when the extent map area in the segment header block is not large enough to describe all extents that are used by a segment. Extent maps are achieved by a linked list of blocks containing extent map portions.
Let's see an example:
adcbth and uplpdt are two tables both reside in ASSM tablespace.
uplpdt have four extent map blocks. However, adcbth desn't have any.
SQL> select count(*) from armshistemp.adcbth;
COUNT(*)
----------
367
SQL> select count(*) from armshistemp.uplpdt;
COUNT(*)
----------
6962716
SQL> select HEADER_FILE,HEADER_BLOCK from dba_segments where owner='ARMSHISTEMP' and segment_name='ADCBTH';
HEADER_FILE HEADER_BLOCK
----------- ------------
112 908
SQL> select HEADER_FILE,HEADER_BLOCK from dba_segments where owner='ARMSHISTEMP' and segment_name='UPLPDT';
HEADER_FILE HEADER_BLOCK
----------- ------------
111 12
BBED> set dba 112,908
DBA 0x
BBED> dump
File: /dras14/oradata/astca/armshistemptbs_02.dbf (112)
Block: 908 Offsets: 0 to 511 Dba:0x
------------------------------------------------------------------------
23020000
00000000 00000001 00000080
00000000 00000000 00000000
00000004 00000080
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00010000 00002000 00000000 00001434
00000000
00000000 00000000 00000001 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
<32 bytes per line>
BBED> set dba 111,12
DBA 0x1bc
BBED> dump
File: /dras14/oradata/astca/armshistemptbs_01.dbf (111)
Block: 12 Offsets: 0 to 511 Dba:0x1bc
------------------------------------------------------------------------
23020000 1bc
00000004 00000906 00048300
1ec3ef
00000080 00000080 1e443009 1ec3ef
1ec
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00010000 00002000 00000000 00001434
00000000 1bc0000b 00000001 1ec
00000000 00000000 00000133 1ec
1e430009 00000080 1e82fd89 00000080 1ec2fc89 00000080
1e430089 00000080 1e82fe09 00000080 1ec2fd09 00000080
1e430109 00000080 1e82fe89 00000080 1ec2fd89 00000080
1e430189 00000080 1e82ff09 00000080 1ec2fe09 00000080
1e430209 00000080 1e82ff89 00000080 1ec2fe89 00000080
1e430289 00000080 1e830009 00000080 1ec2ff09 00000080
1e430309 00000080 1e830089 00000080 1ec2ff89 00000080
<32 bytes per line>
So, for table adcbth, there is no Extent Map Block!because the last EMB's dba and the next EMB's dba are both 0x00000000.
But for table uplpdt,the last EMB's dba is 0x1ec3ef
Let's see those two EMBs plus another two EMBs:
BBED> set dba 0x1ec3ef
DBA 0x1ec3ef
BBED> dump
File: /dras21/astca/armshistemptbs_05.dbf (123)
Block: 257802 Offsets: 0 to 511 Dba:0x1ec3ef
------------------------------------------------------------------------
24020000 1ec3ef
40000000 1ec3ef09 00000080
00000080 1ec3ef89 00000080
00000080 1ec
00000080 1ec
00000080 1ec
00000080 1ec
00000080 1ec
00000080 1ec
00000080 1ec
00000080 1ec
00000080 1ec
00000080 1ec
00000080 1ec
00000080 1ec
00000080 1ec
<32 bytes per line>
BBED> set dba 0x1ec
DBA 0x1ec
BBED> dump
File: /dras21/astca/armshistemptbs_05.dbf (123)
Block: 206346 Offsets: 0 to 511 Dba:0x1ec
------------------------------------------------------------------------
24020000 1ec
40000000 1ec32609 00000080
00000080 1ec32709 00000080
00000080 1ec32789 00000080
00000080 1ec32809 00000080
00000080 1ec32889 00000080
00000080 1ec32909 00000080
00000080 1ec32989 00000080
00000080 1ec
00000080 1ec
00000080 1ec32b89 00000080
00000080 1ec
00000080 1ec
00000080 1ec32d09 00000080
00000080 1ec32d89 00000080
00000080 1ec32e09 00000080
<32 bytes per line>
BBED> set dba 0x1ec
DBA 0x1ec
BBED> dump
File: /dras21/astca/armshistemptbs_05.dbf (123)
Block: 225290 Offsets: 0 to 511 Dba:0x1ec
------------------------------------------------------------------------
24020000 1ec
40000000 1ec37009 00000080
00000080 1ec37089 00000080
00000080 1ec37109 00000080
00000080 1ec37189 00000080
00000080 1ec37209 00000080
00000080 1ec37289 00000080
00000080 1ec37309 00000080
00000080 1ec37389 00000080
00000080 1ec37409 00000080
00000080 1ec37489 00000080
00000080 1ec37509 00000080
00000080 1ec37589 00000080
00000080 1ec37609 00000080
00000080 1ec37689 00000080
00000080 1ec37709 00000080
<32 bytes per line>
BBED> set dba 0x1ec3af89
DBA 0x1ec3af89 (516140937 123,241545)
BBED> dump
File: /dras21/astca/armshistemptbs_05.dbf (123)
Block: 241545 Offsets: 0 to 511 Dba:0x1ec3af89
------------------------------------------------------------------------
24020000 1ec3af89 968d5057
40000000 1ec3af89 00000080
00000080 1ec3b009 00000080
00000080 1ec3b089 00000080
00000080 1ec3b109 00000080
00000080 1ec3b189 00000080
00000080 1ec3b209 00000080
00000080 1ec3b289 00000080
00000080 1ec3b309 00000080
00000080 1ec3b389 00000080
00000080 1ec3b409 00000080
00000080 1ec3b489 00000080
00000080 1ec3b509 00000080
00000080 1ec3b589 00000080
00000080 1ec3b609 00000080
00000080 1ec3b689 00000080
<32 bytes per line>
The first byte of those blocks are 0x24, means Pagetable extent map block.
From the dump contents of above four blocks, we can clearly see that those EMB are linked together.
If adcbth and uplpdt are reside in MSSM tablespace, then the first byte of those EMB blocks are 0x12,and you can track those EMB in MSSM by using ktemh struct in segment header block.
2、No. we don't always have EMB for every table. Extent map blocks are created where the extent map can no longer fit within the segment header.
3、You are right,EMB blocks are not loaded into the buffer cache nor dictionary cache, but I don't know why.
Your response was really excellent.
I really appreciated it. I still cannot figure out how did you know the exact location for extent map DBA inside the header block.
Thank you for sharing your knowledge with the oracle community
Warm Regards
kostas