Results 1 to 3 of 3

Thread: can t restore a DB: Message: Directory lookup for the file ...... failed

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Aug 2006
    Posts
    589

    can t restore a DB: Message: Directory lookup for the file ...... failed

    Error: Directory lookup for the file ...... failed
    Hi there,
    We have a DB on a server, we backed up the DB using: SSMS by selecting the DB in question, tasks, back up, then back up the DB to a file called my Backup

    Then to restore the backed up database on my server, I do this in
    SSMS: in Databases I do: Restore,
    in To Database: I specify: MyBackedUpDatabase
    I check : from device, then I specify the path to my file back up
    called : backup

    But I get this error:


    Restore failed for Server 'ABC'. (Microsoft.SqlServer.Smo)


    System.Data.SqlClient.SqlError: Directory lookup for the file "D:\Databases\Microsoft SQL Server\MSSQL.1\MSSQL\Data\OrleansEcomm.mdf" failed with the operating system error 21(error not found). (Microsoft.SqlServer.Smo)

    Merci (thank)
    Thanks a lot for your help.

  2. #2
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: can t restore a DB: Message: Directory lookup for the file ...... failed

    We prefer to use T-SQL statements to backup and restore files...

    This would be a restore:

    RESTORE FILELISTONLY
    FROM DISK = 'c:\acs desktop\Stufiles_Mar27_boe.BAK'
    RESTORE DATABASE Stufiles
    FROM DISK = 'c:\acs desktop\Stufiles_Mar27_boe.BAK'
    WITH MOVE 'Stufiles_data' TO 'c:\sql data\Stufiles.mdf',
    MOVE 'Stufiles_log' TO 'c:\sql logs\Stufiles.ldf'

    The first RESTORE with FILELISTONLY displays a grid in the Management Studio that shows the "logical" names of the data and log portions of the .BAK.

    The second RESTORE actually restores the DB - with specific file locations for data and log.

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  3. #3
    New Member
    Join Date
    Jun 2009
    Posts
    1

    Re: can t restore a DB: Message: Directory lookup for the file ...... failed

    Try checking the destination paths form the .mdf and .ldf files. In the "Restore Database" window, click "Options", then check the values under "Restore As". I once got the same error message because the files had been stored on the D partition on the source server, so my computer was trying to restore them to the D drive, which was my CD ROM drive.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width