Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 SQL Server Administration (2008)
 Problem while Restoring Database withSIZE=MAXSIZE

Author  Topic 

Martyn123
Starting Member

29 Posts

Posted - 2010-09-27 : 08:04:24
Hi,

Ihave created a database named TransDB1 with SIZE=3GB and MAXSIZE=3GB.


CREATE DATABASE [TransDB1] ON PRIMARY
( NAME = N'TransDB1', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL10.TestDB1\MSSQL\DATA\TransDB1.mdf' , SIZE = 3GB , MAXSIZE = 3GB)
LOG ON
( NAME = N'TransDB1_log', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL10.TestDB1\MSSQL\DATA\TransDB1_log.ldf' , SIZE = 2GB , MAXSIZE = 2GB )
GO



I have taken a backup of the above created database which has 10 MB of data; when I am trying to restore the .bak file on a machine which has only 1GB of disk size , restore is throwing error: not enough disk space; even though I have 10 MB of data in the .bak file and the free space on the disk (on which I want to restore) is 100MB.

That issue is occuring because of SIZE=3GB parameter ie(SIZE=MAXSIZE)

Is there any way by which I can restore the .bak file overcoming the above error.


** I dont want to change the SIZE=MAXSIZE parameter.



Please reply to this post as early as possible.

Thanks in advance.

Martyn.



pk_bohra
Master Smack Fu Yak Hacker

1182 Posts

Posted - 2010-09-27 : 08:27:34
I feel that the problem is not because of MAXSize but because of the value of size.
SIZE = 3GB. You have created a initial file of 3 gb.

I am not sure whether sql server allows you to reduce the size of primary file or not. Try reducing the size of primary file.

Try shrinking the file and see if it works.
http://technet.microsoft.com/en-us/library/ms190757.aspx

Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2010-09-27 : 12:27:03
RESTORE will create a database the same size as the database the backup was made from, regardless of how much data is actually present in the original database / backup file, and restore will also ignore the current size of the database being restored to / overwritten. The ONLY way around that is to shrink the Source databases and take a new backup AFAIK
Go to Top of Page

Martyn123
Starting Member

29 Posts

Posted - 2010-09-28 : 00:53:18
Thanks Kristen , pk bohra for taking ur precious time out and replying to my post , it helped me a lot in understanding the inner working of backup and restore procedure. I will try to shrink the size of the db.

Thanks again.

Martyn.
Go to Top of Page
   

- Advertisement -