1

I'm trying to restore a database from a .bak file. The file is only 89.3 mb large. I'm using the restore with replace option, so that all other data in the database is removed. We are just trying to get the latest data from out clients.

But I get an error saying that I will exceed my limit of 10GB. My server instance is, using

select @@version:

Microsoft SQL Server 2012 - 11.0.2100.60 (X64)   
Feb 10 2012 19:39:15   
Copyright (c) Microsoft Corporation Express Edition (64-bit) on Windows NT 6.1 <X64> (Build 7601: Service Pack 1) 

Could someone please tell me why I can't get my database to restore. Do I have to get the full version of 2012? We are using the Express version

2
  • If the backup is compressed then your DB size can be substantially larger than the file size of the backup. Which is probably the case here.
    – Ralf
    May 9, 2014 at 8:34
  • Post exact error message to help you better.
    – Kin Shah
    May 9, 2014 at 11:52

3 Answers 3

4

Express Edition limits the size of the database to 10 GB.

The backup is small because it only contains pages that are used -- regardless of whether or not the backup is compressed -- but the original file sizes will be restored to the size they were when they were backed up. The file sizes are what count against the limit.

Assuming this is the problem, the only solutions are to shrink the files before taking the backup, or restore the backup on a different edition (probably Developer edition).

1

Try to DROP the existing database (before the restore) instead of using the WITH REPLACE option. Do a separate backup from the old database before dropping it!

3
  • is that saying: RESTORE dbname FROM DISK = 'fileloc' drop dbname GO
    – Nicholas Aysen
    May 9, 2014 at 8:31
  • Nope, its: DROP DATABASE [dbname]; GO; before the RESTORE [dbname] FROM DISK.. Another way is to shrink all database files, before the RESTORE (Google for DBCC SHRINKFILE)
    – Pred
    May 9, 2014 at 8:36
  • Using DBCC SHRINKFILE is almost always a bad idea. It ruins the performance of your database and server. I would expect the issue is your database backup is compressed. Can you try restoring it to another server? May 9, 2014 at 9:35
-2

SQL Server 2012 Express supports a maximum of 10GB, its possible that your database exceeds that limit. You will need SQL Server 2012 Standard if your Database exceeds 10 GB

check this out

3
  • You are right, but the backup file is so small, so I think the old database is too larg (e.g. the log files are too big or there were lots of testzing with page splits and the data file is too big)
    – Pred
    May 9, 2014 at 8:38
  • if you can get another backup i suggest shrinking the log file before getting a new backup
    – Yugz
    May 9, 2014 at 8:42
  • I think, the backup is fine for Nicholas Aysen, just the database which is already on the server is too big...
    – Pred
    May 9, 2014 at 8:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy