question

shamim007 avatar image
shamim007 asked

SQL Database restore error

hello experts , currently i am trying to migrate my database(SQL server 2008R2 standard edition ) from test environment to dev(SQL server 2014 standard edition) .my BD size is 535 GB and my disk size is 2.49 TB ,every time i am trying to restore my DB getting error : Msg 3257, Level 16, State 1, Line 2 There is insufficient free space on disk volume 'K:\' to create the database. The database requires 3106808856576 additional free bytes, while only 2670337888256 bytes are available. Msg 3119, Level 16, State 4, Line 2 Problems were identified while planning for the RESTORE statement. Previous messages provide details. Msg 3013, Level 16, State 1, Line 2 RESTORE DATABASE is terminating abnormally. why i am getting this error since i have enough space on my drive .i am not trying to restore in C drive . how could i solve this ? thanks
sql-server-2008-r2restoresqlserver2014
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Kev Riley avatar image
Kev Riley answered
3106808856576 bytes is over 3TB, and if you only have 2.5TB on disk then it isn't going to fit. When you say your database is 535GB do you mean the size of the backup? No matter how much data you have, a restore operation needs to allocate the database files at the same size as they were at the point of backup. So a database with a mdf of 5TB, even with 1 row in it will need 5TB of disk space to restore. You either need to find a location to restore this, then amend the file sizes, backup this copy and then restore to K: Or change the original file sizes and take another backup - however they may have been set to this size in production for a reason.
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

rvsc49 avatar image
rvsc49 answered
Hi, are both the data and log files of the database both going to the K:\ for the restore? The error message is stating you are about 436Gb short in space to restore that database. Could you paste in your restore tsql? What makes you think the restore is trying to write the files to the C:\?
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

shamim007 avatar image shamim007 commented ·
USE [master] RESTORE DATABASE [MYDB] FROM DISK = 'K:\Backups\MYDB_backup_20180103.bak' WITH FILE = 1, MOVE 'MYdb_dat' TO 'K:\MYDB20180109\MYDB.mdf', MOVE 'MYDB_F2' TO 'K:\MYDB20180109\MYDB_F2.ndf', MOVE 'MYdb_log' TO 'K:\MYDB20180109\MYDB.ldf', NOUNLOAD, REPLACE, RECOVERY, STATS = 5 GO i have 2.42 TB of free space in the disk ,so there is no space problem .
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.