January 7, 2009 at 12:39 pm
I am trying to restore a backup on sql 2005 server by accessing the .bak file from a share folder residing on another server. I get an error as
Cannot open backup device '\\servername\sharefoldername\db.bak'. Operating system error 5(Access is denied.).
I check the permission on both source and target server, checked if source server(with backup file) has full access on share folder and evrything looks ok to me. If from target server on cmd prompt if i do \\servername\sharefoldername teh backup file shows up but somehow doesnt get accessed from sql2005. any help on thsi will be greatly appreciated. TIA
January 7, 2009 at 12:51 pm
From http://www.fmsinc.com/freE/NewTips/SQL/SQLtip9.asp
While only local devices are shown in Enterprise Manager’s Backup/Restore dialogs, there is a way to create or restore a SQL Server database backup on a network file share. Creating or restoring a database backup on a network file share requires the following prerequisites:
1) The SQL Server services, on the Server containing the instance of SQL Server, must be running under a domain-level account (e.g. A Domain Administrator account). This is accomplished by changing the "Log On" properties for the services named "MSSQLSERVER" and "SQLSERVERAGENT" on the server running SQL Server (not your local instance). When you have completed changing the log on information for these 2 services, you will need to restart the "MSSQLSERVER" service on that server. Note that this will ask if you want to restart the "SQLSERVERAGENT" as well - Answer: Yes.
2) The SQL Server service account must have FULL CONTROL rights to the file system folder and to the share. That means you need to have a shared location in which the logon account you specified in 1 (above) has full control rights.
3) The file share should only be accessed via UNC name. Mapped drives may not be consistently visible to the SQL Service.
4) You cannot specify the path by using the browse ellipses (...). You must type the fully qualified path
MJ
January 7, 2009 at 1:03 pm
MANU (1/7/2009)
1) The SQL Server services, on the Server containing the instance of SQL Server, must be running under a domain-level account (e.g. A Domain Administrator account). This is accomplished by changing the "Log On" properties for the services named "MSSQLSERVER" and "SQLSERVERAGENT" on the server running SQL Server (not your local instance). When you have completed changing the log on information for these 2 services, you will need to restart the "MSSQLSERVER" service on that server. Note that this will ask if you want to restart the "SQLSERVERAGENT" as well - Answer: Yes.MJ
DON'T change the account SQL runs under using the services applet, do it via configuration manager. This way the correct rights will be assigned to it.
---------------------------------------------------------------------
January 7, 2009 at 1:39 pm
On the server where i am trying to do the restore , both sql server and sql server agent the logon is "Local System Account". Not quite sure what you mean by UNC. The same sahre folder i am abel to access from target servers cmd prompt which means something is missing in sql id that i am using to access that backup file. The id i and using to do the restore is windows NT id which has admin privileges.
January 7, 2009 at 2:19 pm
to be able to restore across the network Sql must run under an account that has network privileges. Local system has no such rights, being 'local' to the server. That is why you need to create a domain user account to run the SQL services under plus give that account rights to the server share (see manu's post).
By UNC manu means the full path to the network share, so if it is a share called 'share' on servera in directory c:\mssql\backups\dbname.bak use either
restore database dbname from disk = '\\servera\share$\dbname.bak'
OR
restore database dbname from disk = '\\servera\c$\mssql\backups\dbname.bak'
---------------------------------------------------------------------
January 7, 2009 at 9:59 pm
ishaan99 (1/7/2009)
I am trying to restore a backup on sql 2005 server by accessing the .bak file from a share folder residing on another server. I get an error asCannot open backup device '\\servername\sharefoldername\db.bak'. Operating system error 5(Access is denied.).
I check the permission on both source and target server, checked if source server(with backup file) has full access on share folder and evrything looks ok to me. If from target server on cmd prompt if i do \\servername\sharefoldername teh backup file shows up but somehow doesnt get accessed from sql2005. any help on thsi will be greatly appreciated. TIA
Check the Database service owner (domain user on which service is running) has access on that folder?
January 9, 2009 at 9:13 am
It does not matter what privileges you have when you are logged onto the server. That is not the account used during the restore process. The account running the SQL Server windows service must have access to the network resource. Local System Account can only see local drives, it cannot see the network share. You will need to set up a domain account that can access the network share and use that account to run the SQL Server service.
January 9, 2009 at 9:56 pm
Ed (1/9/2009)
It does not matter what privileges you have when you are logged onto the server. That is not the account used during the restore process. The account running the SQL Server windows service must have access to the network resource. Local System Account can only see local drives, it cannot see the network share. You will need to set up a domain account that can access the network share and use that account to run the SQL Server service.
This is same what i had said.
January 10, 2009 at 4:51 am
Paresh Prajapati (1/9/2009)
Ed (1/9/2009)
It does not matter what privileges you have when you are logged onto the server. That is not the account used during the restore process. The account running the SQL Server windows service must have access to the network resource. Local System Account can only see local drives, it cannot see the network share. You will need to set up a domain account that can access the network share and use that account to run the SQL Server service.This is same what i had said.
and the same as I and MANU said before you. I am sure ishaan99 has it by now. 🙂
---------------------------------------------------------------------
February 29, 2012 at 5:18 am
How to give SQL Server service account FULL CONTROL rights to the file system folder and to the share.
Please give step by step details.
Thanks
Viewing 10 posts - 1 through 9 (of 9 total)
You must be logged in to reply to this topic. Login to reply