Perfil de haiOracle & StarcraftBlogListas Herramientas Ayuda

Blog


    16 enero

    what is data_object_id

    前些天有人问data_object_id究竟是个什么东东,既然有了object_id那还要data_object_id干吗?
     
    其实object_id和data_object_id同样是表示数据库对象的一个唯一标志,但是object_id表示的是逻辑id,data_object_id表示的是物理id。如果一些object没有物理属性的话那它就不存在data_object_id,例如procedure,function,package,data type,db link,mv定义,view定义,临时表,分区表定义等等这些object都是没有对应着某个segment,因此它们的data_object_id都为空。
     
    当表刚创建的时候它的object_id和data_object_id都是相等的,但是如果表经过move或truncate后那么data_object_id将会有变化。
     

    SQL 10G>select object_id,data_object_id from user_objects where object_name='T';
     OBJECT_ID DATA_OBJECT_ID
    ---------- --------------
         63053          63053
     
    刚开始创建表时object_id=data_object_id
     
    SQL 10G>SELECT HEADER_FILE,HEADER_BLOCK,BLOCKS FROM DBA_SEGMENTS WHERE SEGMENT_NAME='T' AND OWNER='TEST';
    HEADER_FILE HEADER_BLOCK     BLOCKS
    ----------- ------------ ----------
              4         2019          8
    SQL 10G>alter table t move;
    Table altered.
     
    SQL 10G>select object_id,data_object_id from user_objects where object_name='T';
     OBJECT_ID DATA_OBJECT_ID
    ---------- --------------
         63053          63463
    在move以后可以看到data_object_id发生变化了
     
    SQL 10G>SELECT HEADER_FILE,HEADER_BLOCK,BLOCKS FROM DBA_SEGMENTS WHERE SEGMENT_NAME='T' AND OWNER='TEST';
    HEADER_FILE HEADER_BLOCK     BLOCKS
    ----------- ------------ ----------
              4          467          8
     
    SQL 10G>truncate table t;
    Table truncated.
     
    SQL 10G>select object_id,data_object_id from user_objects where object_name='T';
     OBJECT_ID DATA_OBJECT_ID
    ---------- --------------
         63053          63464
    SQL 10G>SELECT HEADER_FILE,HEADER_BLOCK,BLOCKS FROM DBA_SEGMENTS WHERE SEGMENT_NAME='T' AND OWNER='TEST';
    HEADER_FILE HEADER_BLOCK     BLOCKS
    ----------- ------------ ----------
              4          467          8
     
    truncate之后虽然segment的位置没有移动,但是data_object_id还是发生变化了。
     
     
    SQL 10G>alter table t add(b number);
    Table altered.
     
    SQL 10G>select object_id,data_object_id from user_objects where object_name='T';
     OBJECT_ID DATA_OBJECT_ID
    ---------- --------------
         63053          63464
     
    我们对t表加一个字段,发现data_object_id没有发生变化,我们可以认为只有当segment发生变化时data_object_id才会随之变化。我们来看看data_object_id从哪里来的
     
     
    SQL 10G> select text from dba_views where view_name='DBA_OBJECTS';
     
    select u.name, o.name, o.subname, o.obj#, o.dataobj#,
           decode(o.type#, 0, 'NEXT OBJECT', 1, 'INDEX', 2, 'TABLE', 3, 'CLUSTER',
                          4, 'VIEW', 5, 'SYNONYM', 6, 'SEQUENCE',
                          7, 'PROCEDURE', 8, 'FUNCTION', 9, 'PACKAGE',
                          11, 'PACKAGE BODY', 12, 'TRIGGER',
                          13, 'TYPE', 14, 'TYPE BODY',
                          19, 'TABLE PARTITION', 20, 'INDEX PARTITION', 21, 'LOB',
                          22, 'LIBRARY', 23, 'DIRECTORY', 24, 'QUEUE',
                          28, 'JAVA SOURCE', 29, 'JAVA CLASS', 30, 'JAVA RESOURCE',
                          32, 'INDEXTYPE', 33, 'OPERATOR',
                          34, 'TABLE SUBPARTITION', 35, 'INDEX SUBPARTITION',
                          40, 'LOB PARTITION', 41, 'LOB SUBPARTITION',
                          42, NVL((SELECT distinct 'REWRITE EQUIVALENCE'
                                   FROM sum$ s
                                   WHERE s.obj#=o.obj#
                                         and bitand(s.xpflags, 8388608) = 8388608),
                                  'MATERIALIZED VIEW'),
                          43, 'DIMENSION',
                          44, 'CONTEXT', 46, 'RULE SET', 47, 'RESOURCE PLAN',
                          48, 'CONSUMER GROUP',
                          51, 'SUBSCRIPTION', 52, 'LOCATION',
                          55, 'XML SCHEMA', 56, 'JAVA DATA',
                          57, 'SECURITY PROFILE', 59, 'RULE',
                          60, 'CAPTURE', 61, 'APPLY',
                          62, 'EVALUATION CONTEXT',
                          66, 'JOB', 67, 'PROGRAM', 68, 'JOB CLASS', 69, 'WINDOW',
                          72, 'WINDOW GROUP', 74, 'SCHEDULE', 79, 'CHAIN',
                          81, 'FILE GROUP',
                         'UNDEFINED'),
           o.ctime, o.mtime,
           to_char(o.stime, 'YYYY-MM-DD:HH24:MI:SS'),
           decode(o.status, 0, 'N/A', 1, 'VALID', 'INVALID'),
           decode(bitand(o.flags, 2), 0, 'N', 2, 'Y', 'N'),
           decode(bitand(o.flags, 4), 0, 'N', 4, 'Y', 'N'),
           decode(bitand(o.flags, 16), 0, 'N', 16, 'Y', 'N')
    from sys.obj$ o, sys.user$ u
    where o.owner# = u.user#
      and o.linkname is null
      and (o.type# not in (1  /* INDEX - handled below */,
                          10 /* NON-EXISTENT */)
           or
           (o.type# = 1 and 1 = (select 1
                                  from sys.ind$ i
                                 where i.obj# = o.obj#
                                   and i.type# in (1, 2, 3, 4, 6, 7, 9))))
      and o.name != '_NEXT_OBJECT'
      and o.name != '_default_auditing_options_'
    union all
    select u.name, l.name, NULL, to_number(null), to_number(null),
           'DATABASE LINK',
           l.ctime, to_date(null), NULL, 'VALID','N','N', 'N'
    from sys.link$ l, sys.user$ u
    where l.owner# = u.user#
     
    可以看到data_object_id是从obj$.dataobj#来的,而obj$.dataobj#又对应着seg$.HWMINCR
     
     
    SQL 10G>select max(HWMINCR) from sys.seg$;

    MAX(HWMINCR)
    ------------
           63464
    这里的HWMINCR就是data_object_id的来源,每次seg$里生成新的一条记录都会增加HWMINCR这个值,同时obj$.dataobj#也会跟着变化。
     
     
     

    Comentarios (7)

    Espera...
    El comentario que has escrito es demasiado largo. Acórtalo.
    No has escrito nada. Vuelve a intentarlo.
    No se puede agregar tu comentario en este momento. Vuelve a intentarlo más tarde.
    Para agregar un comentario, necesitas permiso de tus padres. Pedir permiso
    Tus padres han desactivado los comentarios.
    No se puede eliminar tu comentario en este momento. Vuelve a intentarlo más tarde.
    Has superado el número máximo de comentarios que se puede dejar en un día. Vuelve a intentarlo en 24 horas.
    Se ha deshabilitado la capacidad de tu cuenta de dejar comentarios porque nuestros sistemas indican que podrías estar enviando correo no solicitado a otros usuarios. Si crees que tu cuenta se ha deshabilitado por error, ponte en contacto con el servicio de soporte técnico de Windows Live.
    Para terminar de dejar tu comentario, realiza la siguiente comprobación de seguridad.
    Los caracteres que escribas en la comprobación de seguridad deben coincidir con los de la imagen o el audio.

    Para agregar un comentario, inicia sesión con tu cuenta de Windows Live ID (si utilizas Hotmail, Messenger o Xbox LIVE, ya tienes una cuenta de Windows Live ID). Iniciar sesión


    ¿No tienes una cuenta de Windows Live ID? Regístrate

    儿 雨escribió:
    http://www.batteryfast.co.uk/hp/dv4000.htm hp dv4000 battery
    http://www.batteryfast.co.uk/dell/xr693.htm dell xr693 battery
    http://www.batteryfast.co.uk/dell/m1210.htm dell m1210 battery
    http://www.batteryfast.co.uk/dell/nf343.htm dell nf343 battery
    http://www.batteryfast.co.uk/dell/1210.htm dell 1210 battery
    http://www.batteryfast.co.uk/hp/hstnn-db11.htm hp hstnn-db11 battery
    http://www.batteryfast.co.uk/hp/nc8230.htm hp nc8230 battery
    http://www.batteryfast.co.uk/hp/nc8200.htm hp nc8200 battery
    http://www.batteryfast.co.uk/hp/nw8200.htm hp nw8200 battery
    http://www.batteryfast.co.uk/hp/nx8200.htm hp nx8200 battery
    http://www.batteryfast.co.uk/hp/nc8430.htm hp nc8430 battery
    http://www.batteryfast.co.uk/hp/pb992a.htm hp pb992a battery
    http://www.batteryfast.co.uk/compaq/nw8000.htm compaq nw8000 battery
    http://www.batteryfast.co.uk/compaq/nc8000.htm compaq nc8000 battery
    http://www.batteryfast.co.uk/compaq/v1000.htm compaq v1000 battery
    http://www.batteryfast.co.uk/compaq/nc6000.htm compaq nc6000 battery
    http://www.batteryfast.co.uk/compaq/nx5000.htm compaq nx5000 battery
    http://www.batteryfast.co.uk/compaq/n600.htm compaq n600 battery
    http://www.batteryfast.co.uk/hp/nx6120.htm hp nx6120 battery
    http://www.batteryfast.co.uk/hp/nc6100.htm hp nc6100 battery
    http://www.batteryfast.co.uk/hp/nc6120.htm hp nc6120 battery
    http://www.batteryfast.co.uk/dell/latitude-x200.htm dell latitude x200 battery
    http://www.batteryfast.co.uk/acer/btp-63d1.htm acer btp-63d1 battery
    http://www.batteryfast.co.uk/dell/inspiron-1300.htm dell inspiron 1300 battery
    http://www.batteryfast.co.uk/dell/inspiron-b130.htm dell inspiron b130 battery
    http://www.batteryfast.co.uk/gateway/12msbg.htm gateway 12msbg battery
    http://www.batteryfast.co.uk/gateway/4s2p.htm gateway 4s2p battery
    http://www.batteryfast.co.uk/dell/inspiron-510m-series.htm dell inspiron 510m series battery
    http://www.batteryfast.co.uk/dell/inspiron-600m.htm dell inspiron 600m battery
    http://www.batteryfast.co.uk/dell/latitude-d510.htm dell latitude d510 battery
    http://www.batteryfast.co.uk/dell/latitude-d600.htm dell latitude d600 battery
    http://www.batteryfast.co.uk/dell/latitude-d610.htm dell latitude d610 battery
    http://www.batteryfast.co.uk/dell/vostro-1200.htm dell vostro 1200 battery
    http://www.batteryfast.co.uk/dell/inspiron-7000.htm dell inspiron 7000 battery
    http://www.batteryfast.co.uk/dell/inspiron-7500.htm dell inspiron 7500 battery
    http://www.batteryfast.co.uk/dell/inspiron-700m.htm dell inspiron 700m battery
    http://www.batteryfast.co.uk/dell/inspiron-710m.htm dell inspiron 710m battery
    http://www.batteryfast.co.uk/dell/inspiron-8500m-series.htm dell inspiron 8500m series battery
    http://www.batteryfast.co.uk/dell/inspiron-8600.htm dell inspiron 8600 battery
    http://www.batteryfast.co.uk/dell/inspiron-8600m.htm dell inspiron 8600m battery
    http://www.batteryfast.co.uk/dell/latitude-d800.htm dell latitude d800 battery
    http://www.batteryfast.co.uk/dell/7012p.htm dell 7012p battery
    http://www.batteryfast.co.uk/dell/latitude-cs-series.htm dell latitude cs series battery
    http://www.batteryfast.co.uk/dell/xps-m1530.htm dell xps m1530 battery
    http://www.batteryfast.co.uk/dell/xps-m1730.htm dell xps m1730 battery
    http://www.batteryfast.co.uk/hp/pavilion-dv4.htm hp pavilion dv4 battery
    http://www.batteryfast.co.uk/hp/pavilion-dv5.htm hp pavilion dv5 battery
    6 Nov
    cvhg tryuuescribió:
    http://www.topbattery.com.au/hp/pavilion-dv6.htm hp pavilion dv6 battery
    http://www.topbattery.com.au/hp/ks524aa.htm hp ks524aa battery
    http://www.topbattery.com.au/hp/pavilion-zd7000.htm hp pavilion zd7000 battery
    http://www.topbattery.com.au/hp/338794-001.htm hp 338794-001 battery
    http://www.topbattery.com.au/hp/f1739a.htm hp f1739a battery
    http://www.topbattery.com.au/hp/f2019a.htm hp f2019a battery
    http://www.topbattery.com.au/hp/f2024.htm hp f2024 battery
    http://www.topbattery.com.au/hp/f4486a.htm hp f4486a battery
    http://www.topbattery.com.au/hp/f4486b.htm hp f4486b battery
    http://www.topbattery.com.au/compaq/354126-001.htm compaq 354126-001 battery
    http://www.topbattery.com.au/compaq/405231-001.htm compaq 405231-001 battery
    http://www.topbattery.com.au/toshiba/pa3384u-1bas.htm toshiba pa3384u-1bas battery
    http://www.topbattery.com.au/toshiba/satellite-a60.htm toshiba satellite a60 battery
    http://www.topbattery.com.au/toshiba/satellite-a65.htm toshiba satellite a65 battery
    http://www.topbattery.com.au/toshiba/satellite-pro-a60.htm toshiba satellite pro a60 battery
    http://www.topbattery.com.au/toshiba/pabas073.htm toshiba pabas073 battery
    http://www.topbattery.com.au/toshiba/pabas075.htm toshiba pabas075 battery
    http://www.topbattery.com.au/hp/nx6120.htm hp nx6120 battery
    http://www.topbattery.com.au/hp/nc6100.htm hp nc6100 battery
    http://www.topbattery.com.au/hp/nc6120.htm hp nc6120 battery
    http://www.topbattery.com.au/hp/nc6230.htm hp nc6230 battery
    http://www.topbattery.com.au/toshiba/satellite-m50.htm toshiba satellite m50 battery
    http://www.topbattery.com.au/uniwill/255-3s4400-g1l1.htm uniwill 255-3s4400-g1l1 battery
    http://www.topbattery.com.au/hp/hstnn-db17.htm hp hstnn-db17 battery
    http://www.topbattery.com.au/sony/vgp-bps2b.htm sony vgp-bps2b battery
    http://www.topbattery.com.au/sony/vgp-bps2c.htm sony vgp-bps2c battery
    http://www.topbattery.com.au/toshiba/pa3399u-1brs.htm toshiba pa3399u-1brs battery
    http://www.topbattery.com.au/acer/batbl50l6.htm acer batbl50l6 battery
    http://www.topbattery.com.au/hp/dv9600.htm hp dv9600 battery
    http://www.topbattery.com.au/hp/presario-x1300.htm hp presario x1300 battery
    http://www.topbattery.com.au/asus/a42-m6.htm asus a42-m6 battery
    http://www.topbattery.com.au/asus/a42-m6-silver.htm asus a42-m6 silver battery
    http://www.topbattery.com.au/asus/a3000.htm asus a3000 battery
    http://www.topbattery.com.au/toshiba/satellite-a100.htm toshiba satellite a100 battery
    http://www.topbattery.com.au/acer/bat30n3l.htm acer bat30n3l battery
    http://www.topbattery.com.au/dell/nt379.htm dell nt379 battery
    http://www.batteryfast.com/compaq/presario-c700.htm compaq presario c700 battery
    http://www.topbattery.com.au/dell/d620.htm dell d620 battery
    http://www.topbattery.com.au/dell/d630.htm dell d630 battery
    http://www.topbattery.com.au/dell/312-039.htm dell 312-039 battery
    http://www.topbattery.com.au/toshiba/satellite-m65.htm toshiba satellite m65 battery
    http://www.topbattery.com.au/toshiba/pa3128u-grey.htm toshiba pa3128u grey battery
    http://www.topbattery.com.au/toshiba/pa3191u-grey.htm toshiba pa3191u grey battery
    http://www.topbattery.com.au/acer/as07b71.htm acer as07b71 battery
    http://www.topbattery.com.au/acer/as07b72.htm acer as07b72 battery
    http://www.topbattery.com.au/ibm/thinkpad-t42.htm ibm thinkpad t42 battery
    http://www.topbattery.com.au/toshiba/pa3285u-1brs.htm toshiba pa3285u-1brs battery
    http://www.topbattery.com.au/toshiba/pa3285u-1bas.htm toshiba pa3285u-1bas battery
    3 Nov
    29 Ago
    26 Mar
    banky1 wang1escribió:
    都是我问他的,然后他就想的啊.哈哈.
    9 Mar
    Imagen de Anónimo
    wanghai escribió:
    自己思考,哪里来的文档看
    19 Ene
    Imagen de Anónimo
    柔嘉维则 escribió:
    你是怎么知道这些东西的呀
    看文档?
    or自己想出来的?
    18 Ene

    Vínculos de referencia

    La dirección URL del vínculo de referencia de esta entrada es:
    http://wzwanghai.spaces.live.com/blog/cns!56626E237AFBD116!293.trak
    Weblogs que hacen referencia a esta entrada
    • Ninguno