Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Access Denied where doing restore from a shared folder Expand / Collapse
Author
Message
Posted Wednesday, January 7, 2009 12:39 PM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Thursday, September 19, 2013 11:03 AM
Points: 374, Visits: 280
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



Post #631787
Posted Wednesday, January 7, 2009 12:51 PM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Thursday, May 22, 2014 7:04 AM
Points: 1,688, Visits: 8,766
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
Post #631803
Posted Wednesday, January 7, 2009 1:03 PM
SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 1:35 AM
Points: 5,886, Visits: 13,044
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.


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

Post #631820
Posted Wednesday, January 7, 2009 1:39 PM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Thursday, September 19, 2013 11:03 AM
Points: 374, Visits: 280
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.


Post #631857
Posted Wednesday, January 7, 2009 2:19 PM
SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 1:35 AM
Points: 5,886, Visits: 13,044
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'


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

Post #631894
Posted Wednesday, January 7, 2009 9:59 PM


Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Tuesday, June 18, 2013 7:41 AM
Points: 323, Visits: 464
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 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


Check the Database service owner (domain user on which service is running) has access on that folder?


_____________________________________________________________________________________________________________
Paresh Prajapati
+919924626601
http://paresh-sqldba.blogspot.com/
LinkedIn | Tweet Me | FaceBook | Brijj
Post #632092
Posted Friday, January 9, 2009 9:13 AM


SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Today @ 6:58 AM
Points: 487, Visits: 1,240

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.



Post #633544
Posted Friday, January 9, 2009 9:56 PM


Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Tuesday, June 18, 2013 7:41 AM
Points: 323, Visits: 464
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.


_____________________________________________________________________________________________________________
Paresh Prajapati
+919924626601
http://paresh-sqldba.blogspot.com/
LinkedIn | Tweet Me | FaceBook | Brijj
Post #634081
Posted Saturday, January 10, 2009 4:51 AM
SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 1:35 AM
Points: 5,886, Visits: 13,044
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. :)


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

Post #634131
Posted Wednesday, February 29, 2012 5:18 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Thursday, February 13, 2014 3:23 AM
Points: 10, Visits: 68
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
Post #1259461
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse