SQL Server:如果我没有为 RESTORE DATABASE 指定 RECOVERY 模式,默认值是什么?

发布于 2024-12-08 12:13:24 字数 437 浏览 0 评论 0原文

来自: http://msdn.microsoft.com/en-us/library/ms187495 .aspx

示例:

--恢复常规日志备份(从备份集2)。

RESTORE LOG AdventureWorks2008R2
FROM DISK = 'Z:\SQLServerBackups\AdventureWorks2008R2FullRM.bak'
WITH FILE=2, 
NORECOVERY;

我的问题:如果我不指定 NORECOVERY,它会是默认值吗?我有很多以这种方式迁移的数据库,但我不确定如何判断使用了哪种恢复模型。

谢谢

From: http://msdn.microsoft.com/en-us/library/ms187495.aspx

Example:

--Restore the regular log backup (from backup set 2).

RESTORE LOG AdventureWorks2008R2
FROM DISK = 'Z:\SQLServerBackups\AdventureWorks2008R2FullRM.bak'
WITH FILE=2, 
NORECOVERY;

My question: If I don't specify NORECOVERY, will it be the default? I have a bunch of databases that were migrated in this fashion and I'm not sure how to tell which recovery model was used.

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

风和你 2024-12-15 12:13:24

恢复是默认设置。请参阅 RESTORE 命令的文档,其中指出:

RECOVERY 和 NORECOVERY 的比较

回滚由 RESTORE 语句通过 [ 控制
恢复| NORECOVERY] 选项:

NORECOVERY 指定不发生回滚。这允许滚动
前进以继续序列中的下一条语句。

在这种情况下,恢复顺序可以恢复其他备份并滚动
他们向前。

RECOVERY(默认值)表示应执行回滚
当前备份完成前滚后。

恢复数据库需要整组数据
恢复(前滚集)与数据库一致。如果
前滚集尚未前滚足够远,无法
与数据库一致并且指定了RECOVERY,数据库
引擎发出错误。

RECOVERY is the default. See the documentation for the RESTORE command, which states:

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文