Reply to Re: Restore SQL DB with correct logical file names

Your name:

Reply:


Posted by Erland Sommarskog on 02/26/07 22:35

blueboy (matt_meech@hotmail.com) writes:
> Hi still having probs get the following error
>
> Executed as user: domain\user. Logical file 'UKReports _Data.MDF' is
> not part of database 'ukreports'. Use RESTORE FILELISTONLY to list the
> logical file names. [SQLSTATE 42000] (Error 3234) RESTORE DATABASE is
> terminating abnormally. [SQLSTATE 42000] (Error 3013). The step
> failed.
>
> RESTORE DATABASE rentsmartukreports
> FROM DISK =
> 'E:\Nightly backups server\UK.bak'
> WITH MOVE 'G:\SQLDATA\MSSQL\data\UK _Data' TO 'G:\SQLDATA\MSSQL\data
> \UKReports _Data.MDF',
> MOVE 'G:\SQLDATA\MSSQL\data\UK _Log' TO 'G:\SQLDATA\MSSQL\data
> \UKReports _Log.LDF',
> STATS = 1, REPLACE
> GO

Indeed, 'G:\SQLDATA\MSSQL\data\UK _Data' looks like a very unusual
logical name. Usually the logical file name of the data file is the
same as the database name, and the log file has "_log" tacked on it.
Sometimes the MDF has "_Data" in the logical name.

You can use sp_helpdb to find out the logical names of a dataase.
Or, if all you have is a backup, RESTORE FILELISTONLY.


--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация