RESTORE HEADERONLY Error 3013 after the sp1 was applied to SQL Server 2014

后端 未结 1 1072
花落未央
花落未央 2021-01-20 02:16

I have recently applied SP1 to SQL Server 2014, done and dusted, no issue. Few weeks later, when trying to use one of my Stored Procedures to restore one of the databases fr

相关标签:
1条回答
  • 2021-01-20 03:14

    We have a Windows C/S application, where databases can be exported, imported and copied. To test SQL Server 2014, we had imported some dabases from a SQL Server 2008 and done some (successful) tests with 2014 some times ago.
    Now we have installed SP1 and then also had problems with other error-messages (like e.g. "Cannot open backup device"). I then also have lost a full day until I found the information, that SP1 add's three new columns (unfortunately before I have found this posting).

    So.. I had to add the three new fields in the SP to the definition of the restoreheader:

    CREATE TABLE #restoreheader(
    BackupName nvarchar(128)
    , BackupDescription nvarchar(255)
    , BackupType smallint
    , ExpirationDate datetime
    , Compressed tinyint
    , Position smallint
    , DeviceType tinyint
    , UserName nvarchar(128)
    , ServerName nvarchar(128)
    , DatabaseName nvarchar(128)
    , DatabaseVersion int
    , DatabaseCreationDate datetime
    , BackupSize numeric(20,0)
    , FirstLSN numeric(25,0)
    , LastLSN numeric(25,0)
    , CheckpointLSN numeric(25,0)
    , DatabaseBackupLSN numeric(25,0)
    , BackupStartDate datetime
    , BackupFinishDate datetime
    , SortOrder smallint
    , [CodePage] smallint
    , UnicodeLocaleId int
    , UnicodeComparisonStyle int
    , CompatibilityLevel tinyint
    , SoftwareVendorId int
    , SoftwareVersionMajor int
    , SoftwareVersionMinor int
    , SoftwareVersionBuild int
    , MachineName nvarchar(128)
    , Flags int
    , BindingID uniqueidentifier
    , RecoveryForkID uniqueidentifier
    , Collation nvarchar(128)
    , FamilyGUID uniqueidentifier
    , HasBulkLoggedData bit
    , IsSnapshot bit
    , IsReadOnly bit
    , IsSingleUser bit
    , HasBackupChecksums bit
    , IsDamaged bit
    , BeginsLogChain bit
    , HasIncompleteMetaData bit
    , IsForceOffline bit
    , IsCopyOnly bit
    , FirstRecoveryForkID uniqueidentifier
    , ForkPointLSN numeric(25,0) NULL
    , RecoveryModel nvarchar(60)
    , DifferentialBaseLSN numeric(25,0) NULL
    , DifferentialBaseGUID uniqueidentifier
    , BackupTypeDescription nvarchar(60)
    , BackupSetGUID uniqueidentifier NULL
    , CompressedBackupSize bigint NULL
    , containment tinyint not NULL
    , KeyAlgorithm nvarchar(32)
    , EncryptorThumbprint varbinary(20)
    , EncryptorType nvarchar(32)
    )
    

    Notes:
    See the last four fields in the definition.
    The Field containment tinyint not NULL was added in SQL-Server 2012 so.. you also have to add this field (if not already added).
    I simply have added the new fields at the end of the definition.. and now everything works like before (no further changes).

    So.. this is a breaking change to SQL-Server 2014 SP1, as soon, as you use a restoreheader definition in your SP's. I don't have found any information to that (has to be changed) in the official MS release notes. Only information I found, see below...

    MS text to "SQL Server 2014 Service Pack 1 release Information":

    1957464 RESTORE HEADERONLY for an Encrypted Backup file of the Database does not show whether the backup is encrypted or not. After you apply SP1, the output of RESTORE HEADONLY will include three additional columns: KeyAlgorithm, EncryptorThumbprint and EncryptorType that can give additional details about the encrypted backup.

    0 讨论(0)
提交回复
热议问题