Archive for 一月, 2009

oracle block type

星期二, 一月 6th, 2009

 

http://www.ixora.com.au/notes/cache_block_types.htm

Code Block Type Versions
1 Undo header block (limited extents) all, but superseded by type 14 from 8.0
2 Undo data block all
3 Save undo header block (limited extents) all, but superseded by type 15 from 8.0
4 Save undo data block all
5 Data segment header block (limited extents, no freelist groups) all, but superseded by type 16 from 8.0
6 Table/cluster/index segment data block all
7 Temporary segment data block all
8 Sort key block all
9 Sort run block all
10 Free list block all, but superseded by type 22 from 8.0
11 Data file header block all
12 Data segment header block (limited extents, with freelist groups) all, but superseded by type 17 from 8.0
13 Compatibility segment all
14 Undo header block (unlimited extents) from 7.3
15 Save undo header block (unlimited extents) from 7.3
16 Data segment header block (unlimited extents, no freelist groups) from 7.3
17 Data segment header block (unlimited extents, with freelist groups) from 7.3
18 Extent map block from 7.3
19 Backup set piece header from 8.0
20 Backup set directory block from 8.0
21 Controlfile block from 8.0
22 Free list block with free block count from 8.0
23 LOB segment header block from 8.0
24 LOB segment freelist block from 8.0
25 LOB segment space usage index block from 8.0
26 LOB segment space usage bitmap block from 8.0
27 LOB segment chunk data block from 8.0
28 don’t know  
29 LMT space map header block from 8.1
30 LMT space map block from 8.1
31 don’t know  
32 ASSM level 1 bitmap block from 9.0
33 ASSM level 2 bitmap block from 9.0
34 ASSM level 3 bitmap block from 9.0
35 ASSM segment header block from 9.0
36 ASSM extent map block from 9.0
37 don’t know  
38 System managed undo header block from 9.0

6 table/index /cluster segment datablock

BBED> p kcbh
struct kcbh, 20 bytes                       @0      
   ub1 type_kcbh                            @0        0×06
   ub1 frmt_kcbh                            @1        0xa2
   ub1 spare1_kcbh                          @2        0×00
   ub1 spare2_kcbh                          @3        0×00
   ub4 rdba_kcbh                            @4        0×0100001d
   ub4 bas_kcbh                             @8        0×00051a80
   ub2 wrp_kcbh                             @12       0×0000
   ub1 seq_kcbh                             @14       0×01
   ub1 flg_kcbh                             @15       0×06 (KCBHFDLC, KCBHFCKV)
   ub2 chkval_kcbh                          @16       0xa7c0
   ub2 spare3_kcbh                          @18       0×0000

11 Data file header block

BBED> p kcvfh
struct kcvfh, 676 bytes                     @0      
   struct kcvfhbfh, 20 bytes                @0      
      ub1 type_kcbh                         @0        0×0b
      ub1 frmt_kcbh                         @1        0xa2
      ub1 spare1_kcbh                       @2        0×00
      ub1 spare2_kcbh                       @3        0×00
      ub4 rdba_kcbh                         @4        0×01000001
      ub4 bas_kcbh                          @8        0×00000000
      ub2 wrp_kcbh                          @12       0×0000
      ub1 seq_kcbh                          @14       0×01
      ub1 flg_kcbh                          @15       0×04 (KCBHFCKV)
      ub2 chkval_kcbh                       @16       0×35e7
      ub2 spare3_kcbh                       @18       0×0000

block structure

星期天, 一月 4th, 2009

block

 

BBED> show

        FILE#           4

        BLOCK#          29

        OFFSET          0

        DBA             0×0100001d (16777245 4,29)

        FILENAME        /u02/boson/users01.dbf

        BIFILE          bifile.bbd

        LISTFILE        /home/oracle/file_nls.log

        BLOCKSIZE       8192

        MODE            Edit

        EDIT            Unrecoverable

        IBASE           Dec

        OBASE           Dec

        WIDTH           80

        COUNT           512

        LOGFILE         log.bbd

        SPOOL           No

 

 

 

BBED> p kcbh;(块头,总共20字节)

struct kcbh, 20 bytes                       @0      

   ub1 type_kcbh                            @0        0×06 trans data

   ub1 frmt_kcbh                            @1        0xa2 (8K的块,REDO0×22)

   ub1 spare1_kcbh                          @2        0×00

   ub1 spare2_kcbh                          @3        0×00   (以上两个已经不在使用)

   ub4 rdba_kcbh                            @4        0×0100001d (0×0100001d (4/29),文件429

   ub4 bas_kcbh                             @8        0×000457fe BASE OF SCN)

   ub2 wrp_kcbh                             @12       0×0000      (WRAP OF SCN)

   ub1 seq_kcbh                             @14       0×01        sequence # of changes at same scn */

   ub1 flg_kcbh                             @15       0×04 (KCBHFCKV)

   ub2 chkval_kcbh                          @16       0×0d7d

   ub2 spare3_kcbh                          @18       0×0000

flg_kcbh:

define KCBHFNEW 0×01 /* new block - zeroed data area */

#define KCBHFDLC 0×02 /* Delayed Logging Change advance SCN/seq */

#define KCBHFCKV 0×04 /* ChecK Value saved-block xor’s to zero */

#define KCBHFTMP 0×08 /* Temporary block */

这是一个可以组合的值 也就是说有为 6 的时候是 2,4 两种情况的组合

 

  (全文…)