Sql-server – Backup too big to restore

backuprestoresql server

I have a backup which in file explorer is roughly 160GB.

If I run

select sum((size*8)/1024) From sys.database_files where type=0

I get a result of 169493, fine.

When I try to restore this database to another server (the old DBA set up a job which restores the database automatically each morning from the latest backup, then runs DBCC CHECKDB on it) it fails. If i try RESTORE VERIFYONLY it turns out I need 288GB in order for this to work. Why? The backup is not compressed.

Thanks

Best Answer

From your question, it sounds like the restore has been working daily, for some time. As of today it suddenly stopped working.

Yesterday it restored fine with a restored size of around 160GB today it needs 288GB to restore.

One of two things probably happened (or a combination of both)

  1. The data files (mdf.ndf.) grew a bunch either from lots of new data coming in, or from someone increasing the file size.

  2. The log files grew a bunch, probably because of an auto grow when someone ran a big ugly query.

You will need to look at the source database to find out what is bigger than it was yesterday. Then you will need to figure out why it grew. Then you will need to make a decision with the business on if the source should be shrunk back down, or if the secondary server needs to have more space added to it.