Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

Oracle Partitionά»¤Ö®

·ÖÇø±íά»¤µÄ³£ÓÃÃüÁ
ALTER TABLE
-- DROP -- PARTITION
-- ADD |
-- RENAME |
-- MODIFITY |
-- TRUNCATE |
-- SPILT |
-- MOVE |
-- EXCHANGE |
·ÖÇøË÷ÒýµÄ³£ÓÃά»¤ÃüÁ
ALTER INDEX
-- DROP -- PARTITION
-- REBUILD |
-- RENAME |
-- MODIFITY |
-- SPILT |
-- PARALLEL
-- UNUSABLE
1¡¢ALTER TABLE DROP PARTITION
ÓÃÓÚɾ³ýtableÖÐij¸öPARTITIONºÍÆäÖеÄÊý¾Ý£¬Ö÷ÒªÊÇÓÃÓÚÀúÊ·Êý¾ÝµÄɾ³ý¡£Èç¹û»¹Ïë±£ÁôÊý¾Ý£¬¾ÍÐèÒªºÏ²¢µ½ÁíÒ»¸öpartitionÖС£
ɾ³ý¸ÃpartitionÖ®ºó£¬Èç¹ûÔÙinsert¸Ãpartition·¶Î§ÄÚµÄÖµ£¬Òª´æ·ÅÔÚ¸ü¸ßµÄpartitionÖС£Èç¹ûÄãɾ³ýÁË×î´óµÄpartition£¬¾Í»á³ö´í¡£
ɾ³ýtable partitionµÄͬʱ£¬É¾³ýÏàÓ¦µÄlocal index¡£¼´Ê¹¸ÃindexÊÇIU״̬¡£
Èç¹ûtableÉÏÓÐglobal index£¬ÇÒ¸Ãpartition²»¿Õ£¬drop partition»áʹËùÓеÄglobal index ΪIU״̬¡£Èç¹û²»ÏëREBUIL INDEX£¬¿ÉÒÔÓÃSQLÓï¾äÊÖ¹¤É¾³ýÊý¾Ý£¬È»ºóÔÙDROP PARTITION.
Àý×Ó£º
ALTR ATBEL sales DROP PARTITION dec96;
µ½µ×ÊÇDROP PARTITION»òÕßÊÇDELETE£¿
Èç¹ûGLOBAL INDEXÊÇ×îÖØÒªµÄ£¬¾ÍÓ¦¸ÃÏÈDELETE Êý¾ÝÔÙDROP PARTITION¡£
ÔÚÏÂÃæÇé¿öÏ£¬ÊÖ¹¤É¾³ýÊý¾ÝµÄ´ú¼Û±ÈDROP PARTITIONҪС
- Èç¹ûҪɾ³ýµÄÊý¾ÝÖ»Õ¼Õû¸öTABLEµÄС²¿·Ö
- ÔÚTABLEÖÐÓкܶàµÄGLOBAL INDEX¡£
ÔÚÏÂÃæÇé¿öÏ£¬ÊÖ¹¤É¾³ýÊý¾ÝµÄ´ú¼Û±ÈDROP PARTITIONÒª´ó
- Èç¹ûҪɾ³ýµÄÊý¾ÝÕ¼Õû¸öTABLEµÄ¾ø´ó²¿·Ö
- ÔÚTABLEÖÐûÓкܶàµÄGLOBAL INDEX¡£
Èç¹ûÔÚTABLEÊǸ¸TABLE£¬Óб»ÒýÓõÄÔ¼Êø£¬ÇÒPARTITION²»¿Õ£¬DROP PARTITIONʱ³ö´í¡£
Èç¹ûҪɾ³ýÓÐÊý¾ÝµÄPARTITION£¬Ó¦¸ÃÏÈɾ³ýÒýÓÃÔ¼Êø¡£»òÕßÏÈDELETE,È»ºóÔÙDROP PARTITION¡£
Èç¹ûTABLEÖ»ÓÐÒ»¸öPARTITON,²»ÄÜDROP PARTITION£¬Ö»ÄÜDROP TABLE¡£
2¡¢ALTER INDEX .. DROP PARTITION
ɾ³ýPARTIOTN GLOBAL INDEXÉÏɾ³ýINDEXºÍINDEX ENTRY£¬Ò»°ãÓÃÓÚƽºâI/O¡£
INDEX±ØÐëÊÇGLOBAL INDEX¡£²»ÄÜÏÔʽµÄdrop local index partition£¬²»ÄÜɾ³ý×î´óµÄindex¡£
ɾ³ýÖ®ºó£¬insertÊôÓÚ¸ÃpartitionµÄֵʱºò£¬index½¨Á¢ÔÚ¸ü¸ßµÄpartition¡£
Èç¹û°üº¬Êý¾ÝµÄpartitionɾ³ýÖ®ºó£¬ÏÂÒ»¸öpartitionÊÇIU״̬£¬±ØÐërebuild¡£¿ÉÒÔɾ³ýIU״̬µÄpartition£¬¼´Ê¹Ëü°üº¬Êý¾Ý¡£
3¡¢ALTER TABLE / INDEX RENAME PARTITION
Ö÷ÒªÓÃÓڸıäÒþʽ½¨Á¢µÄINDEX NAME¡£
INDEX ¿ÉÒÔÊÇIU״̬¡£
Ò»°ãµÄINDEX¿ÉÒÔÓÃALTER INDEX RENAME ....
4¡¢ALTER TABLE .. ADD PARTITION...
Ö


