eygle.com   eygle.com
eygle.com eygle
eygle.com  
 

« [招聘信息]-赛门铁克研发中心高级测试工程 | Blog首页 | 来吧来吧 我们一起去拉萨 »

数据字典视图之:V$TYPE_SIZE 结构

V$TYPE_SIZE视图用于记录和数据块容量有关的数据库组件的空间使用大小。

文档说明仅有一句话:V$TYPE_SIZE displays the sizes of various database components for use in estimating data block capacity。

这个视图依赖于X$KQFSZ建立,其语法为:
select inst_id,kqfszcom,kqfsztyp,kqfszdsc,kqfszsiz from x$kqfsz
KQFSZ的含义为:Kernel Data structure type [S]i[Z]es

这个视图的内容如下:

Connected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
With the Partitioning and Real Application Testing options

SQL> set linesize 120
SQL> select * from v$type_size;

COMPONEN TYPE     DESCRIPTION                       TYPE_SIZE
-------- -------- -------------------------------- ----------
S        EWORD    EITHER WORD                               4
S        EB1      EITHER BYTE 1                             1
S        EB2      EITHER BYTE 2                             2
S        EB4      EITHER BYTE 4                             4
S        UWORD    UNSIGNED WORD                             4
S        UB1      UNSIGNED BYTE 1                           1
S        UB2      UNSIGNED BYTE 2                           2
S        UB4      UNSIGNED BYTE 4                           4
S        SWORD    SIGNED WORD                               4
S        SB1      SIGNED BYTE 1                             1
S        SB2      SIGNED BYTE 2                             2

COMPONEN TYPE     DESCRIPTION                       TYPE_SIZE
-------- -------- -------------------------------- ----------
S        SB4      SIGNED BYTE 4                             4
S        BOOLEAN  BOOLEAN                                   4
S        FLOAT    FLOAT                                     4
S        DOUBLE   DOUBLE                                    8
S        SIZE_T   SIZE_T                                    4
S        DSIZE_T  DSIZE_T                                   4
S        PTR_T    PTR_T                                     4
K        KDBA     DATABASE BLOCK ADDRESS                    4
K        KTNO     TABLE NUMBER IN CLUSTER                   1
K        KSCN     SYSTEM COMMIT NUMBER                      8
K        KXID     TRANSACTION ID                            8

COMPONEN TYPE     DESCRIPTION                       TYPE_SIZE
-------- -------- -------------------------------- ----------
K        KUBA     UNDO ADDRESS                              8
KCB      KCBH     BLOCK COMMON HEADER                      20
KTB      KTBIT    TRANSACTION VARIABLE HEADER              24
KTB      KTBBH    TRANSACTION FIXED HEADER                 48
KTB      KTBBH_BS TRANSACTION BLOCK BITMAP SEGMENT          8
KDB      KDBH     DATA HEADER                              14
KDB      KDBT     TABLE DIRECTORY ENTRY                     4
KTE      KTECT    EXTENT CONTROL                           44
KTE      KTECH    EXTENT CONTROL                           72
KTE      KTETB    EXTENT TABLE                              8
KTS      KTSHC    SEGMENT HEADER                            8

COMPONEN TYPE     DESCRIPTION                       TYPE_SIZE
-------- -------- -------------------------------- ----------
KTS      KTSFS    SEGMENT FREE SPACE LIST                  20
KTS      KTSPHW   PAGE TABLE SEGMENT HWM                   60
KTS      KTSPHC   PAGE TABLE SEGMENT HEADER               112
KTS      KTSPFHC  LEVEL 1 BITMAP BLOCK HEADER             184
KTS      KTSPSHC  LEVEL 2 BITMAP BLOCK HEADER              96
KTS      KTSPTHC  LEVEL 3 BITMAP BLOCK HEADER              88
KTU      KTUBH    UNDO HEADER                              16
KTU      KTUXE    UNDO TRANSACTION ENTRY                   40
KTU      KTUXC    UNDO TRANSACTION CONTROL                104

KDX      KDXCO    INDEX HEADER                             16
KDX      KDXLE    INDEX LEAF HEADER                        32

COMPONEN TYPE     DESCRIPTION                       TYPE_SIZE
-------- -------- -------------------------------- ----------
KDX      KDXBR    INDEX BRANCH HEADER                      24

45 rows selected.

从这个视图中可以得到很多内部结构缩写的解构,如:KTUXE 是UNDO TRANSACTION ENTRY的缩写,KTUXC 是UNDO TRANSACTION CONTROL的缩写。

这在我们研究一些内部结构时,非常有帮助。
比如在UNDO SEGMENT Header上,这样的数据结构就随处可见了:
BBED> set file 1 block 10
        FILE#           1
        BLOCK#          10

BBED> map /v
 File: D:\oracle\oradata\EYGLE\DATAFILE\O1_MF_SYSTEM_5WQNS3QZ_.DBF (1)
 Block: 10                                    Dba:0x0040000a
