oracleË÷ÒýËéƬ
author£ºskate
time£º2010-05-31
Ë÷ÒýÒ³¿éËéƬ£¨Index Leaf Block Fragmentation£©
ÕâƪÎÄÕ½«»á»Ø´ðÈçÏÂÎÊÌ⣺
ʲôÊÇË÷ÒýÒ³¿éËéƬ£¿Ê²Ã´Ê±ºò±»ÖØÓã¿
ʲôÊÇ°ë¿ÕË÷ÒýËéƬ£¿Ê²Ã´Ê±ºò±»ÖØÓã¿
oracleµÄ±ê×¼Ë÷Òý½á¹¹ÊÇB×tree½á¹¹£¬Ò»¸öB×tree½á¹¹ÓÉÈýÖÖblock×é³É
¸ù¿é(root block):ÔÚB×treeÀïÓÐÇÒÖ»ÓÐÒ»¸öblock£¬ËùÓзÃÎÊË÷Òý¶¼´ÓÕ⿪ʼ£¬root blockÏÂÓкܶàchild blocks¡£
·ÖÖ§¿é£¨Branch blocks£©:ÕâÊÇÖмä²ã£¬branch blockÊÇûÓÐʲôÏÞÖƵģ¬ËüÊÇËæ×Åleaf blockµÄÔö¼Ó¶øÔö¼ÓµÄ£¬branch blockÒ»°ãÊÇ4²ã£¬Èç¹û¶àÓÚ4²ã£¬¾ÍÓ°ÏìÐÔÄÜÁË¡£ÔÚÎÒÃÇɾ³ýÐÐʱ£¬branch blockÊDz»±»É¾³ýµÄ¡£
Ò¶¿é£¨leaf block£©£ºÒ¶¿éÊÇ×îµ×²ã£¬ÉÏÃæ´æ´¢×ÅË÷ÒýÌõÄ¿ºÍrowid
Ë÷ÒýºÍ±íÊý¾ÝÊǼ¶Áª¹ØϵµÄ£¬µ±É¾³ý±íÊý¾ÝµÄʱºò£¬Ë÷ÒýÌõÄ¿Ò²»á±»×Ô¶¯É¾³ý£¬ÕâÑùÔÚindex leaf
block¾Í»á²úÉúËéƬ£¬ÕâÒ²¾ÍÊÇÔÚOLTPϵͳÉÏÓдóÁ¿¸üеıíÉϲ»½¨Òé´´½¨´óÁ¿µÄË÷Òý£¬ºÜÓ°ÏìÐÔÄÜ
ÓеÄÈË˵ɾ³ý¹ýµÄË÷ÒýÌõÄ¿¿Õ¼ä²»»á±»ÔÙÓã¬ÒòΪÔÚÓ¦ÓÃÖв»»áÔÙÓÐinsertÏàͬµÄÊý¾Ý¡£ÆäʵÕâ¸ö
˵·¨²»ÍêÈ«¶ÔµÄ£¬³ýÁË°ë¿ÕÒ¶¿éÍ⣬ÆäËûµÄɾ³ýµÄË÷Òý¿Õ¼äÊǿɱ»ÔÙÀûÓõġ£
eg£º
±¾ÎĵÄËùÓÐʵÑ鶼ÊÇÔÚÈçÏÂƽ̨²âÊÔ£º
SQL> select * from v$version;
BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Prod
PL/SQL Release 10.2.0.4.0 - Production
CORE 10.2.0.4.0 Production
TNS for 32-bit Windows: Version 10.2.0.4.0 - Production
NLSRTL Version 10.2.0.4.0 - Production
SQL>
SQL> create table test_idx as select seq_test.nextval id,2000 syear, a.* from d
ba_objects a;
±íÒÑ´´½¨¡£
SQL> insert into test_idx select seq_test.nextval id,2001 syear, a.* from dba_o
bjects a;
ÒÑ´´½¨50780ÐС£
SQL> insert into test_idx select seq_test.nextval id,2002 syear, a.* from dba_o
bjects a;
ÒÑ´´½¨50780ÐС£
SQL> commit;
Ìá½»Íê³É¡£
SQL> desc test_idx
Ãû³Æ  
Ïà¹ØÎĵµ£º
ÒÔÇ°¾³£Ê¹ÓÃoracleµÄ¿Í»§¶Ë¹¤¾ßtoadÀ´½øÐÐÊý¾Ý¿âµÄµ¼ÈëºÍµ¼³ö£¬Æäʵ¸öÈ˵¹²»Ï²»¶ÓÃÕâ¸ö¿Í»§¶Ë¹¤¾ß£¬¸Ð¾õ¹¦ÄܺÜÇ¿´óµÄÒ»¸ö¹¤¾ß£¬dbaÊÊÓ᣿ª·¢»¹ÊÇÓÃpl/sql±È½ÏºÃ£¬¼ò½àµÄ½çÃæ¡£
C:\Users\Administrator>imp nwgis/pass file=e:/nwgis20100529.DMP log=dible_db full=y ignore=y
Æô¶¯ÃüÁîÐУ¬ÐÞ¸Ä ......
ÏÔʾOracle²é¿´·ÖÇø±íÐÅÏ¢
ÏÔʾÊý¾Ý¿âËùÓзÖÇø±íµÄÐÅÏ¢£ºDBA_PART_TABLES
ÏÔʾµ±Ç°Óû§¿É·ÃÎʵÄËùÓзÖÇø±íÐÅÏ¢£ºALL_PART_TABLES
ÏÔʾµ±Ç°Óû§ËùÓзÖÇø±íµÄÐÅÏ¢£ºUSER_PART_TABLES
ÏÔʾOracle²é¿´·ÖÇø±íÐÅÏ¢ ÏÔʾÊý¾Ý¿âËùÓзÖÇø±íµÄÏêϸ·ÖÇøÐÅÏ¢£ºDBA_TAB_PARTITIONS
ÏÔʾµ±Ç°Óû§¿É·ÃÎʵÄËùÓзÖÇø±íµÄÏêϸ·ÖÇøÐÅÏ¢£ ......
1.´´½¨±í£º
a. ´´½¨xs±íÖмÆËã»úרҵѧÉúµÄ±¸·Ý
Create table xs_jsj as select * from xs where zym=’¼ÆËã»ú’;
b.ÍêÕûµÄÀý×Ó£º
¡¡¡¡¡¡¡¡¡¡ Create table test ......
1.´´½¨±í£º
a. ´´½¨xs±íÖмÆËã»úרҵѧÉúµÄ±¸·Ý
Create table xs_jsj as select * from xs where zym=’¼ÆËã»ú’;
b.ÍêÕûµÄÀý×Ó£º
¡¡¡¡¡¡¡¡¡¡ Create table test ......