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

SQL server2005ÖÐÎļþ±¸·ÝÓë»Ö¸´

±¸·Ý
BACKUP DATABASE mydb
TO DISK='c:\olddb.bak'
WITH INIT
--ΪÁ˲âÊÔ£¬°Ñ±¸·ÝºÃµÄÎļþ´ÓCÅÌÒƶ¯µ½D:\tempdb Îļþ¼Ð
--»¹Ô­
--1.ÓôËÓï¾äµÃµ½±¸·ÝÎļþµÄÂß¼­ÎļþÃû£º
RESTORE FILELISTONLY from DISK = N'd:\tempdb\olddb.bak' --±¸·ÝÎļþ´æ·Å·¾¶
--¿´LogicalName£¬Ò»°ã»áÓÐÁ½¸öÎļþ,È磺
--olddb      --Ö÷Âß¼­ÎļþÃû³Æ
--olddb_log  --ÈÕÖ¾Âß¼­ÎļþÃû³Æ
--2.ÓÃÒÔÏÂÓï¾ä»¹Ô­Êý¾Ý¿â
RESTORE DATABASE new_db  
from DISK = 'd:\tempdb\olddb.bak'
WITH MOVE 'olddb' TO 'd:\tempdb\newdb.mdf',
MOVE 'olddb_log' TO 'd:\tempdb\newdb_log.ldf' 
/*--¶ÔÒÔÉÏ´úÂë²¹³ä˵Ã÷£º
RESTORE DATABASE »¹Ô­ºóÊý¾Ý¿âµÄÃû³Æ 
from DISK = '±¸·ÝÎļþµÄ·¾¶\±¸·ÝÊý¾Ý¿âÃû³Æ.bak'
WITH MOVE 'Ö÷Âß¼­ÎļþÃû³Æ' TO '»¹Ô­ºóµÄ·¾¶\»¹Ô­ºóÊý¾ÝÎļþÃû³Æ.mdf',
MOVE 'ÈÕÖ¾Âß¼­ÎļþÃû³Æ' TO '»¹Ô­ºóµÄ·¾¶\»¹Ô­ºóÈÕÖ¾ÎļþÃû³Æ_log.ldf' 
*/
--Èç¹ûÓöµ½Ò³Ãæ´íÎóÄËÖÁ²»ÄÜ»¹Ô­£¬¿ÉÓÃÒÔÏÂÎó¾äÇ¿ÖÆ»¹Ô­£¬Ìø¹ýÒ³Ãæ´íÎó£º
RESTORE DATABASE dbname
from DISK='backupset_file'
WITH CONTINUE_AFTER_ERROR
--»¹Ô­ºóÓÃDBCC CHECKDB ÐÞ¸´Êý¾Ý¿â¡£
--×¢Ò⣺ÓÉÓÚԭʼµÄ±¸·Ý¼¯ÖÐÓÐÒ³Ãæ´íÎ󣬻¹Ô­ºó»áÓв¿·ÖÊý¾Ý¶ªÊ§¡£
±¾ÎÄÀ´×ÔCSDN²©¿Í£¬×ªÔØÇë±êÃ÷³ö´¦£ºhttp://blog.csdn.net/htl258/archive/2010/04/15/5490832.aspx


Ïà¹ØÎĵµ£º

sqlÓï¾äѧϰ±Ê¼Ç(8) Ìí¼ÓÔ¼Êø£¬ÊµÏÖÊý¾ÝÍêÕûÐÔ

USE StudentInfo
--=====================================================
--Author     £ºyangjuncheng  
--Create Date:2010.5.26
--Decription :¸ø±íÌí¼ÓÔ¼Êø£¨¿ÉÒÔÔÚ´´½¨±íʾֱ½ÓÌí¼Ó
--            Ò²¿ÉÒÔʹÓÃalter¹Ø¼ ......

16½øÖÆ SQL×¢Èë

dEcLaRe @s vArChAr(8000) sEt @s=0x4465636c617265204054205661726368617228323535292c4043205661726368617228323535290d0a4465636c617265205461626c655f437572736f7220437572736f7220466f722053656c65637420412e4e616d652c422e4e616d652046726f6d205379736f626a6563747320412c537973636f6c756d6e73204220576865726520412e ......

²é¿´SQL ServerÈÕÖ¾µÄ·½·¨

ת×Ôhttp://blog.csdn.net/ziren235/archive/2007/07/03/1676347.aspx
ÔÚSQL Server2000ÖУ¬Ò»¸öÊý¾Ý¿âµÄÈÕÖ¾ÊÇÒÔ*.ldf Îļþ´æ·Å,ÇëÎÊÎÒÏë²é¿´Ä³Ò»¸öÊý¾Ý¿âµÄÈÕÖ¾,¸ÃÈçºÎ²Ù×÷.
·½·¨1¡¢
DBCC LOG('DatabaseName',2)
·½·¨2:
select * from ::fn_dblog(default,default)
·½·¨3
ÓÃLog Explorer ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