database 还原数据库时,sql 命令行中的 NOUNLOAD 和 STATS 是什么意思?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/19444499/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-08 09:06:11  来源:igfitidea点击:

What does NOUNLOAD and STATS mean in sql command line when restoring a DB?

databasesql-server-2012restore

提问by RayofCommand

When i go to restore my database in SQL server 2012 i can let display the script or command line action as you know. What do these additional parameters do, Nounload and stats = 10.

当我在 SQL Server 2012 中恢复我的数据库时,我可以让显示脚本或命令行操作,如您所知。这些附加参数有什么作用,Nounload and stats = 10.

RESTORE DATABASE [db2] FROM  DISK = N'C:\folder\db2.bak' WITH  FILE = 1,  NOUNLOAD,  STATS = 10
GO

回答by steoleary

Stats = 10 indicates that it will show you in the messages section of SSMS the progress of the restore in increments of 10% e.g.

Stats = 10 表示它将在 SSMS 的消息部分以 10% 的增量向您显示恢复进度,例如

  • 10% complete
  • 20% complete
  • 30% complete
  • xx% complete.........
  • 10% 完成
  • 完成 20%
  • 完成 30%
  • xx% 完成......

Etc..

等等..

NOUNLOAD is a tape thing, if you are restoring from tape, specifying this will ensure that the tape is not unloaded from the drive once the restore is complete, if you're not restoring from a tape drive this option is ignored.

NOUNLOAD 是磁带的事情,如果您从磁带恢复,指定这将确保恢复完成后磁带不会从驱动器中卸载,如果您不是从磁带驱动器恢复,则忽略此选项。

Documentation for RESTORE is available here:

RESTORE 的文档可在此处获得:

TechNet: RESTORE

TechNet:恢复