Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

SQL Restore from networked server

Posted on 2012-12-23
7
Medium Priority
?
384 Views
Last Modified: 2012-12-31
I recently had a job running on a reporting server that would restore the backups from the production server over the network.  I had a system failure and had to rebuild the reporting server and now when I run the restore script I receive the following error.  I have attached the job restore script.

Msg 3201, Level 16, State 2, Line 22
Cannot open backup device '\\serv007\r$\SQLBackups\DYNAMICS_EXT\DYNAMICS_EXT_backup_201212222235.bak'. Operating system error 5(Access is denied.).
Msg 3013, Level 16, State 1, Line 22
RESTORE DATABASE is terminating abnormally.
Untitled.doc
0
Comment
Question by:jdr0606
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 1

Expert Comment

by:igordevelop
ID: 38717515
Hi,

I am sure this is a user permissions issue.

Try to go to the Control panel->administrative tools->services-> SQL Server

At the properties, choose log on as: local system account and also choose to allow service to interact with desktop.

I hope this will solve the problem.

Please let me know if anything.

Regards,
Igor
0
 

Author Comment

by:jdr0606
ID: 38717600
Unfortunately that didn't resolve the issue, I'm still getting the same error.

My current work around is to copy the .bak file using \\serv007... to the server with reporting SQL and then restore from the local source.
0
 
LVL 75

Assisted Solution

by:Anthony Perkins
Anthony Perkins earned 1500 total points
ID: 38717645
Since you appear to be backing up to a remote server, you cannot use a local system account for this, it has to be a domain account with the appropriate permissions on the SQL Server box as well as access to the remote server.
0
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 
LVL 4

Expert Comment

by:jjjosef
ID: 38717854
The database is often running as a service under an account with no network access.

If this is the case, then you wouldn't be able to restore directly over the network.

Either the backup needs to be copied to the local machine or the database service needs to

run as a user with the proper network access.

For more information follow th given link...

SQL Server backup and restore to network drive

~ Edit by Modulus_Twelve - This post contains unattributed content from http://stackoverflow.com/questions/16491/restore-database-backup-over-the-network# ~
0
 
LVL 1

Expert Comment

by:igordevelop
ID: 38717991
Hi,

I don't know if you have developed the script, but you can try to modify it to copy the backup file locally and than make the restore. Obviously the script can not do this directly via the remote server.

Or whoever made the script, needs to be asked to modify it a bit.

You can try yourself, to take the backup file locally and see if you can do the restore manually. If this works, than we'll know the diagnose.

Regards,
Igor
0
 

Accepted Solution

by:
jdr0606 earned 0 total points
ID: 38721479
I resolved the issue and it was related to permissions.

The script I attached works as is however the SQL Server service must be configured to login to with "This Account" network account with domain permissions to the network/server location and not to the "local account".
0
 

Author Closing Comment

by:jdr0606
ID: 38732190
Completed the permission solution
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
What if you have to shut down the entire Citrix infrastructure for hardware maintenance, software upgrades or "the unknown"? I developed this plan for "the unknown" and hope that it helps you as well. This article explains how to properly shut down …
Via a live example, show how to setup several different housekeeping processes for a SQL Server.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question