SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Database Restore - Error - Please help?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

SQL Red68
Starting Member

8 Posts

Posted - 07/23/2010 :  10:03:47  Show Profile  Reply with Quote
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
Flowing Fount of Yak Knowledge

India
1182 Posts

Posted - 07/23/2010 :  10:23:47  Show Profile  Reply with Quote
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.


Edited by - pk_bohra on 07/23/2010 10:25:41
Go to Top of Page

SQL Red68
Starting Member

8 Posts

Posted - 07/23/2010 :  10:40:13  Show Profile  Reply with Quote
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
Flowing Fount of Yak Knowledge

South Africa
4507 Posts

Posted - 07/23/2010 :  10:43:21  Show Profile  Visit GilaMonster's Homepage  Reply with Quote
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 - 07/23/2010 :  10:44:59  Show Profile  Reply with Quote
RESTORE FILELISTONLY
Go to Top of Page

GilaMonster
Flowing Fount of Yak Knowledge

South Africa
4507 Posts

Posted - 07/23/2010 :  11:20:05  Show Profile  Visit GilaMonster's Homepage  Reply with Quote
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

United Kingdom
22431 Posts

Posted - 07/23/2010 :  12:02:50  Show Profile  Reply with Quote
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
Flowing Fount of Yak Knowledge

India
1182 Posts

Posted - 07/23/2010 :  12:33:35  Show Profile  Reply with Quote
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 - 08/19/2010 :  00:11:39  Show Profile  Reply with Quote
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
Flowing Fount of Yak Knowledge

India
1182 Posts

Posted - 08/19/2010 :  01:03:13  Show Profile  Reply with Quote
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
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.38 seconds. Powered By: Snitz Forums 2000