合 设备XXX上的文件 ID 1 的格式不正确,无法读取
Tags: 故障处理MSSQLSQL Server
现象
还原数据库时,报错:
分析
1 2 3 4 5 6 7 8 9 | -- 检查该备份文件的完整性(大文件较慢) restore verifyonly from disk=N'E:\backup\XXXX.bak'; -- 读取文件头部信息 restore headeronly from disk=N'E:\backup\XXXX.bak'; -- 读取标签信息 restore labelonly from disk=N'E:\backup\XXXX.bak'; |
使用 RESTORE VERIFYONLY
命令可以验证备份文件的完整性,而无需实际还原数据库。这对于在还原数据库之前检查备份文件是否可用或完整非常有用。如果验证成功,将显示一条消息表明备份文件是有效的,可以进行还原。如果验证失败,将显示相关错误消息,指示备份文件存在问题或损坏。
使用 RESTORE HEADERONLY
命令可以获取备份文件的元数据信息(于读取备份文件的头部信息,包括备份类型、数据库名称、备份开始和结束时间等。),而无需实际还原数据库。这对于查看备份文件的基本属性和验证备份文件是否正确以及备份的数据库信息非常有用。命令执行后,将返回包含备份文件头部信息的结果集,您可以从中获取有关备份文件的详细信息。
使用 RESTORE LABELONLY
命令可以检索备份文件的标签信息(。备份文件的标签信息包括备份软件、备份的日期和时间、备份类型等。),而无需实际还原数据库。这对于查看备份文件的元数据和备份文件的基本属性非常有用。命令执行后,将返回包含备份文件标签信息的结果集,您可以从中获取备份文件的相关详细信息。
备份文件有效
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | 文件 1 上的备份集有效。 完成时间: 2023-05-30T09:20:11.9832502+08:00 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 Containment -------------------------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---------- ----------------------- ---------- -------- ---------- -------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------- --------------- ----------------------- -------------------- --------------------------------------- --------------------------------------- --------------------------------------- --------------------------------------- ----------------------- ----------------------- --------- -------- --------------- ---------------------- ------------------ ---------------- -------------------- -------------------- -------------------- -------------------------------------------------------------------------------------------------------------------------------- ----------- ------------------------------------ ------------------------------------ -------------------------------------------------------------------------------------------------------------------------------- ------------------------------------ ----------------- ---------- ---------- ------------ ------------------ --------- -------------- --------------------- -------------- ---------- ------------------------------------ --------------------------------------- ------------------------------------------------------------ --------------------------------------- ------------------------------------ -------------------------------------------------------------------------------------------------------------------------------- ------------------------------------ -------------------- ----------- lhrdb-完整 数据库 备份 NULL 1 NULL 0 1 2 sa HF-SERVER79\MYSQLEXPRESS lhrdb 782 2023-03-07 09:24:15.000 251803648 153000000621100074 153000000624700001 153000000621100074 0 2023-05-30 09:18:24.000 2023-05-30 09:18:28.000 0 0 2052 196609 120 4608 12 0 2000 HF-SERVER79 512 0E1E0486-7B73-4EDC-A6D4-97F463B8BDFC 1E9DD15C-63CE-4772-AC0C-CF7073838961 Chinese_PRC_CI_AS 1E9DD15C-63CE-4772-AC0C-CF7073838961 0 0 0 0 0 0 0 0 0 0 1E9DD15C-63CE-4772-AC0C-CF7073838961 NULL SIMPLE NULL NULL Database 995DC755-2387-4BA4-AC8D-62B9F5600776 251803648 0 (1 行受影响) MediaName MediaSetId FamilyCount FamilySequenceNumber MediaFamilyId MediaSequenceNumber MediaLabelPresent MediaDescription SoftwareName SoftwareVendorId MediaDate MirrorCount IsCompressed -------------------------------------------------------------------------------------------------------------------------------- ------------------------------------ ----------- -------------------- ------------------------------------ ------------------- ----------------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------- ---------------- ----------------------- ----------- ------------ NULL AAA18550-D108-4D64-A85B-895F94A93319 1 1 4E26E290-0000-0000-0000-000000000000 1 0 NULL Microsoft SQL Server 4608 2023-05-30 09:18:24.000 1 0 (1 行受影响) |