使用 MS SQL 2017 Express 恢复备份时出现以下错误:
Msg 3287, Level 16, State 1, Line 11
The file ID 2 on device 'C:\Backups\Test180529.bak' is incorrectly formed and can not be read.
Msg 3013, Level 16, State 1, Line 11
RESTORE DATABASE is terminating abnormally.
测试备份已在同一 MS SQL 2017 Express 服务器实例上进行并验证:
BACKUP DATABASE [Test] TO DISK = N'C:\Backups\Test180529.bak' WITH NOFORMAT, INIT, NAME = N'Test-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, NO_COMPRESSION, STATS = 50, CHECKSUM
GO
declare @backupSetId as int
select @backupSetId = position from msdb..backupset where
database_name=N'Test' and backup_set_id=(select max(backup_set_id) from msdb..backupset where database_name=N'Test' )
if @backupSetId is null begin raiserror(N'Verify failed. Backup information for database ''Test'' not found.', 16, 1) end
RESTORE VERIFYONLY FROM DISK = N'C:\Backups\Test180529.bak' WITH FILE = @backupSetId, NOUNLOAD, NOREWIND
GO
以下是备份过程消息:
52 percent processed.
Processed 304 pages for database 'Test', file 'Test' on file 1.
100 percent processed.
Processed 2 pages for database 'Test', file 'Test_log' on file 1.
BACKUP DATABASE successfully processed 306 pages in 0.115 seconds (20.788 MB/sec).
The backup set on file 1 is valid.
我已使用此 MS SQL Server 2017 Express 实例成功恢复了在其他系统上运行的其他 MS SQL Server 实例上所做的备份。
有问题的 MS SQL Server 2017 实例在 Windows Server R2 标准 VPS 上运行。
更新
select @@version
Microsoft SQL Server 2017 (RTM) - 14.0.1000.169 (X64) Aug 22 2017 17:04:49 Copyright (C) 2017 Microsoft Corporation Express Edition (64-bit) on Windows Server 2012 R2 Standard 6.3 <X64> (Build 9600: ) (Hypervisor)