oracle sql µÄÓï¾ä
delete ɾ³ýÒ»ÕÅ´ó±íʱ¿Õ¼ä²»ÊÍ·Å£¬·Ç³£ÂýÊÇÒòΪռÓôóÁ¿µÄϵͳ×ÊÔ´£¬Ö§³Ö»ØÍ˲Ù×÷£¬¿Õ¼ä»¹±»ÕâÕűíÕ¼ÓÃ×Å¡£
truncate table ±íÃû (ɾ³ý±íÖмǼʱÊͷűí¿Õ¼ä)
DML Óï¾ä£º
±í¼¶¹²ÏíËø£º ¶ÔÓÚ²Ù×÷Ò»ÕűíÖеIJ»Í¬¼Ç¼ʱ£¬»¥²»Ó°Ïì
Ðм¶ÅÅËüËø£º¶ÔÓÚÒ»ÐмǼ£¬oracle »áÖ»ÔÊÐíÖ»ÓÐÒ»¸öÓû§¶ÔËüÔÚͬһʱ¼ä½øÐÐÐ޸IJÙ×÷
wait() µÈµ½Ðм¶Ëø±»ÊÍ·Å£¬²Å½øÐÐÊý¾Ý²Ù×÷
dropÒ»ÕűíʱҲ»á¶Ô±í¼ÓËø£¬DDLÅÅËüËø,ËùÒÔÔÚɾ³ýÒ»ÕűíʱÈç¹ûµ±Ç°»¹ÓÐÓû§²Ù×÷±íʱ²»ÄÜɾ³ý±í
alter table ÃüÁîÓÃÓÚÐ޸ıíµÄ½á¹¹(ÕâЩÃüÁî²»»á¾³£ÓÃ)£º
Ôö¼ÓÔ¼Êø£º
alter table ±íÃû add constraint ¡¡Ô¼ÊøÃû primary key (×ֶΣ©;
½â³ýÔ¼Êø£º(ɾ³ýÔ¼Êø)
alter table ±íÃû drop primary key£¨¶ÔÓÚÖ÷¼üÔ¼Êø¿ÉÒÔÖ±½ÓÓô˷½·¨£¬ÒòΪһÕűíÖÐÖ»ÓÐÒ»¸öÖ÷¼üÔ¼ÊøÃû, ×¢ÒâÈç¹ûÖ÷¼ü´Ëʱ»¹ÓÐÆäËü±íÒýÓÃʱɾ³ýÖ÷¼üʱ»á³ö´í£©
alter tbale father drop primary key cascade ; (Èç¹ûÓÐ×Ó±íÒýÓÃÖ÷¼üʱ£¬ÒªÓôËÓï·¨À´É¾³ýÖ÷¼ü,Õâʱ×Ó±í»¹´æÔÚÖ»ÊÇ×Ó±íÖеÄÍâ¼üÔ¼Êø±»¼°ÁªÉ¾³ýÁË£©
alter table ±íÃû drop constraint Ô¼ÊøÃû;
(ÔõÑùÈ¡Ò»¸öÔ¼ÊøÃû£º1¡¢ÈËΪµÄÎ¥·´Ô¼Êø¹æ¶¨¸ù¾Ý´íÎóÐÅÏ¢»ñÈ¡!
2¡¢²éѯʾͼ»ñÈ¡Ô¼ÊøÃû!)
alter table ±íÃû disable from primary key ; (Ï൱ÓÚ°ÑÒ»¸ö±íµÄÖ÷¼ü½ûÓÃ)
alter table ±íÃû enable primary key ;£¨enable ʱ»á×Ô¶¯È¥¼ì²é±íµÄ¼Ç¼ÊDz»ÊÇ·ûºÏÒªÇó,Èç¹ûÓÐÔàÊý¾Ýʱ±ØÐëÒªÏÈɾ³ýÔàÊý¾Ý²Å¿ÉÒÔ enable£©
*******************************************************************
Ôö¼Ó×ֶΣº
alter table ¡¡¡¡±íÃû¡¡¡¡¡¡add(×Ö¶Î×Ö ×Ö¶ÎÀàÐÍ)
ɾ³ý×ֶΣº
alter table ¡¡¡¡±íÃû drop(×Ö¶Î)
alter tbale ±íÃû drop column ×ֶΠ; (8i ÒÔºó²ÅÖ§³Ö£©
¸øÁиÄÃû:920²ÅÖ§³Ö
alter table ±íÃû rename column ¾É×Ö¶ÎÃû to ÐÂ×Ö¶ÎÃû;
ÐÞ¸Ä×Ö¶Î
(´ËʱӦעÒâµÄÎÊÌ⣬¸ü¸ÄʱҪ¿´¾ßÌåÖµÇé¿öÖ®¼äµÄת´ï»»£¬¡¡¸ÄΪ×Ö·ûÀàÐÍʱ£¬±ØÐëҪΪ¿Õ)
alter table ¡¡±íÃû modify( ×ֶΣ¬ÀàÐÍ)
¸ü¸Ä±íÖеÄ×ֶΣº
update ±íÃû set ×ֶΠ£½ Öµ where Ìõ¼þ
¸ü¸Ä±íÃû
rename ¾É±íÃû to ¡¡ ¡¡Ð±íÃû £»
ɾ³ý±í£º
trucate table ±íÃû:(±í½á¹¹»¹ÔÚ£¬Êý¾ÝÈ«²¿É¾³ý£¬ÊͷűíËùÕ¼µÄ¿Õ¼ä£¬²»Ö§³Ö»ØÍË,³£ÓÃɾ³ý´ó±í£©
¹ØÓÚoralceÖвúÉúÐòÁÐ(sequence):
create sequence ÐòÁÐÃûalter system flush shared_pool;
(²»´ø²ÎÊýʱĬÈÏΪ´Ó1 ¿ªÊ¼Ã¿´ÎµÝÔö 1£¬o
Ïà¹ØÎĵµ£º
ÔÚ¿ª·¢¹ý³Ì³öÏÖÕâôһ¸öÎÊÌ⣺
±ÈÈ磺һ¸ö×Ö¶Îcontent ÀàÐÍCLOB£¬ÕâÆäÖдæµÄÓпÉÄܸ´ÖÆÕ³Ìù¹ýÀ´µÄword excel htmlÖеÄÄÚÈÝ£¬ÓÃjava½«ÕâЩÄÚÈÝ´æÈ룬´æÈëºóÓÐÌØÊâµÄ·ûºÅ ±ÈÈç»Ø³µ»»Ðеȡ£ÄÇô²»ÄÜÕý³£Õ¹Ê¾µÄÊý¾Ý¡£
½â¾ö·½°¸£º
´æÈëÊý¾ÝµÄÊǽ«Õâ¸öÊý¾ÝcontentdataÔÚjsÖнøÐÐ
......
ÎÊÌâÃèÊö£º
µ±Êý¾Ý¿âµÄ×Ö·û¼¯ÎªÖÐÎÄʱ£¬timestampÀàÐ͵Ä×Ö¶ÎΪÒÔϸñʽ£º
04-3ÔÂ -10 03.57.41.631000 ÏÂÎç
ÎÒÔÚÓÃJDOM½«Êý¾Ýµ¼³öΪXMLʱ£¬timestampÀàÐÍ×ֶεÄÖµ·´ÉúÁ˱仯£¬±ä³ÉÁËһϸñʽ
<CREATE_DATE>2010-3-4.15.57. 30. 505000000</CREATE_DATE>
½â¾ö·½°¸£º
ÔÚ²éѯ¸Ã×Ö¶ÎʱÊ×ÏÈÓÃto_char£¨£©º¯Êý½ ......
author£ºskate
time£º2010/03/04
oracleÊý¾Ý¿â¼¶±ðÓÅ»¯·ÖÎö¹¤¾ß½éÉÜ
µ±ÎÒÃǶÔÊý¾Ý¿âÓÅ»¯Õï¶Ïʱ£¬ÐèÒªÊÕ¼¯ÏàÓ¦µÄÐÅÏ¢ÒÔ¹©²Î¿¼£¬´Ó¸öÈ˵ÄʹÓþÑéÀ´Ëµ£¬ÕâÖÖͳ¼ÆÊý¾Ý·ÖΪÁ½´óÀà
Ò»ÀàÊÇÊý¾Ý¿â¼¶±ðµÄͳ¼ÆÐÅÏ¢
¶þÀàÊÇos¼¶±ðµÄͳ¼ÆÐÅÏ¢
ÏÂÃæ¾Í·Ö±ð½éÉÜÔÚ²»Í¬µÄ¼¶±ðÏ£¬³£ÓÃʲô¹¤¾ßÀ´ÊÕ¼¯ÐÅÏ¢°ïÖúÓÅ»¯Õï¶Ï
Ê×ÏÈÊÇoracleÊý¾ ......
¿Í»§·´Ó³³ÌÐòºÜÂý£¬¿ªÊ¼ÒÔΪÊý¾ÝÁ¿´ó£¬ÔÚ±íÖвéѯʹÓõÄ×Ö¶ÎÉÏ£¬Ìí¼ÓÁËË÷Òý£¬Ã»ÓÐÃ÷ÏÔµÄЧ¹û£¬¼ì²éʱ·¢ÏÖÒÔÇ°µÄͬÊÂÔÚsql serverÖÐдµÄº¯ÊýÖÐʹÓÃÁËin£¬¶øÔÚinµÄ½á¹û¼¯ÖлáÓÐ2500Ìõ¼Ç¼×óÓÒ£¬Ö´ÐÐʱ¼äÐèÒª13Ãë¡£ÕÒµ½ÎÊÌâ¸ùÔ´£¬
Ð޸ķ½·¨£º °ÑinºóÃæµÄ×Ó²éѯ×÷Ϊһ¸ö±íºÍÖ÷±í¹ØÁª£¬Ìí¼ÓÏÞÖÆÌõ¼þ¡£
ÔÀ´Ð´·¨£º select * fro ......
Ôںܶà±à³ÌÓïÑÔÖж¼ÓÐ forÑ»·ÕâÑùµÄ¶«Î÷¡£ÔÚÊý¾Ý¿âÀïÃæ Ìæ´úËûÊÇ Óαê
µ«ÊÇÓαêʹÓÃÆðÀ´ÊÇÏ൱ºÄ·Ñ×ÊÔ´µÄ£¬½ñÌì¿´¼ûÒ»¸öCTE³¢ÊÔÁËÏÂËûµÄÓ÷¨
create table employewhere
(
id int identity(1,1),
[name] varchar(10),
[value] varchar(10),
[ttime] int
)
insert employewhere
select ......