如何使用多个文件还原事务日志

时间:2015-02-27 14:01:13

标签: sql-server tsql sql-server-2008-r2

我恢复数据库日志,如:

RESTORE LOG [paytrn] FROM  DISK = N'C:\backup\log.trn' WITH  FILE = 1,  NORECOVERY,  NOUNLOAD,  STATS = 100
GO
RESTORE LOG [paytrn] FROM  DISK = N'C:\backup\log.trn' WITH  FILE = 2,  NORECOVERY,  NOUNLOAD,  STATS = 100
GO

但是有很多文件,有没有办法在没有每个文件的写恢复的情况下恢复所有文件?类似的东西:

RESTORE LOG [paytrn] FROM  DISK = N'C:\backup\log.trn' WITH  FILE = ALL,  NORECOVERY,  NOUNLOAD,  STATS = 100

1 个答案:

答案 0 :(得分:1)

无法一次性恢复多个事务日志文件。它们是附加文件,必须从头到尾按顺序加载。不幸的是,它们不像差异备份那样起作用