Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Restore sql database

Posted on 2011-03-14
14
Medium Priority
?
338 Views
Last Modified: 2012-06-21
Trying to restore sql server database using below syntex but I'm getting error

RESTORE DATABASE MyDatabase
   FROM DISK='D:\erase\MyDatabase.BAK'
   WITH MOVE 'MyDatabase_Data' TO 'd:\MSSQL\Data\MyDatabase_Data.MDF',
   MOVE 'MyDatabase_Log' TO 'd:\MSSQL\Data\MyDatabase_Log.LDF';
   GO

Error:

MODIFY FILE encountered operating system error 112(There is not enough space on the disk.) while attempting to expand the physical file
0
Comment
Question by:Bharat Guru
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
14 Comments
 
LVL 29

Expert Comment

by:Paul Jackson
ID: 35134940
The error implies that there is not enough space on the d: drive to perform the restore.
0
 
LVL 2

Expert Comment

by:swadhinray
ID: 35135407
The cause of the error message says lack of free disk space.
You need to free up disk space.
0
 
LVL 9

Expert Comment

by:kaminda
ID: 35135414
It seems there is no enough space to restore the database to D:\ drive, restore it to another drive by changing the file path or just free up D: drive.
0
Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

 

Author Comment

by:Bharat Guru
ID: 35138012
I have enough disk space
0
 

Author Comment

by:Bharat Guru
ID: 35138015
how can i restore only data wihtout log
0
 
LVL 13

Expert Comment

by:devlab2012
ID: 35138672
you cannot restore only data without log. But if you think your log file is too large, you can truncate it after restoring your database. The command used to truncate log file is:

Backup Log DBName with truncate_only

and then shrink your database to free up the space:

DBCC SHRINKDATABASE(DBName, TRUNCATEONLY)
0
 
LVL 29

Expert Comment

by:Paul Jackson
ID: 35138704
Run a full backup of the database and truncate the log, then perform a second backup and try restoring that.
0
 

Author Comment

by:Bharat Guru
ID: 35138826
How can I truncate from MyDatabase.BAK file,
0
 
LVL 29

Accepted Solution

by:
Paul Jackson earned 500 total points
ID: 35138912
you can't you need to truncate the database before you produce the backup
0
 

Author Comment

by:Bharat Guru
ID: 35139531
some how restoring to 2008 worked
0
 
LVL 5

Expert Comment

by:VENKAT KOKULLA
ID: 35141889
This Issue is with space on the particular disk on which you are going to restore the database
0
 
LVL 29

Expert Comment

by:Paul Jackson
ID: 35793287
The comment chosen as the solution is not appropriate as it is not a solution.
0
 
LVL 29

Expert Comment

by:Paul Jackson
ID: 35805781
3) Accept one or more Expert posts as the answer. Comment http:#a35134940 was the first comment to explain the cause of the error.
0

Featured Post

Fill in the form and get your FREE NFR key NOW!

Veeam® is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have a large data set and a SSIS package. How can I load this file in multi threading?
When trying to connect from SSMS v17.x to a SQL Server Integration Services 2016 instance or previous version, you get the error “Connecting to the Integration Services service on the computer failed with the following error: 'The specified service …
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question