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).
ÐÐǨÒƺÍÐÐÁ´½ÓµÄ¼ì²â£º
³ýÁËÎÒдµÄ´æ´¢¹ý³Ì¿ÉÒÔ¼ì²âÒÔÍ⣬һ¸ö¼òµ¥µÄ¼ì²â·
Ïà¹ØÎĵµ£º
Oracleά»¤³£ÓÃSQLÓï¾ä»ã×Ü
ÉÏһƪ / ÏÂһƪ 2008-09-04 11:25:01
²é¿´( 1991 ) / ÆÀÂÛ( 0 ) / ÆÀ·Ö( 0 / 0 )
ÈçºÎÔ¶³ÌÅжÏOracleÊý¾Ý¿âµÄ°²×°Æ½Ì¨
select * from v$version;
²é¿´±í¿Õ¼äµÄʹÓÃÇé¿ö
select sum(bytes)/(1024*1024) as free_space,tablespace_name
from dba_free_space
group by tablespace_ ......
Ò»¡¢java·ÃÎÊÖÐÎÄOracleÊý¾Ý¿âÉÏÁ¬½ÓµÄUS7ASCIIÊý¾Ý¿â
1¡¢¶Á·½·¨
public String convertLink_DB(String s) {
if(s != null){
try{
byte[] b = s.getBytes();
for(int i=0; i<b.length; i++){
b[i] ......
OracleÖеÄÐòÁкŹËÃû˼Òå¾ÍÊÇ´´½¨Ò»¸öÐòÁкţ¬¿ÉÒÔÔÚ²åÈë»òÕ߸üеÄʱºòµ÷Óã¬Ï൱ÓÚÊÇÒ»¸öÉú³ÉÆ÷
´´½¨Óï·¨£º
create sequence myse
increment by 1 --Ôö³¤¶È
start with
1 --´ÓÄÄÀïÔö¼Ó£¬¾ÍÊÇ˵ÏÂÒ»¸ö»ñÈ¡µÄÖµ´ÓÕâ¸öÖµ ......
1.sqlplus-----¿ªÆô·þÎñ
2.ÊäÈëÓû§ÃûºÍÃÜÂ루ĬÈÏ3¸öÓû§,×¢Ò⣬ÃÜÂëÊÇ¿ÉÒÔÐ޸ĵģºsystem/manager;scott/tiger;sys/change_on_install£©£¬Á¬½ÓÊý¿â¡£
3.´´½¨±í¿Õ¼ä£º
create tablespace ±í¿Õ¼äÂß¼Ãû datafile '±í¿Õ¼äÎļþµÄÎïÀíÂß¼'
size Îļþ´óС£¨È磺10m£© autoextend ÊÇ·ñ×Ô¶¯Ôö³¤Îļþ´óС£¨on/off ......
¸Õ¿ªÊ¼Ñ§Ï°Orace£¬Óöµ½Ò»Ð©·Ç³£ºÃµÄÊ飬ÔÚÏÂÃæÁгö£¬Ëæ×ÅѧϰµÄÉîÈë»á°ÑÓöµ½µÄºÃÊ鶼ÁгöÀ´£¬¹©Ñ§Ï°OracleµÄÅóÓѲο¼£¬
Ò²»¶Ó¸÷λÅóÓѲ¹³ä£º
»ù´¡£º
1. ORACLE DBA»ù´¡Åàѵ½Ì³Ì ºÎÃ÷Öø Ç廪´óѧ³ö°æÉç
&n ......