Xin*_*Liu 5 sql-server restore
我有一个数据库,它有两个文件组(都是 r/w),每个文件组有两个文件。备份顺序是:
我在网上找到的指导是,要恢复file1,我需要恢复file1备份,然后前滚tlog集1-5和尾日志。
但是,假设我需要在最短的时间内恢复整个数据库,我可以使用以下序列:
Restore file1 filegroup1
restore tlog set2 --roll forward to file 2 backup
restore file2 filegroup1
restore tlog set3
restore file1 filegroup2
restore tlog set4
restore file2 filegroup2
restore tlog set5
restore tail
Run Code Online (Sandbox Code Playgroud)
我必须做吗
Restore file1 filegroup1
Restore tlog set2 -- roll forward to current time
Restore tlog set3
Restore tlog set4
Restore tlog set5
Restore tail
Restore file2 filegroup1
Restore tlog set2 -- roll forward to current time
Restore tlog set3
Restore tlog set4
Restore tlog set5
Restore tail
...
Run Code Online (Sandbox Code Playgroud)
在移动下一个文件之前使每个文件联机(或者甚至可能只是使用完整备份然后应用所有日志备份)?无法找到明确的答案。
另外,我是否有必要恢复初始完整备份,因为文件备份涵盖了整个数据库?
文档示例仅恢复一个文件组,即恢复完整文件备份,然后前滚每个日志,使文件组更新。我想知道的情况是,如果您要恢复多个文件备份,是否必须将每个文件前滚到现在,或者您可以恢复第一个文件备份,将事务日志滚动到第二个文件备份,然后前滚到现在。我想尽量减少必须应用日志备份的次数。
你写的第一个序列是正确的:
Restore file1 filegroup1
restore tlog set2 --roll forward to file 2 backup
restore file2 filegroup1
restore tlog set3
restore file1 filegroup2
restore tlog set4
restore file2 filegroup2
restore tlog set5
restore tail
Run Code Online (Sandbox Code Playgroud)
您无需将第一个文件、第二个文件等联机,因为您只需要在最短的时间内恢复整个数据库。
我刚刚尝试了第一个序列,因为我认为它是正确的并且有效。
然后我尝试从完整备份+所有日志文件中恢复,以查明它是否更快。当然我的数据库足够小,只是一个测试数据库,但是您可以尝试将您的数据库恢复到另一个数据库或以两种方式恢复到另一个服务器来比较时间。
归档时间: |
|
查看次数: |
250 次 |
最近记录: |