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
 Transact-SQL (2008)
 Database Restore - Error - Please help?

Author  Topic 

SQL Red68
Starting Member

8 Posts

Posted - 2010-07-23 : 10:03:47
Hi all,

Could you please take a look at the following query and error message and help me get the query right?

RESTORE DATABASE [DreamMedia_Live_V2] FROM
DISK 'E:\Downloads\MSSQL10.MSSQLSERVER\MSSQL\Backup\DreamMediaLive_1207210.bak'
WITH FILE = 1, MOVE N'DreamMedia_Live_log'
TO N'g:\Log\DreamMedia_Log_V2.ldf',
NOUNLOAD, REPLACE, STATS = 10
GO

Msg 5133, Level 16, State 1, Line 2
Directory lookup for the file "H:\Log\DreamMedia_LIVE_log2.ldf" failed with the operating system error 2(The system cannot find the file specified.).
Msg 3156, Level 16, State 3, Line 2
File 'DreamMedia_LIVE_log2' cannot be restored to 'H:\Log\DreamMedia_LIVE_log2.ldf'. Use WITH MOVE to identify a valid location for the file.
Msg 3119, Level 16, State 1, 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.

Thanks,

pk_bohra
Master Smack Fu Yak Hacker

1182 Posts

Posted - 2010-07-23 : 10:23:47
From the error message it appears that there are multiple log files.

In your restore command you have specified path only for one log file so the other files will be attempted to be restored in the default path (Path where original files were placed)
Ex: H:\Log\DreamMedia_LIVE_log2.ldf

Try specifying path for all log files.

Use RESTORE FILELISTONLY command to find out the details of all the log files of the DB.

Go to Top of Page

SQL Red68
Starting Member

8 Posts

Posted - 2010-07-23 : 10:40:13
Hi,

Thanks for the reply, I just tried to run RESTORE FILELISTONLY and got the following message

Msg 102, Level 15, State 1, Line 2
Incorrect syntax near 'Filelistonly'.

Could you advise?
Go to Top of Page

GilaMonster
Master Smack Fu Yak Hacker

4507 Posts

Posted - 2010-07-23 : 10:43:21
What was the exact command that you ran?

--
Gail Shaw
SQL Server MVP
Go to Top of Page

SQL Red68
Starting Member

8 Posts

Posted - 2010-07-23 : 10:44:59
RESTORE FILELISTONLY
Go to Top of Page

GilaMonster
Master Smack Fu Yak Hacker

4507 Posts

Posted - 2010-07-23 : 11:20:05
That is going to give a syntax error. It's not a complete command.
Look in Books Online for the full command for RESTORE with the FILELISTONLY option. You do have to at least specify where the backup file can be found.

--
Gail Shaw
SQL Server MVP
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2010-07-23 : 12:02:50
This may help with constructing the syntax of a restore command:

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=54300
Go to Top of Page

pk_bohra
Master Smack Fu Yak Hacker

1182 Posts

Posted - 2010-07-23 : 12:33:35
Syntax :
RESTORE FILELISTONLY
FROM <backup_device>


Example:
RESTORE FILELISTONLY
FROM Disk ='D:\Bk.bak'
Go to Top of Page

gijoemike
Starting Member

3 Posts

Posted - 2010-08-19 : 00:11:39
How do I find the path of the .bak file?

I uploaded the .bak file to my shared-hosting-godaddy windows server. The server details said:

Absolute Hosting Path:
D:\Hosting\6581143\html


I tried:
RESTORE FILELISTONLY
FROM DISK = 'D:\Hosting\6581143\html\paintcheck.bak'

But error:
Cannot open backup device 'D:\Hosting\6581143\html\paintcheck.bak'. Operating system error 3(The system cannot find the path specified.). RESTORE FILELIST is terminating abnormally.


Really trying to run is something like this:

RESTORE DATABASE paintcheck
FROM DISK = 'C:\paintcheck.BAK'
WITH REPLACE, MOVE 'paintcheck' TO 'C:\MSSQL\DATA\paintcheck_Data.MDF',
MOVE 'paintcheck_log' TO 'C:\MSSQL\DATA\paintcheck_Log.LDF'


To restore a .bak file i got from someone else to my server.

Thanks!
Go to Top of Page

pk_bohra
Master Smack Fu Yak Hacker

1182 Posts

Posted - 2010-08-19 : 01:03:13
quote:
Originally posted by gijoemike

How do I find the path of the .bak file?

I uploaded the .bak file to my shared-hosting-godaddy windows server. The server details said:

Absolute Hosting Path:
D:\Hosting\6581143\html


I tried:
RESTORE FILELISTONLY
FROM DISK = 'D:\Hosting\6581143\html\paintcheck.bak'

But error:
Cannot open backup device 'D:\Hosting\6581143\html\paintcheck.bak'. Operating system error 3(The system cannot find the path specified.). RESTORE FILELIST is terminating abnormally.


Really trying to run is something like this:

RESTORE DATABASE paintcheck
FROM DISK = 'C:\paintcheck.BAK'
WITH REPLACE, MOVE 'paintcheck' TO 'C:\MSSQL\DATA\paintcheck_Data.MDF',
MOVE 'paintcheck_log' TO 'C:\MSSQL\DATA\paintcheck_Log.LDF'


To restore a .bak file i got from someone else to my server.

Thanks!




Does SQL Server exists on the same system where you have uploaded the .bak file ?

It may be possible that the "Absolute Hosting Path" and SQL Server are on different system. Check it once.

Go to Top of Page
   

- Advertisement -