restore job failing with error

  • I am trying to restore a database from a prod to a test server.

    Prod SQL server is running under corp\domain_name1.

    The test SQL server is running under test\domain_name2.

    Now will this create issues??

    I am trying to run this script as a job

    RESTORE DATABASE [test_db_name]

    FROM DISK = N'\\prod_server_name\drive$\sqldumps\prod_db_name.BAK' WITH FILE = 1, UNLOAD , STATS = 10, RECOVERY , REPLACE,

    MOVE N'file_name' TO N'R:\SqlData\MSSQL\Data\test_db_name_data.mdf',

    MOVE N'file_name_log' TO N'R:\SqlData\MSSQL\Data\test_db_name_log.ldf'

    I am getting this error message.

    BackupDiskFile::OpenMedia: Backup device '\\server_name\r$\sqldumps\prod_db_name.BAK' failed to open. Operating system error = 1326(Logon failure: unknown user name or bad password.).

    Any ideas ??

  • Seems to be a permissions problem. You can run the following to validate that it has nothing to do with the restore;

    RESTORE FILELISTONLY

    FROM DISK = N'\\prod_server_name\drive$\sqldumps\prod_db_name.BAK'

    If you can't run that it is definitely a permissions issue. Post back with your findings.

    David

    @SQLTentmaker

    “He is no fool who gives what he cannot keep to gain that which he cannot lose” - Jim Elliot

  • Yes I believe that is hte issue.

    The mesage I got was

    Server: Msg 3201, Level 16, State 2, Line 1

    Cannot open backup device '\\prod_server_name\drive$\sqldumps\Prod_db.BAK'. Device error or device off-line. See the SQL Server error log for more details.

    Server: Msg 3013, Level 16, State 1, Line 1

    RESTORE FILELIST is terminating abnormally.

    The error log had this message.

    BackupDiskFile::OpenMedia: Backup device '\\prod_server_name\drive$\sqldumps\Prod_db.BAK'failed to open. Operating system error = 1326(Logon failure: unknown user name or bad password.).

  • So this means that the issue is with server level permissions correct?

  • Yes.

    David

    @SQLTentmaker

    “He is no fool who gives what he cannot keep to gain that which he cannot lose” - Jim Elliot

  • Thank you very much David for the reply. I ended up writing a batch file to copy over the filefrom the Prod server and then doing the restore.

  • Very glad that worked for you and thanks for following up on the post!

    David

    @SQLTentmaker

    “He is no fool who gives what he cannot keep to gain that which he cannot lose” - Jim Elliot

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

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