2

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

3

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

  • +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
  • @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
  • @stackoverflowuser - Then you really need to do whatever you have to in order to create space just long enough to restore the DB and shrink the log. – JNK Aug 10 '10 at 20:05

Your Answer

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