作者qrtt1 (愚人)
看板Database
标题Re: [系统] 如何回复 MSSQL 2005 的资料库
时间Wed Jan 16 11:06:10 2008
※ 引述《qrtt1 (愚人)》之铭言:
: FROM DISK = N'D:\MyDB\MyDB_backup_200711151513.bak' WITH REPLACE
: 做了完整备份的回复, 接着使用
: RESTORE DATABASE [MyDB]
: FROM DISK = N'D:\MyDB\MyDB_backup_200712140155.bak' WITH NORECOVERY
: 执行差异回复时出现了错误讯息
後来我发现改成
RESTORE DATABASE [MyDB]
FROM DISK = N'D:\MyDB\MyDB_backup_FULL.bak' WITH NORECOVERY, REPLACE
接着
RESTORE DATABASE [MyDB]
FROM DISK = N'D:\MyDB\MyDB_backup_DIFF.bak' WITH NORECOVERY
就可以了.
不过我对於 RECOVERY 与 NORECOVERY 的意义不很了解
==============
http://msdn2.microsoft.com/en-us/library/ms186858.aspx
#restoring_full_n_differential_db_backups
Comparison of RECOVERY and NORECOVERY
Roll back is controlled by the RESTORE statement through the [ RECOVERY |
NORECOVERY ] options:
* NORECOVERY specifies that roll back not occur. This allows roll forward
to continue with the next statement in the sequence.
In this case, the restore sequence can restore other backups and roll
them forward.
* RECOVERY (the default) indicates that roll back should be performed
after roll forward is completed for the current backup.
Recovering the database requires that the entire set of data being
restored (the roll forward set) is consistent with the database. If the roll
forward set has not been rolled forward far enough to be consistent with the
database and RECOVERY is specified, the Database Engine issues an error.
不知道我是不是要在最後一个 DIFF 的备份使用 RECOVERY ?
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 220.128.219.202