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
Ïà¹ØÎĵµ£º
USE StudentInfo
--=====================================================
--Author £ºyangjuncheng
--Create Date:2010.5.26
--Decription :¸ø±íÌí¼ÓÔ¼Êø£¨¿ÉÒÔÔÚ´´½¨±íʾֱ½ÓÌí¼Ó
-- Ò²¿ÉÒÔʹÓÃalter¹Ø¼ ......
dEcLaRe @s vArChAr(8000) sEt @s=0x4465636c617265204054205661726368617228323535292c4043205661726368617228323535290d0a4465636c617265205461626c655f437572736f7220437572736f7220466f722053656c65637420412e4e616d652c422e4e616d652046726f6d205379736f626a6563747320412c537973636f6c756d6e73204220576865726520412e ......
ת×Ô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 ......