oracleÌøÔ¾Ë÷ÒýµÄÓ¦Óó¡ºÏ
Ë÷ÒýÌøԾʽɨÃè(index skip scan)ÊÇOracle9iµÄÒ»¸öеÄÖ´ÐÐÌØÐÔ£¬ÓÈÆäÊÊÓÃÓÚʹÓÃÁ¬½ÓË÷ÒýºÍ·ÃÎʶàÖµË÷ÒýµÄOracle²éѯ¡£
Ë÷ÒýÌøԾʽɨÃè(index skip scan)ÊÇOracle9iµÄÒ»¸öеÄÖ´ÐÐÌØÐÔ£¬ÓÈÆäÊÊÓÃÓÚʹÓÃÁ¬½ÓË÷ÒýºÍ·ÃÎʶàÖµË÷ÒýµÄOracle²éѯ¡£ÈÃÎÒÃÇ¿´ÒÔϵķ¶Àý¡£Çë×¢Òâµ½ÒÔÏ´úÂë°üº¬×ÅÁ¬½ÓË÷Òý£º
create indexsex_emp_idonemp (sex, emp_id);
ÔÚOracle9i°æ±¾Ö®Ç°£¬µ±SQL²éѯÖаüº¬ÐÔ±ðºÍemp_idʱ£¬»òÕß²éѯָ¶¨ÐÔ±ðÐеÄʱºò²Å¿ÉÒÔʹÓÃÕâÒ»Ë÷Òý¡£ÏÂÃæµÄ²éѯ²»Äܹ»Ê¹ÓÃÁ¬½ÓË÷Òý£º
selectemp_idfromempwhereemp_id = 123;
Oracle9iµÄË÷ÒýÌøԾʽɨÃèÖ´ÐйæÔòÔÊÐíʹÓÃÁ¬½ÓË÷Òý£¬¼´Ê¹SQL²éѯÖв»Ö¸¶¨ÐԱ𡣠ÕâÒ»ÌØÐÔʹµÃÎÞÐèÔÚemp_idÐÐÖÐÌṩµÚ¶þ¸öË÷Òý¡£Oracle³ÐÈÏË÷ÒýÌøԾʽɨÃèûÓÐÖ±½ÓË÷Òý²éѯËٶȿ죬µ«¿ÉÒÔÕâÑù˵£¬Ïà±ÈÓÚÕû¸ö±íɨÃè (table scan)£¬Ë÷ÒýÌøԾʽɨÃèµÄËÙ¶ÈÒª¿ìµÃ¶à¡£
µ±OracleûÓÐÖ¸Ã÷Ë÷ÒýÌøԾʽɨÃèµÄÄÚ²¿ÄÚÈÝʱ£¬ÎÒÃÇ¿ÉÒÔ´ÓËüµÄÖ´ÐйæÔòÖÐÅжϳö£¬OracleÔÚÄÚ²¿ÉÏÉú³ÉÁ˶à¸ö²éѯ£¬ÕâÑù¾ÍÂú×ã´øÓжà¸ö×Ó²éѯµÄ²éѯ:
SELECT STATEMENT Optimizer=CHOOSE (Cost=6 Card=1 Bytes=5)0 SORT (AGGREGATE)1 INDEX (SKIP SCAN) OF 'SEX_EMP_ID' (NON-UNIQUE)
ÔÚÄÚ²¿ÀOracleÉú³ÉÁËÁ½¸ö²éѯ£¬²¢Á¬½Ó½á¹ûµÄROWID±í¡£
selectemp_name from emp_where sex = 'F' and emp_id = 123
UNION
select emp_name from emp_where sex = 'M' and emp_id = 123;
ʹÓÃË÷ÒýÌøԾʽɨÃèµÄÄÚº¾Í±äµÃºÜÇåÎú¡£
¶ÔÓÚ¸ß˳Ðò¼ü(high order key)ÖеĶÀÌØÖµÊýÄ¿£¬OracleµÄË÷ÒýÌøԾʽɨÃèÐÔÄܽ«»á½µµÍ¡£Èç¹ûÖ÷ÁÐÓÐ50¸öÖµ£¬OracleÒª·¢³ö50Ìõ²éѯ²ÅÄÜÕһؽá¹û¡£ Ë÷ÒýÌøԾʽɨÃèÖ»ÊÊÓÃÓÚÓ²ÅÌ¿Õ¼äºÍ´æ´¢¿Õ¼äÏ൱½ôȱµÄÇé¿ö¡££¨ÔðÈαà¼:ÍõÈð£©
ÆÀÊö£º
¸ù¾ÝÉÏÃæÎÄÕÂÖеĽá¹û£¬Êµ¼ÊÉÏ£¬ÌøÔ¾Ë÷ÒýµÄÓ¦Óó¡ËùÊÇÓÐÏ޵ģ¬Èç¹ûË÷ÒýµÄµÚÒ»¸ö×ֶΣ¨Ö÷ÁУ©µÄÊý¾ÝÖÖÀàºÜ¶àµÄ»°£¬ÌøÔ¾Ë÷Òý¶ÔÌá¸ßÐÔÄÜÊǺÜÓÐÏ޵ģ¬ÉõÖÁÊÇûÓÐÓô¦µÄ£¬ÒòΪʵ¼ÊÉÏoracleÄÚ²¿ÊÇÉú³ÉÁ˶à¸ö²éѯÀ´Íê³ÉÕâÏ×÷µÄ¡£
ËùÒÔÔÚʵ¼ÊÓ¦Óùý³ÌÖУ¬ÕýÈ·µÄÀí½âÌøÔ¾Ë÷ÒýµÄÔÀí£¬·ÖÎöÖ÷ÁÐÊý¾ÝµÄÇé¿ö£¬ÊÇÓúÃÌøÔ¾Ë÷ÒýµÄÒ»¸öÇ°Ìá
±¾ÎÄÀ´×ÔCSDN²©¿Í£¬×ªÔØÇë±êÃ÷³ö´¦£ºhttp://blog.csdn.net/towerjt/archi
Ïà¹ØÎĵµ£º
extent--×îС¿Õ¼ä·ÖÅ䵥λ --tablespace management
block --×îСi/oµ¥Î» --segment management
create tablespace james
datafile '/export/home/oracle/oradata/james.dbf'
size 100M ¡¡¡¡¡¡¡¡¡¡¡¡--³õʼµÄÎļþ´óС¡¡
autoextend On¡¡¡¡¡¡¡¡ --×Ô¶¯Ôö³¤
next 10M¡ ......
OracleÊý¾Ý¿âÖÐÌṩÁËͬÒå´Ê¹ÜÀíµÄ¹¦ÄÜ¡£Í¬Òå´ÊÊÇÊý¾Ý¿â·½°¸¶ÔÏóµÄÒ»¸ö±ðÃû£¬¾³£ÓÃÓÚ¼ò»¯¶ÔÏó·ÃÎʺÍÌá¸ß¶ÔÏó·ÃÎʵݲȫÐÔ¡£ÔÚʹÓÃͬÒå´Êʱ£¬OracleÊý¾Ý¿â½«Ëü·Òë³É¶ÔÓ¦·½°¸¶ÔÏóµÄÃû×Ö¡£ÓëÊÓͼÀàËÆ£¬Í¬Òå´Ê²¢²»Õ¼ÓÃʵ¼Ê´æ´¢¿Õ¼ä£¬Ö»ÓÐÔÚÊý¾Ý×ÖµäÖб£´æÁËͬÒå´ÊµÄ¶¨Òå¡£ÔÚOracleÊý¾Ý¿âÖеĴ󲿷ÖÊý¾Ý¿â¶ÔÏó£¬Èç±í¡¢ÊÓͼ¡¢Í ......
oracle Êý¾Ý¿âÁ¬½Ó¾ÍÏñÄãÔÚ³ÌÐòÖн¨Á¢Ò»¸öµ½Êý¾Ý¿âµÄÁ¬½ÓÒ»Ñù¡£
Èç¹ûÊý¾Ý¿â²»ÔÚ±¾µØÖ÷»ú,±ØÐëÔÚ$ORACLE_HOME/network/admin/tnsnames.oraÖÐÅäÖÃÏàÓ¦µÄtns£¬È»ºó³ÌÐò²ÅÄÜͨ¹ýÅäÖúõÄtns·ÃÎÊÊý¾Ý¿â£¬µ«ÊÇjavaͨ¹ýthin·½Ê½·ÃÎÊoracleÀýÍ⣬¿ÉÒÔ²ÉÓÃÔÚ±¾µØÅäÖúõÄtns±ðÃû£¬Ò²¿ÉÒÔ²ÉÓÃtnsÈ«½âÎöÃû£¬²ÉÓñðÃûµÈºÅºóµÄÈ« ......
String sql = "select t.FILE_INFO from T_FILE_DB_DETAIL t where t.id= "
+ fileDBUpDownDetail.getId() + " for update";
rs = stmt.executeQuery(sql);
if (rs.next()) {
// ÔÚweblogicϲ¿Êðʱ£¬ÐèÒª¸ü¸ÄΪBea We ......
1. ´´½¨±í¿Õ¼äʾÀýÈçÏÂ
CREATE TABLESPACE "SAMPLE"
LOGGING
DATAFILE 'D:\ORACLE\ORADATA\ORA92\LUNTAN.ora' SIZE 5M
REUSE AUTOEXTEND
ON NEXT 51200K MAXSIZE 3900M
EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO
ÉÏÃæ ......