Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I have a database backup file (MyDatabase.bak). When restoring the database through SSMS it gives me "Not enough space on disk" message. I looked for an option to exclude .LOG file from restore but could not find one.

I even tried to remove the "MOVE .LOG" from restore query but got an error message "could not find .LOG file use WITH MOVE option".

Is there an option to exclude the log file while restoring the database?

Thanks

share|improve this question
add comment

migrated from stackoverflow.com Jan 21 '12 at 15:01

This question came from our site for professional and enthusiast programmers.

1 Answer

up vote 2 down vote accepted

No: the log is an essential part of the database and is used during RESTORE process (redo/undo phases) to ensure consistency.

Use WITH MOVE to restore to a compressed folder to gain "more" disk space temporarily. Or an external USB drive etc

Edit:

By compressed, I mean NTFS compression (for XP but still applies).

WITH MOVE is part of restore exposed as "Restore the database files as" in SSMS

Edit 2:

SQL Server can not use network drives unless you enable trace flag 1807. Now, use at your own risk to get running again only

share|improve this answer
    
+1 - Also a missing log can lead to a DB being marked suspect in SQL Server. –  JNK Aug 10 '10 at 19:12
    
@gbn: I tried to search for "WITH MOVE restore to compressed folder" but could not find anything useful. Can you pls. suggest how do i go about restoring to a compressed folder? –  stackoverflowuser Aug 10 '10 at 19:37
    
Additionally I tried to give a network path (Mapped network drive) but it gave up error message "Directory lookup for file R:\Log\MyDatabase.LDF" failed. System cannot find the path specified". I have ensured the path is accessible. Are network path not valid while restoring ?? –  stackoverflowuser Aug 10 '10 at 19:43
    
Messing with compression is a recipe for disaster. Go back to the source of the DB, run a shrink to clean out the log file, then move it again. –  JNK Aug 10 '10 at 19:56
    
@JNK: I already looked into that option. But it seems the db is long gone. Only .bak file is available. –  stackoverflowuser Aug 10 '10 at 19:59
show 3 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.