Ïà¹ØÎĵµ£º

oracle ´æ´¢¹ý³ÌµÄ»ù±¾Óï·¨

http://topic.csdn.net/t/20040818/16/3287013.html 
1.»ù±¾½á¹¹
CREATE OR REPLACE PROCEDURE ´æ´¢¹ý³ÌÃû×Ö
(
    ²ÎÊý1 IN NUMBER,
    ²ÎÊý2 IN NUMBER
) IS|AS
±äÁ¿1 INTEGER :=0;
±äÁ¿2 DATE;
BEGIN
END ´æ´¢¹ý³ÌÃû×Ö
˵Ã÷£ºisÒ²¿É»»³Éas
2.SELECT INTO STATEMENT
& ......

³£¼ûOracle HINTµÄÓ÷¨ SQLÓÅ»¯

ÔÚSQLÓï¾äÓÅ»¯¹ý³ÌÖУ¬ÎÒÃǾ­³£»áÓõ½hint,ÏÖ×ܽáÒ»ÏÂÔÚSQLÓÅ»¯¹ý³ÌÖг£¼ûOracle HINTµÄÓ÷¨£º
1. /*+ALL_ROWS*/
±íÃ÷¶ÔÓï¾ä¿éÑ¡Ôñ»ùÓÚ¿ªÏúµÄÓÅ»¯·½·¨,²¢»ñµÃ×î¼ÑÍÌÍÂÁ¿,ʹ×ÊÔ´ÏûºÄ×îС»¯.
ÀýÈç:
SELECT /*+ALL+_ROWS*/ EMP_NO,EMP_NAM,DAT_IN from BSEMPMS WHERE EMP_NO=’SCOTT’;
2. /*+FIRST_ROWS*/
±í ......

OracleÖÐstart with...connect by prior×Ó¾äÓ÷¨

 
OracleÖÐstart with...connect by prior×Ó¾äÓ÷¨

connect by Êǽṹ»¯²éѯÖÐÓõ½µÄ£¬Æä»ù±¾Óï·¨ÊÇ£º
select ... from tablename start with Ìõ¼þ1
connect by Ìõ¼þ2
where Ìõ¼þ3;
Àý£º
select * from table
start with org_id = 'HBHqfWGWPy'
connect by prior org_id = parent_id;
¼òµ ......

oracle 10gÈçºÎ¹Ø±ÕºÍ´ò¿ª×Ô¶¯ÊÕ¼¯Í³¼ÆÐÅÏ¢

http://www.51testing.com/?uid-16403-action-viewspace-itemid-101605
 Ò»¡¢ORACLE10g×Ô¶¯ÊÕ¼¯Í³¼ÆÐÅÏ¢--×Ô¶¯analyze
´ÓOracle Database 10g¿ªÊ¼£¬OracleÔÚ½¨¿âºó¾ÍĬÈÏ´´½¨ÁËÒ»¸öÃûΪGATHER_STATS_JOBµÄ¶¨Ê±ÈÎÎñ£¬ÓÃÓÚ×Ô¶¯ÊÕ¼¯CBOµÄͳ¼ÆÐÅÏ¢¡£
Õâ¸ö×Ô¶¯ÈÎÎñĬÈÏÇé¿öÏÂÔÚ¹¤×÷ÈÕÍíÉÏ10£º00-6£º00ºÍÖÜÄ©È«Ìì¿ªÆ ......

ORACLEÈý²ãǶÌ×ʵÏÖ·ÖÒ³¹¦ÄܺÍROWNUMµÄʹÓÃ

(Ò»)ʵÏÖ·ÖÒ³¼°ÐÔÄÜ
OracleµÄ·ÖÒ³²éѯÓï¾ä»ù±¾ÉÏ¿ÉÒÔ°´ÕÕ±¾Îĸø³öµÄ¸ñʽÀ´½øÐÐÌ×Óá£
·ÖÒ³²éѯ¸ñʽ£º
SELECT * from
(
SELECT A.*, ROWNUM RN
from (SELECT * from TABLE_NAME) A
WHERE ROWNUM <= 40
)
WHERE RN >= 21
ÆäÖÐ×îÄÚ²ãµÄ²éѯSELECT * from TABLE_NAME±íʾ²»½øÐз­Ò³µÄԭʼ²éѯÓï¾ä¡£ROWNUM & ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