How can I restore DB from shared file

  • I run the following script

    ---------------------------------------------------------------

    RESTORE DATABASE test

    FROM DISK = '\\srv\d$\Backup\DB20091019.bak'

    WITH

    FILE = 1,

    NOUNLOAD,

    REPLACE,

    STATS = 10

    GO

    ---------------------------------------------------------------

    But found this error

    ---------------------------------------------------------------

    Msg 3201, Level 16, State 2, Line 3

    Cannot open backup device '\\srv\d$\Backup\

    DB20091019.bak'. Operating system error 5(error not found).

    Msg 3013, Level 16, State 1, Line 3

    RESTORE DATABASE is terminating abnormally.

    ---------------------------------------------------------------

    By default, my account can NOT access the folder

    \\srv\d$\Backup

    But once I try to enter the above folder

    Windows pop up page to enter UserName & Password.

    Then I input

    UserName & Password of the SERVER

    After that, I can access the folder.

    However, I still can NOT run SQL for Restore properly (Without error)

    Please advise.

  • Copy the files to the server on which you are trying to restore - it's the recommended way.

    If you try to restore it from a shared location you can get permissions issues.

    In your case "Operating system error 5(error not found)" tells exactly that. If it is necessary to restored from a shared location make sure the User you are connected with has the required permissions on the folder.

    Sanz
  • I need to restore DB via shared folder only.

    It's because the DB size it's too large to keep in my computer.

    Please elaborate me how to solve permission problem.

    Thanks in advance.

  • If you want to use a share, then the user that is doing the restore needs permission to access the files located at the share, which is what has already been mentioned in previous posts.

    --------------------------------------------------------------------------------------
    [highlight]Recommended Articles on How to help us help you and[/highlight]
    [highlight]solve commonly asked questions[/highlight]

    Forum Etiquette: How to post data/code on a forum to get the best help by Jeff Moden[/url]
    Managing Transaction Logs by Gail Shaw[/url]
    How to post Performance problems by Gail Shaw[/url]
    Help, my database is corrupt. Now what? by Gail Shaw[/url]

  • Silverfox (10/29/2009)


    If you want to use a share, then the user that is doing the restore needs permission to access the files located at the share, which is what has already been mentioned in previous posts.

    Please clarify me.

    If my computer has users as follows

    - userA

    - Admin

    And the Server that has running SQL SERVER has users like this

    - userBBB

    - Guest

    What should I do ???

    ??

    Add 'userBBB' in my computer with the same password as UserBBB in SERVER

    Right ????

  • Sounds like permission problems on the folder where your are trying to create the data files.

    Hope this helps.

  • The account that is running the restore will need permissions on the share to access the file.

    Gethyn Elliswww.gethynellis.com

  • SQL server service needs to be running under a domain user account and that account needs read permissions on the share.

    ---------------------------------------------------------------------

Viewing 8 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic. Login to reply