Monday, January 3, 2011

Backup Start Date Time and Finish Date Time

As best practice it is recommended that you have to backup date time with the backup file name so anyone can get the idea of Backup creation.

Sometimes due some issue we took backup without specifying the datetime with the backup file name so during restore we are unsure that how much data backed up in the backup file, type of backup, Is it Copy only and more.

SQL Server stores the Backup Metadata into backup header. You can restore header only command to get the required information.

RESTORE headeronly FROM disk = 'c:\jshah.bak' 












































































































































































































































































Column NameValuesDescription
BackupNameNULL 
BackupDescriptionNULL 
BackupType1Backup type:
1 = Database
2 = Transaction log
4 = File
5 = Differential database
6 = Differential file
7 = Partial
8 = Differential partial
ExpirationDateNULL 
Compressed00 = Un-Compressed Backup
1 = Compressed Backup
Position1 
DeviceType2 
UserNameJShah 
ServerNameSQLDBPool 
DatabaseNamejshah 
DatabaseVersion655 
DatabaseCreationDate12/31/10 9:55 AM 
BackupSize1453056 
FirstLSN28000000006000100 
LastLSN28000000013000000 
CheckpointLSN28000000006000100 
DatabaseBackupLSN0 
BackupStartDate12/31/10 10:06 AM 
BackupFinishDate12/31/10 10:06 AM 
SortOrder52 
CodePage0 
UnicodeLocaleId1033 
UnicodeComparisonStyle196609 
CompatibilityLevel100 
SoftwareVendorId4608 
SoftwareVersionMajor10 
SoftwareVersionMinor0 
SoftwareVersionBuild2757 
MachineNameSQLDBPool 
Flags5121 = Log backup contains bulk-logged operations.
2 = Snapshot backup.
4 = Database was read-only when backed up.
8 = Database was in single-user mode when backed up.
16 = Backup contains backup checksums.
32 = Database was damaged when backed up, but the backup operation was requested to continue despite errors.
64 = Tail log backup.
128 = Tail log backup with incomplete metadata.
256 = Tail log backup with NORECOVERY.
BindingID85A5505D-ADB1-4B33-A181-549DC520A0F8 
RecoveryForkID03DE5437-1E27-4885-9011-91CFED12338A 
CollationSQL_Latin1_General_CP1_CI_AS 
FamilyGUID03DE5437-1E27-4885-9011-91CFED12338A 
HasBulkLoggedData01 = Yes
0 = No
IsSnapshot01 = Yes
0 = No
IsReadOnly01 = Yes
0 = No
IsSingleUser01 = Yes
0 = No
HasBackupChecksums01 = Yes
0 = No
IsDamaged01 = Yes
0 = No
BeginsLogChain01 = Yes
0 = No
HasIncompleteMetaData01 = Yes
0 = No
IsForceOffline01 = Yes
0 = No
IsCopyOnly01 = Yes
0 = No
FirstRecoveryForkID03DE5437-1E27-4885-9011-91CFED12338A 
ForkPointLSNNULL 
RecoveryModelFULL 
DifferentialBaseLSNNULL 
DifferentialBaseGUIDNULL 
BackupTypeDescriptionDatabase 
BackupSetGUID62EB4399-C119-42C2-91F1-BF0FF19CB896 
CompressedBackupSize1453056 

2 comments:

  1. Jugal,

    This is informative and very helpful...
    Thanks, for uploading this article
    Abhinav

    ReplyDelete