------------------------------------------------------------
 Unlimited Undo Segment Header

 struct kcbh, 20 bytes                      @0
    ub1 type_kcbh                           @0
    ub1 frmt_kcbh                           @1
    ub1 spare1_kcbh                         @2
    ub1 spare2_kcbh                         @3
    ub4 rdba_kcbh                           @4
    ub4 bas_kcbh                            @8
    ub2 wrp_kcbh                            @12
    ub1 seq_kcbh                            @14
    ub1 flg_kcbh                            @15
    ub2 chkval_kcbh                         @16
    ub2 spare3_kcbh                         @18

 struct ktech, 72 bytes                     @20
    ub4 spare1_ktech                        @20
    word tsn_ktech                          @24
    ub4 lastmap_ktech                       @28
    ub4 mapcount_ktech                      @32
    ub4 extents_ktech                       @36
    ub4 blocks_ktech                        @40
    ub2 mapend_ktech                        @44
    struct hwmark_ktech, 32 bytes           @48
    struct locker_ktech, 8 bytes            @80
    ub4 flag_ktech                          @88

 struct ktemh, 16 bytes                     @92
    ub4 count_ktemh                         @92
    ub4 next_ktemh                          @96
    ub4 obj_ktemh                           @100
    ub4 flag_ktemh                          @104

 struct ktetb[6], 48 bytes                  @108
    ub4 ktetbdba                            @108
    ub4 ktetbnbk                            @112

 struct ktuxc, 104 bytes                    @4148
    struct ktuxcscn, 8 bytes                @4148
    struct ktuxcuba, 8 bytes                @4156
    sb2 ktuxcflg                            @4164
    ub2 ktuxcseq                            @4166
    sb2 ktuxcnfb                            @4168
    ub4 ktuxcinc                            @4172
    sb2 ktuxcchd                            @4176
    sb2 ktuxcctl                            @4178
    ub2 ktuxcmgc                            @4180
    ub4 ktuxcopt                            @4188
    struct ktuxcfbp[5], 60 bytes            @4192

 struct ktuxe[204], 8160 bytes              @4252
    ub4 ktuxexid                            @4252
    ub4 ktuxebrb                            @4256
    struct ktuxescn, 8 bytes                @4260
    sb4 ktuxesta                            @4268
    ub1 ktuxecfl                            @4269
    sb2 ktuxeuel                            @4270

 ub4 tailchk                                @8188


BBED> p ktuxc
struct ktuxc, 104 bytes                     @4148
   struct ktuxcscn, 8 bytes                 @4148
      ub4 kscnbas                           @4148     0x003819c3
      ub2 kscnwrp                           @4152     0x0000
   struct ktuxcuba, 8 bytes                 @4156
      ub4 kubadba                           @4156     0x00400017
      ub2 kubaseq                           @4160     0x003d
      ub1 kubarec                           @4162     0x0e
   sb2 ktuxcflg                             @4164     1 (KTUXCFSK)
   ub2 ktuxcseq                             @4166     0x003d
   sb2 ktuxcnfb                             @4168     1
   ub4 ktuxcinc                             @4172     0x00000000
   sb2 ktuxcchd                             @4176     54
   sb2 ktuxcctl                             @4178     50
   ub2 ktuxcmgc                             @4180     0x8002
   ub4 ktuxcopt                             @4188     0x7ffffffe
   struct ktuxcfbp[0], 12 bytes             @4192
      struct ktufbuba, 8 bytes              @4192
         ub4 kubadba                        @4192     0x00400017
         ub2 kubaseq                        @4196     0x003d
         ub1 kubarec                        @4198     0x0e
      sb2 ktufbext                          @4200     1
      sb2 ktufbspc                          @4202     4594
   struct ktuxcfbp[1], 12 bytes             @4204
      struct ktufbuba, 8 bytes              @4204
         ub4 kubadba                        @4204     0x00000000
         ub2 kubaseq                        @4208     0x003c
         ub1 kubarec                        @4210     0x07
      sb2 ktufbext                          @4212     0
      sb2 ktufbspc                          @4214     7196
   struct ktuxcfbp[2], 12 bytes             @4216
      struct ktufbuba, 8 bytes              @4216
         ub4 kubadba                        @4216     0x00000000
         ub2 kubaseq                        @4220     0x0032
         ub1 kubarec                        @4222     0x37
      sb2 ktufbext                          @4224     2
      sb2 ktufbspc                          @4226     1580
   struct ktuxcfbp[3], 12 bytes             @4228
      struct ktufbuba, 8 bytes              @4228
         ub4 kubadba                        @4228     0x00000000
         ub2 kubaseq                        @4232     0x002b
         ub1 kubarec                        @4234     0x0c
      sb2 ktufbext                          @4236     1
      sb2 ktufbspc                          @4238     6622
   struct ktuxcfbp[4], 12 bytes             @4240
      struct ktufbuba, 8 bytes              @4240
         ub4 kubadba                        @4240     0x00000000
         ub2 kubaseq                        @4244     0x0000
         ub1 kubarec                        @4246     0x00
      sb2 ktufbext                          @4248     0
      sb2 ktufbspc                          @4250     0
很有意思的信息,记录一下。




历史上的今天...
    >> 2012-08-06文章:
    >> 2009-08-06文章:
           ASM的一张体系结构简图
    >> 2008-08-06文章:
           骨肉情深
    >> 2007-08-06文章:
    >> 2005-08-06文章:
           数据文件SCN的一致性问题

无觅

By eygle on 2010-08-06 15:40 | Comments (1) | FAQ | 2596 |

1 Comment

您好!去年8月您参加过我们ZDNET的优秀专家博客评选,今年第二届"最受欢迎中国技术博客评选"又开始了,欢迎您继续参加,注册新的空间,推广自己的博客,给自己拉票
(http://wo.techrepublic.com.cn/popblogger50.shtml).
如有相关问题,我的联系方式:
email:guo.xing@zdnet.com.cn
MSN:guoxing968@yahoo.com.cn


CopyRight © 2004~2020 云和恩墨,成就未来!, All rights reserved.
数据恢复·紧急救援·性能优化 云和恩墨 24x7 热线电话:400-600-8755 业务咨询:010-59007017-7040 or 7037 业务合作: marketing@enmotech.com