Ò»ÌõSQLɾ³ýËùÓбíÖÐÊý¾Ý
ÓÉÓÚ´¦ÓÚϵͳ¿ª·¢µÄºóÆÚ£¬ÐèÒª¸ø¿Í»§ÑÝʾ¡£·¢ÏÖ´óÁ¿µÄ±í£¬´æÔÚ´óÁ¿µÄ²âÊÔÊý¾Ý¡£ÐèÒªÇå³ý£¬ÓÓdelete from tablename” --> ÔÎËÀ¡£ºóÀ´·¢ÏÖ¾ÓÈ»ÓÐÕâôǿ´óµÄ¶«¶«¡£ £º£©
EXECUTE sp_msforeachtable 'delete from ?'
»òÕß
EXECUTE sp_msforeachtable 'truncate table ?'
* ÌرðÌáÐÑ£º
ɾ³ýµÄÊý¾ÝÊÇÎÞ·¨»Ö¸´µÄ£¬³ý·ÇÄãÏÈÇ°ÓÐbackup¡£
Ïà¹ØÎĵµ£º
ÆäʵÔÚÐÞ¸ÄÊý¾Ý¿âÃû³Æ֮ǰ£¬Èç¹ûÓÐÓû§Á¬½Óµ½Êý¾Ý¿âµÄ»°»áÔì³ÉÊý¾Ý¿âÖØÃüÃûʧ°Ü£¬¿ÉÒÔÏÈÖ´ÐÐ
select spid
from master.dbo.sysprocesses
where dbid=db_id('OldDbName')
½á¹û¼¯ÖÐÏÔʾµÄÊǵ±Ç°Á¬½Óµ½Êý¾Ý¿âOldDbNameµÄÁ¬½Ó
±ÈÈç½á¹ûÊÇ
79
81
µ±È»£¬Êµ¼ÊÖµÓ¦¸Ã²»ÊÇÕâÁ½¸ö
È»ºóÖ´ÐÐ
kill 79
kill 81
¹Ø±ÕÒѽ¨Á¢ ......
========µÚһƪ=========
ÔÚÒ»ÕűíÖÐij¸ö×Ö¶ÎÏÂÃæÓÐÖظ´¼Ç¼£¬Óкܶ෽·¨£¬µ«ÊÇÓÐÒ»¸ö·½·¨£¬ÊDZȽϸßЧµÄ£¬ÈçÏÂÓï¾ä£º
select data_guid from adam_entity_datas a where a.rowid > (select min(b.rowid) from adam_entity_datas b where b.data_guid = a.data_guid)
Èç¹û±íÖÐÓдóÁ¿Êý¾Ý£¬µ«ÊÇÖظ´Êý¾Ý±È½ÏÉÙ£¬ÄÇô ......
sql server·Ö²¼Ê½ÊÂÎñ½â¾ö·½°¸
ÊÊÓû·¾³
²Ù×÷ϵͳ£ºwindows 2003
Êý¾Ý¿â£ºsql server 2000/sql server 2005
ʹÓÃÁ´½Ó·þÎñÆ÷½øÐÐÔ¶³ÌÊý¾Ý¿â·ÃÎʵÄÇé¿ö
Ò»¡¢ ÎÊÌâÏÖÏó
ÔÚÖ´Ðзֲ¼Ê½ÊÂÎñʱ£¬ÔÚsql server 2005ÏÂÊÕµ½ÈçÏ´íÎó£º
ÏûÏ¢ 7391£¬¼¶±ð 16£¬×´Ì¬ 2£¬¹ý³Ì xxxxx£¬µÚ 16 ÐÐ
ÎÞ·¨Ö´ÐиòÙ×÷£¬ÒòΪÁ´½Ó·þÎñ ......
ORACLE sql µÄ´¦Àí¹ý³Ì´óÖÂÈçÏ£º
1.ÔËÓÃHASHËã·¨£¬µÃµ½Ò»¸öHASHÖµ£¬Õâ¸öÖµ¿ÉÒÔͨ¹ýV$SQLAREA.HASH_VALUE ²é¿´
2.µ½shared pool ÖÐµÄ library cache ÖвéÕÒÊÇ·ñÓÐÏàͬµÄHASHÖµ£¬Èç¹û´æÔÚ£¬ÔòÎÞÐèÓ²½âÎö£¬½øÐÐÈí½âÎö
3.Èç¹ûshared pool²»´æÔÚ´ËHASHÖµ£¬Ôò½øÐÐÓï·¨¼ì²é£¬²é¿´ÊÇ·ñÓÐÓï·¨´íÎó
&nbs ......
(1)SEQNAME.NEXTVALÀïÃæµÄÖµÈçºÎ¶Á³öÀ´£¿¿ÉÒÔÖ±½ÓÔÚinsert into test values(SEQNAME.NEXTVAL) ÊÇ¿ÉÒÔÓà ÕâÑù£º
SELECT tmp#_seq.NEXTVAL
INTO id_temp
from DUAL; È»ºó¿ÉÒ ......