ORACLEÐÔÄÜÕï¶ÏʵÀý ÐÐǨÒƺÍÐÐÁ´½Ó
ÃÀ¹úPVH DB´æÔÚÐÐÁ´½Ó.ͨ¹ýÎҵļì²é,·¢ÏÖ,ÎÒÃǵÄDBͬÑù´æÔÚÐÐǨÒƺÍÐÐÁ´½Ó.ORACLEµÄdbms_stats.gather_schema_statsÖ»»áÊÕ¼¯ÓÅ»¯Æ÷ͳ¼ÆÐÅÏ¢,²»»á¼ì²â±íµÄ¼Ç¼ÊÇ·ñ´æÔÚÐÐǨÒƺÍÐÐÁ´½Ó.(ÎÒÔÏȱ»Õâ¸ö°ü¸øÆÁË,ËùÒÔÖ´ÐÐÍêdbms_stats.gather_schema_statsºóÒ»²éÊý¾Ý×Öµä:USER_TABLES,ÆäÖеÄ×Ö¶Îchain_cntֵȫΪ0).Òª¼ì²â±íµÄ¼Ç¼ÊÇ·ñ´æÔÚrow chain,ÐèÒªÓõ½ORACLEÔçÏÈÒ»µãµÄÃüÁî:ANALYZE TABLE.ËùÒÔÎÒдÁËÒ»¸ö´æ´¢¹ý³Ì(P_analyze_schema)ÒÔ¼ì²âDB:PVH91USRDÖÐËùÓбí´æÔÚÐÐÁ´½ÓµÄÇé¿ö.
ÖµµÃ×¢ÒâµÄÊÇ:Êý¾Ý×Öµä USER_TABLES.CHAIN_CNTµÄÖµÊÇ°üº¬ÁËÐÐǨÒƺÍÐÐÁ´½ÓµÄÊýÄ¿.Çë¿´ORACLEµÄ½âÊÍ:
CHAIN_CNT* Number of rows in the table that are chained from one data block to another, or which have migrated to a new block, requiring a link to preserve the old ROWID
Ò²¾ÍÊÇ˵Õâ¸ö×ֶεÄÖµÊÇÐÐǨÒƺÍÐÐÁ´½ÓµÄ×ÜÊýÁ¿,ÖÁÓÚÒªÖªµÀ¾ßÌåÐÐǨÒÆÓжàÉÙ,ÐÐÁ´½ÓÓÖÊǶàÉÙ,ANALYZE TABLEÕâ¸öÃüÁîû°ì·¨µÃµ½,Ö»ÓÐͨ¹ýDUMP BLOCKÀ´Çø·Ö(·½·¨¸´ÔÓ,¹ÊûÓÐÈ¥×ö).µ«Ê×ÏÈÎÒÃÇÒªÖªµÀÐÐǨÒƺÍÐÐÁ´½ÓÊÇÁ½¸ö²»Í¬µÄ¸ÅÄî:
(1)ÐÐǨÒÆ: ORACLEÒ»¸öBLOCKµÄDEFAULT SIZEÊÇ8K,ÊÂʵÉÏ,Ò»¸öBLOCK²»¿ÉÒÔ´æ´¢8KµÄÊý¾Ý.Ò»¸öBLOCK¿ÉÒÔ´æ´¢¶àÉÙÊý¾Ý,ÓÉPCTFREE,PCTUSED²ÎÊý¿ØÖÆ(¶ÔÓÚÒÔÇ°µÄÊÖ¹¤¹ÜÀíµÄ±í¿Õ¼ä¶øÑÔ).
PCTFREE:ÊÇÖ¸BLOCK±£Áô¿ÕÏпռäµÄ°Ù·Ö±È,ÓÃÓÚUPDATE¡£¶ÔÓÚÒѾ²åÈëµ½BLOCKµÄÐжøÑÔ£¬ºóÃæµÄUPDATE²Ù×÷ÓпÉÄÜʹÐеij¤¶ÈÔö¼Ó£¬PCTFREE¾ÍÊÇÓÃÓÚÈÝÄÉÔö¼ÓµÄÄDz¿·Ö³¤¶È¶ø±£ÁôµÄ¿ÕÏпռ䡣Èç¹ûUPDATEʱPCTFREEÔÙÒ²²»Äܹ»ÈÝÄÉÐÐÔö¼ÓµÄ³¤¶È£¬ÔòORACLE»á½«Õû¸öÐÐǨÒƵ½Ò»¸öеÄBLOCK£¬ÐеÄROWID±£Áô(²»ÊÇÌ«Ã÷°×ΪʲôORACLE²»¸Ä±äROWID)£¬ÔÀ´µÄBLOCKÓÐÒ»¸öÖ¸ÕëÖ¸ÏòROW´æ·ÅµÄÐÂBLOCK¡£Õâ¾ÍÊÇÐÐǨÒÆ¡£¿É¼û£¬ÐÐǨÒÆÊÇÓÉÓÚUPDATE²Ù×÷Ëùµ¼Ö¡£´Ó×ÖÃæÉÏÀí½â£¬ËùνǨÒÆ£¬¿Ï¶¨ÏÈÓдæÔÚÕâÒ»ÐУ¬²ÅÄܽÐ×ÅǨÒÆ.
PCTUSED£ºÊÇÖ¸BLOCKÓÃÓÚINSERTµÄ°Ù·Ö±È¡£¶ÔÓÚINSERT²Ù×÷£¬BLOCK¿ÉÓÃÓÚÈÝÄÉÐÂÐеÄ×î´ó¿Õ¼äΪBlocksize-pctfree-overhead.µ±BLOCKÊý¾Ý´æ´¢ÒѸßÓÚPCTUSED£¬ORACLE»á½«¸Ã¿é´Ó×ÔÓÉÁ´±íÖÐÒƳý£¬Ö±µ½¸Ã¿éÒÑʹÓÿռ併µ½PCTUSEDÒÔÏ£¬²Å»áÔٴν«´Ë¿éÖØмÓÈëµ½Freelist(ÕâÊÇORACLEÒÔÇ°ÊÖ¹¤¹ÜÀíµÄ±í¿Õ¼ä¹ÜÀí¿ÕÏпéµÄÔÀí,ÏÖÔÚORACLEÍƼöʹÓÃASSM).
ÐÐǨÒƺÍÐÐÁ´½ÓµÄ¼ì²â£º
³ýÁËÎÒдµÄ´æ´¢¹ý³Ì¿ÉÒÔ¼ì²âÒÔÍ⣬һ¸ö¼òµ¥µÄ¼ì²â·
Ïà¹ØÎĵµ£º
1.¾ø¶ÔÖµ
S:select abs(-1) value
O:select abs(-1) value from dual
2.È¡Õû(´ó)
S:select ceiling(-1.001) value
O:select ceil(-1.001) value from dual
3.È¡Õû£¨Ð¡£©
S:select floor(-1.001) value
O:select floor(-1.001) value from dual
4.È¡Õû£¨½ØÈ¡£©
S:select cast(-1.002 as int) value
O:selec ......
OracleÖеÄÐòÁкŹËÃû˼Òå¾ÍÊÇ´´½¨Ò»¸öÐòÁкţ¬¿ÉÒÔÔÚ²åÈë»òÕ߸üеÄʱºòµ÷Óã¬Ï൱ÓÚÊÇÒ»¸öÉú³ÉÆ÷
´´½¨Óï·¨£º
create sequence myse
increment by 1 --Ôö³¤¶È
start with
1 --´ÓÄÄÀïÔö¼Ó£¬¾ÍÊÇ˵ÏÂÒ»¸ö»ñÈ¡µÄÖµ´ÓÕâ¸öÖµ ......
ORACLE ·ÖÇø±í PARTITION table
http://blog.chinaunix.net/u/6889/showart_315897.html
1.1 ·ÖÇø±íPARTITION table
ÔÚORACLEÀïÈç¹ûÓöµ½Ìرð´óµÄ±í£¬¿ÉÒÔʹÓ÷ÖÇøµÄ±íÀ´¸Ä±äÆäÓ¦ÓóÌÐòµÄÐÔÄÜ¡£
1.1.1 ·ÖÇø±íµÄ½¨Á¢£º
ij¹«Ë¾µÄÿÄê²úÉú¾Þ´óµÄÏúÊۼǼ£¬DBAÏò¹«Ë¾½¨Òéÿ¼¾¶ÈµÄÊý¾Ý·ÅÔÚÒ»¸ö·ÖÇøÄÚ£¬ÒÔÏÂʾ·¶µÄÊǸù«Ë¾1 ......
¸Õ¿ªÊ¼Ñ§Ï°Orace£¬Óöµ½Ò»Ð©·Ç³£ºÃµÄÊ飬ÔÚÏÂÃæÁгö£¬Ëæ×ÅѧϰµÄÉîÈë»á°ÑÓöµ½µÄºÃÊ鶼ÁгöÀ´£¬¹©Ñ§Ï°OracleµÄÅóÓѲο¼£¬
Ò²»¶Ó¸÷λÅóÓѲ¹³ä£º
»ù´¡£º
1. ORACLE DBA»ù´¡Åàѵ½Ì³Ì ºÎÃ÷Öø Ç廪´óѧ³ö°æÉç
&n ......
Author: Rainny
Date: 2010-3-5
Ò»£¬Ö¢×´ÃèÊö
2¸ö½ÚµãµÄORACLE 10G RAC£¬¸ôÒ»¶Îʱ¼äÆäÖеÄÒ»¸öNODE¾Í»áDOWN»ú¡£½Úµã´ÓCLUSTERÖб»ÇýÖð¡£
¶þ£¬Õï¶Ï¹ý³Ì
Rac1±»Öð³ö£¬RAC2´æ»î£¬RAC2½Ó¹ÜÁËRAC1µÄVIP£¬ÎÒÃÇÀ´²é¿´RAC2µÄÏà¹ØLOG¡£
Ê×ÏȲ鿴RAC2µÄ¸æ¾¯ÈÕÖ¾£º..\log\rac2\alertrac2.log:
2010-03-05 14:39:50.750
[cssd(7 ......