DatabaseBackup – SQLSERVERLEARNER https://sqlserverlearner.com LEARN SQL SERVER ONLINE Mon, 04 Jun 2012 08:35:02 +0000 en-US hourly 1 https://wordpress.org/?v=6.5.2 backup types in sql server https://sqlserverlearner.com/2012/06/04/backup-types-in-sql-server/ https://sqlserverlearner.com/2012/06/04/backup-types-in-sql-server/#respond Mon, 04 Jun 2012 08:35:02 +0000 https://sqlserverlearner.azurewebsites.net/2012/06/04/backup-types-in-sql-server/ Following are the Backup types in SQL Server 2008:

    Full backup
    Differential backup
    Partial backup
    Differential partial backup
    File backup
    Differential file backups
    Transaction Log Backups
    Copy-Only Backups

More details here

]]>
https://sqlserverlearner.com/2012/06/04/backup-types-in-sql-server/feed/ 0
Identify SQL Server Database Backup Version https://sqlserverlearner.com/2012/01/12/identify-sql-server-database-backup-version/ https://sqlserverlearner.com/2012/01/12/identify-sql-server-database-backup-version/#comments Thu, 12 Jan 2012 04:50:36 +0000 https://sqlserverlearner.azurewebsites.net/2012/01/12/identify-sql-server-database-backup-version/ table.hovertable {
font-family: verdana,arial,sans-serif;
font-size:11px;
color:#333333;
border-width: 1px;
border-color: #999999;
border-collapse: collapse;
}
table.hovertable th {
background-color:#c3dde0;
border-width: 1px;
padding: 8px;
border-style: solid;
border-color: #a9c6c9;
}
table.hovertable tr {
background-color:#d4e3e5;
}
table.hovertable td {
border-width: 1px;
padding: 8px;
border-style: solid;
border-color: #a9c6c9;
}

How to Identify SQL Server Database Backup Version.

Following is the query:
[sql]
RESTORE HEADERONLY FROM DISK=’C:DatabaseBackupsDatabaseBackup.bak’
[/sql]

Specify the correct path of the backup file.

When this query is executed read the values of the columns SoftwareVersionMajor,SoftwareVersionMinor and SoftwareVersionBuild.

The version of the SQL Server backup can be found by concatinating the values in three columns.
version of backup = SoftwareVersionMajor.SoftwareVersionMinor.SoftwareVersionBuild

If the output is
SoftwareVersionMajor = 10
SoftwareVersionMinor = 50
SoftwareVersionBuild = 2500

Then the version of database backup is 10.50.2500

SoftwareVersionMajor also gives an idea of the major version of SQL Server.
It helps to determine if the database backup is of SQL Server 2005 or SQL Server 2008.

Identify Database Backup Version
SoftwareVersionMajor = 9 backup is of SQL Server 2005
SoftwareVersionMajor = 8 backup is of SQL Server 2000
SoftwareVersionMajor = 10 and SoftwareVersionMinor = 0 backup is of SQL Server 2008
SoftwareVersionMajor = 10 and SoftwareVersionMinor = 50 backup is of SQL Server 2008 R2

Related posts:
Verify SQL Server Database Backup
restore higher version database backup on lower version sql server – restore problem
The media family on device is incorrectly formed. SQL Server cannot process this media family Error: 3241

]]>
https://sqlserverlearner.com/2012/01/12/identify-sql-server-database-backup-version/feed/ 2
Verify SQL Server Database Backup https://sqlserverlearner.com/2012/01/04/verify-sql-server-database-backup/ https://sqlserverlearner.com/2012/01/04/verify-sql-server-database-backup/#comments Wed, 04 Jan 2012 07:07:44 +0000 https://sqlserverlearner.azurewebsites.net/2012/01/04/verify-sql-server-database-backup/ Today I wanted to share on this blog a simple but yet very powerfull SQL Server command RESTORE VERIFYONLY.

