oracleÊý¾Ý¿âɾ³ý±íÊý¾ÝÏÂÁîÊÇʲô
oracleÊý¾Ý¿âɾ³ý±íÊý¾ÝÏÂÁîÓÐÁ½ÖÖ£ºtruncate tableºÍdelete¡£truncate tableËÙÂʿ죬²»¼Í¼undoÐÅÏ¢»ò´¥·¢Æ÷£¬ÊÊÓÃÓÚÐèÒª¿ìËÙɾ³ýËùÓÐÊý¾ÝÇÒÎÞÐè¼Í¼undoÐÅÏ¢µÄÇéÐΣ»deleteÓÃÓÚƾ֤Ìõ¼þɾ³ýÊý¾Ý£¬»á´¥·¢´¥·¢Æ÷ºÍÔ¼Êø£¬ÊÊÓÃÓÚÐèҪƾ֤Ìõ¼þɾ³ýÊý¾ÝÇÒÐèÒª±£´æundoÐÅÏ¢µÄÇéÐΡ£
OracleÊý¾Ý¿âɾ³ý±íÊý¾ÝÏÂÁî
truncate tableÏÂÁî
TRUNCATE TABLEÏÂÁîÊÇɾ³ýOracleÊý¾Ý¿â±íÖÐËùÓÐÊý¾ÝµÄ×î¿ìÒªÁì¡£Ëü±ÈDELETEÏÂÁî¿ì£¬ÓÉÓÚTRUNCATE TABLE²»¼Í¼ÈκÎundoÐÅÏ¢»ò´¥·¢Æ÷¡£
Óï·¨£º
TRUNCATE TABLE table_name;
µÇ¼ºó¸´ÖÆ
ʾÀý£º
TRUNCATE TABLE employees;
µÇ¼ºó¸´ÖÆ
´ËÏÂÁɾ³ý±íemployeesÖеÄËùÓÐÊý¾Ý¡£
DELETEÏÂÁî
DELETEÏÂÁîÓÃÓÚƾ֤Ìض¨Ìõ¼þ´Ó±íÖÐɾ³ýÊý¾Ý¡£
Óï·¨£º
DELETE FROM table_name WHERE condition;
µÇ¼ºó¸´ÖÆ
ʾÀý£º
DELETE FROM employees WHERE salary > 10000;
µÇ¼ºó¸´ÖÆ
´ËÏÂÁ´Ó±íemployeesÖÐɾ³ýËùÓÐÈËΪ´óÓÚ10000µÄÔ±¹¤Êý¾Ý¡£
½ÏÁ¿TRUNCATE TABLEºÍDELETEÏÂÁî
ËÙÂÊ£ºTRUNCATE TABLE±ÈDELETE¿ì£¬ÓÉÓÚËü²»¼Í¼undoÐÅÏ¢»ò´¥·¢Æ÷¡£
ÍêÕûÐÔ£ºTRUNCATE TABLE²»´¥·¢Èκδ¥·¢Æ÷»òÔ¼Êø£¬¶øDELETE´¥·¢¡£
»Ö¸´£ºTRUNCATE TABLE²»¿É»Ø¹ö£¬¶øDELETE¿ÉÒÔ¡£
ÈÕÖ¾¼Í¼£ºTRUNCATE TABLE²»±¬·¢ÈκÎÈÕÖ¾¼Í¼£¬¶øDELETE±¬·¢¡£
×î¼Ñʵ¼ù
ÔÚÒÔÏÂÇéÐÎÏÂʹÓÃTRUNCATE TABLE£º
µ±ÄúÐèÒª¿ìËÙɾ³ý±íÖеÄËùÓÐÊý¾Ýʱ¡£
µ±Äú²»ÐèÒª±£´æundoÐÅÏ¢»ò´¥·¢Æ÷ʱ¡£
ÔÚÒÔÏÂÇéÐÎÏÂʹÓÃDELETE£º
µ±ÄúÐèҪƾ֤Ìض¨Ìõ¼þɾ³ýÊý¾Ýʱ¡£
µ±ÄúÐèÒª´¥·¢´¥·¢Æ÷»òÔ¼Êøʱ¡£
µ±ÄúÐèÒª±£´æundoÐÅÏ¢ÒÔ¾ÙÐлָ´Ê±¡£
ÒÔÉϾÍÊÇoracleÊý¾Ý¿âɾ³ý±íÊý¾ÝÏÂÁîÊÇʲôµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