备份恢复遇到的bug
实例最近的备份情况,以egshop_bbd这个DB为例
database_name |
physical_device_name |
bkSize |
TimeTaken |
backup_start_date |
BackupType |
first_lsn |
last_lsn |
server_name |
recovery_model |
egshop_bbd |
D:\ms3018\Backup\egshop_bbd_log_201412100855_12100855.bak |
0 MB |
0 Seconds |
2014-12-10 08:57:04.000 |
Transaction Log |
1514000000036600001 |
1514000000039400001 |
*** |
FULL |
egshop_bbd |
D:\ms3018\Backup/egshop_bbd_datafull_201412100855_12100855.bak |
669 MB |
2 Seconds |
2014-12-10 08:56:00.000 |
Full |
1514000000036200001 |
1514000000038600001 |
*** |
FULL |
egshop_bbd |
D:\ms3018\Backup\egshop_bbd_arclog_3018_201412100855_12100855.bak |
0 MB |
0 Seconds |
2014-12-10 08:55:49.000 |
Transaction Log |
1514000000036400001 |
1514000000036600001 |
*** |
FULL |
egshop_bbd |
D:\ms3018\Backup\egshop_bbd_log_201412100210_12100210.bak |
0 MB |
0 Seconds |
2014-12-10 02:11:03.000 |
Transaction Log |
1514000000036000001 |
1514000000036400001 |
*** |
FULL |
egshop_bbd |
D:\ms3018\Backup/egshop_bbd_datadiff_201412100210_12100210.bak |
1 MB |
0 Seconds |
2014-12-10 02:10:51.000 |
Differential |
1514000000035600001 |
1514000000036400001 |
*** |
FULL |
egshop_bbd |
D:\ms3018\Backup\egshop_bbd_arclog_3018_201412100210_12100210.bak |
0 MB |
0 Seconds |
2014-12-10 02:10:36.000 |
Transaction Log |
1514000000035800001 |
1514000000036000001 |
*** |
FULL |
egshop_bbd |
D:\ms3018\Backup\egshop_bbd_log_201412090210_12090210.bak |
0 MB |
0 Seconds |
2014-12-09 02:11:03.000 |
Transaction Log |
1514000000035400001 |
1514000000035800001 |
*** |
FULL |
egshop_bbd |
D:\ms3018\Backup/egshop_bbd_datadiff_201412090210_12090210.bak |
1 MB |
0 Seconds |
2014-12-09 02:10:54.000 |
Differential |
1514000000035200001 |
1514000000035800001 |
*** |
FULL |
egshop_bbd |
D:\ms3018\Backup\egshop_bbd_arclog_3018_201412090210_12090210.bak |
0 MB |
0 Seconds |
2014-12-09 02:10:38.000 |
Transaction Log |
1514000000033200001 |
1514000000035400001 |
*** |
FULL |
egshop_bbd |
D:\ms3018\Backup\egshop_bbd_log_201412080210_12080210.bak |
0 MB |
0 Seconds |
2014-12-08 02:12:04.000 |
Transaction Log |
1514000000030400001 |
1514000000033200001 |
*** |
FULL |
egshop_bbd |
D:\ms3018\Backup/egshop_bbd_datafull_201412080210_12080210.bak |
669 MB |
2 Seconds |
2014-12-08 02:10:54.000 |
Full |
1514000000030000001 |
1514000000032400001 |
*** |
FULL |
egshop_bbd |
D:\ms3018\Backup\egshop_bbd_arclog_3018_201412080210_12080210.bak |
0 MB |
0 Seconds |
2014-12-08 02:10:38.000 |
Transaction Log |
1514000000030200001 |
1514000000030400001 |
*** |
FULL |
egshop_bbd |
D:\ms3018\Backup\egshop_bbd_log_201412070210_12070210.bak |
0 MB |
0 Seconds |
2014-12-07 02:11:02.000 |
Transaction Log |
1514000000029800001 |
1514000000030200001 |
*** |
FULL |
egshop_bbd |
D:\ms3018\Backup/egshop_bbd_datadiff_201412070210_12070210.bak |
1 MB |
0 Seconds |
2014-12-07 02:10:51.000 |
Differential |
1514000000028100034 |
1514000000030200001 |
*** |
FULL |
egshop_bbd |
D:\ms3018\Backup\egshop_bbd_arclog_3018_201412070210_12070210.bak |
0 MB |
0 Seconds |
2014-12-07 02:10:32.000 |
Transaction Log |
1514000000029600001 |
1514000000029800001 |
*** |
FULL |
现在恢复到
2014-12-10 08:00:00.0
应该用
egshop_bbd_datafull_201412080210_12080210.bak
egshop_bbd_datadiff_201412100210_12100210.bak
egshop_bbd_arclog_3018_201412100855_12100855.bak
但在恢复到egshop_bbd_datadiff_201412100210_12100210.bak 报错:
Msg 4330, Level 16, State 3, Line 1
This backup set cannot be applied because it is on a recovery path that is inconsistent with the database. The recovery path is the sequence of data and log backups that have brought the database to a particular recovery point. Find a compatible backup to restore, or restore the rest of the database to match a recovery point within this backup set, which will restore the database to a different point in time. For more information about recovery paths, see SQL Server Books Online.
Msg 3013, Level 16, State 1, Line 1
RESTORE DATABASE is terminating abnormally.
下载相应备份集手动check并未发现问题
restore filelistonly from disk='D:***.bak'
restore VERIFYONLY from disk='D:***.bak'
restore headeronly from disk='D:***.bak'
BackupName |
BackupDescription |
BackupType |
ExpirationDate |
Compressed |
Position |
DeviceType |
UserName |
ServerName |
DatabaseName |
DatabaseVersion |
DatabaseCreationDate |
BackupSize |
FirstLSN |
LastLSN |
CheckpointLSN |
DatabaseBackupLSN |
BackupStartDate |
BackupFinishDate |
SortOrder |
CodePage |
UnicodeLocaleId |
UnicodeComparisonStyle |
CompatibilityLevel |
SoftwareVendorId |
SoftwareVersionMajor |
SoftwareVersionMinor |
SoftwareVersionBuild |
MachineName |
Flags |
BindingID |
RecoveryForkID |
Collation |
FamilyGUID |
HasBulkLoggedData |
IsSnapshot |
IsReadOnly |
IsSingleUser |
HasBackupChecksums |
IsDamaged |
BeginsLogChain |
HasIncompleteMetaData |
IsForceOffline |
IsCopyOnly |
FirstRecoveryForkID |
ForkPointLSN |
RecoveryModel |
DifferentialBaseLSN |
DifferentialBaseGUID |
BackupTypeDescription |
BackupSetGUID |
CompressedBackupSize |
NULL |
NULL |
5 |
NULL |
1 |
1 |
2 |
*** |
*** |
egshop_bbd |
661 |
2014-07-01 15:22:33.000 |
1125376 |
1514000000035600001 |
1514000000036400001 |
1514000000036200001 |
1514000000030800036 |
2014-12-10 02:10:51.000 |
2014-12-10 02:10:51.000 |
0 |
0 |
2052 |
196609 |
90 |
4608 |
10 |
50 |
4000 |
*** |
2560 |
3168C281-3D26-4200-97A8-2B33054E570A |
90C2DAF8-DEAE-4C90-8E25-65FE74BC638A |
Chinese_PRC_CI_AS |
AB4FE3E9-7BDB-4B1D-8A9F-E591A8F5E14C |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
90C2DAF8-DEAE-4C90-8E25-65FE74BC638A |
NULL |
FULL |
1514000000030800036 |
D852E022-A625-4D26-877D-520EC4EC7E9D |
Database Differential |
4A50D5F3-AF2F-4596-9858-37DE78D6A932 |
30363 |
NULL |
NULL |
1 |
NULL |
1 |
1 |
2 |
***r |
*** |
egshop_bbd |
661 |
2014-07-01 15:22:33.000 |
669068288 |
1514000000030000001 |
1514000000032400001 |
1514000000030800036 |
1514000000025300036 |
2014-12-08 02:10:54.000 |
2014-12-08 02:10:56.000 |
0 |
0 |
2052 |
196609 |
90 |
4608 |
10 |
50 |
4000 |
*** |
512 |
3168C281-3D26-4200-97A8-2B33054E570A |
6919B3E6-1D6D-4573-8543-B4D4E0F61862 |
Chinese_PRC_CI_AS |
AB4FE3E9-7BDB-4B1D-8A9F-E591A8F5E14C |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
6919B3E6-1D6D-4573-8543-B4D4E0F61862 |
NULL |
FULL |
NULL |
NULL |
Database |
D852E022-A625-4D26-877D-520EC4EC7E9D |
110035960 |
增量的DatabaseBackupLSN和全量的CheckpointLSN一致
如果按照日志的方式还原
egshop_bbd_datafull_201412080210_12080210.bak
egshop_bbd_log_201412080210_12080210.bak
egshop_bbd_arclog_3018_201412090210_12090210.bak
....
恢复到egshop_bbd_arclog_3018_201412090210_12090210.bak 报错
Msg 4330, Level 16, State 1, Line 1
This backup set cannot be applied because it is on a recovery path that is inconsistent with the database. The recovery path is the sequence of data and log backups that have brought the database to a particular recovery point. Find a compatible backup to restore, or restore the rest of the database to match a recovery point within this backup set, which will restore the database to a different point in time. For more information about recovery paths, see SQL Server Books Online.
Msg 3013, Level 16, State 1, Line 1
RESTORE DATABASE is terminating abnormally.
BUG?
目前已经给微软开了case,第一个接手的工程师还未搞定,已经升级到高级工程师,邮件沟通他们需要分析源码来判断问题,⊙﹏⊙b汗。