Syntax:
[sql]
RESTORE VERIFYONLY FROM DISK = ‘<<location of database backup>>’
[/sql]

This command can be used to check weather your database backup is corrupted.

In order to explain this, I have taken backup of one of my database.
I also made another copy of database backup and I intentionally corrupted it.

DatabaseBackup.BAK is the perfect database backup.
DatabaseBackupCorrupted.BAK is the corrupted database backup.

So First I issued RESTORE VERIFYONLY command on the perferct database backup.
Following is the Query:
[sql]
RESTORE VERIFYONLY FROM DISK = ‘C:DatabaseBackupsDatabaseBackup.BAK’
[/sql]

Output:
The backup set on file 1 is valid.

There were no errors and this made me confirm that the database backup is perfect.

Now I issued the same command on the corrupted database backup.
[sql]
RESTORE VERIFYONLY FROM DISK = ‘C:DatabaseBackupsDatabaseBackupCorrupted.BAK’
[/sql]

As we expect the command errored out with the following error.

Output:

Msg 3242, Level 16, State 2, Line 1
The file on device ‘C:DatabaseBackupsDatabaseBackupCorrupted.BAK’ is not a valid Microsoft Tape Format backup set.
Msg 3013, Level 16, State 1, Line 1
VERIFY DATABASE is terminating abnormally.

There this error output confirms me that the database backup is corrupted.

When ever restoration of a database backup is failing we can use the RESTORE VERIFYONLY command on the back up set and verify it.

Note:
You get the error Operating system error 2(The system cannot find the file specified) when the file cannot be found on the file system. In order to fix it give the correct file name and file path.

Msg 3201, Level 16, State 2, Line 1 Cannot open backup device
‘C:DatabaseBackupsDatabaseBackupCorrupted1.BAK’. Operating system error 2(The system cannot find the file specified.).
Msg 3013, Level 16, State 1, Line 1
VERIFY DATABASE is terminating abnormally.

I got the above error when I issued the following command:
[sql]
RESTORE VERIFYONLY FROM DISK = ‘C:DatabaseBackup.BAK’
[/sql]
As the file C:DatabaseBackup.BAK does not exists.

Hope this posts helps!!!

Related post:
The media family on device is incorrectly formed. SQL Server cannot process this media family Error: 3241

]]>
https://sqlserverlearner.com/2012/01/04/verify-sql-server-database-backup/feed/ 2
The media family on device is incorrectly formed. SQL Server cannot process this media family Error: 3241 https://sqlserverlearner.com/2011/07/13/the-media-family-on-device-is-incorrectly-formed-sql-server-cannot-process-this-media-family-error-3241/ https://sqlserverlearner.com/2011/07/13/the-media-family-on-device-is-incorrectly-formed-sql-server-cannot-process-this-media-family-error-3241/#comments Wed, 13 Jul 2011 07:55:43 +0000 https://sqlserverlearner.azurewebsites.net/2011/07/13/the-media-family-on-device-is-incorrectly-formed-sql-server-cannot-process-this-media-family-error-3241/ When you try to restore a backup of the database you get the following error:


The media family on device ” is incorrectly formed. SQL Server cannot process this media family.
RESTORE HEADERONLY is terminating abnormally. (Microsoft SQL Server, Error: 3241)

This error occurs due to the following problems:

Fix:

  • If you feel backup could be corrupted take the backup again
  • If you are using FTP then use it in binary mode to copy the backup file into local drive
  • If the versions are different then update the SQL Server on the system into which the backup has to be restored
  • Verify the database backup to check what the issue is.
    Following post helps you verify your database backup: Verify SQL Server Database Backup
  • More about using restore verify only this option in SQL Server can be found here

]]>
https://sqlserverlearner.com/2011/07/13/the-media-family-on-device-is-incorrectly-formed-sql-server-cannot-process-this-media-family-error-3241/feed/ 3