Database Simplified Headline Animator

Database Simplified

Friday 28 October 2011

Get Information From Backup File In SQL Server

This post describes how can we get information from backup file without restoring it. information about file groups, data and log files and Database information like server name and user name, internal database version, backup size and etc.

Backup A Database



Backup Database CDB To Disk='D:\CDB_Full.Bak'  With MediaName='CDB_FullBackup'
Go

Now we have a backup file located at D:\CDB_full.Bak, With this file following query retrieves information about database Name,UserName, ServerName and Backup Date and etc.



Restore HEADERONLY  From Disk='D:\CDB_Full.BAK'
Go

image

Now let’s get filegroup and file info from backup



Restore FILELISTONLY From Disk='D:\CDB_Full.BAK'
Go

image

Its really useful when you want to have information about a backup file without restoring it.

No comments:

Post a Comment