Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

Is there anyway so that we can estimated/know size of database using backup file without restoring it?

share|improve this question
1  
What database are you using (Oracle, SQL Server, MySQL, etc.)? What sort of backup do you have? For some types of backups the size of the backup is going to be roughly equivalent to the size of the restored database. –  Justin Cave Apr 4 at 5:48
    
Apologies.. I should have mentioned it earlier.. I am using SQL Server 2008 R2, I am trying to fetch this info from a full backup –  Ashish Apr 4 at 5:49
    
Do you use compression of backup? –  levitologista Apr 4 at 5:53
    
@levitologista Not sure how that's relevant - the size of a compressed backup (or an uncompressed backup) may or may not have any bearing whatsoever on the actual size of the data files, because they could be any % full (and a backup only backs up pages with data on them). The only thing the compressed backup size will tell you is that your database is at least that big. –  Aaron Bertrand Apr 4 at 19:09

1 Answer 1

up vote 5 down vote accepted

Yes, there is, though you got to use RESTORE command anyway. Instead of RESTORE DATABASE, use RESTORE FILELISTONLY to get a detailed view of files in the backup. The Size column tells the file size in bytes.

RESTORE FILELISTONLY FROM DISK = N'v:\MyBackup.bak'
share|improve this answer
    
Thanks @vonPryz this is what I am looking for.. –  Ashish Apr 4 at 6:10

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.