Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Access Denied where doing restore from a shared folder


Access Denied where doing restore from a shared folder

Author
Message
ishaan99
ishaan99
Old Hand
Old Hand (394 reputation)Old Hand (394 reputation)Old Hand (394 reputation)Old Hand (394 reputation)Old Hand (394 reputation)Old Hand (394 reputation)Old Hand (394 reputation)Old Hand (394 reputation)

Group: General Forum Members
Points: 394 Visits: 284
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



MANU-J.
MANU-J.
SSCommitted
SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)

Group: General Forum Members
Points: 1870 Visits: 8766
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
george sibbald
george sibbald
SSCertifiable
SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)

Group: General Forum Members
Points: 6986 Visits: 13687
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.

---------------------------------------------------------------------
ishaan99
ishaan99
Old Hand
Old Hand (394 reputation)Old Hand (394 reputation)Old Hand (394 reputation)Old Hand (394 reputation)Old Hand (394 reputation)Old Hand (394 reputation)Old Hand (394 reputation)Old Hand (394 reputation)

Group: General Forum Members
Points: 394 Visits: 284
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.



george sibbald
george sibbald
SSCertifiable
SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)

Group: General Forum Members
Points: 6986 Visits: 13687
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'

---------------------------------------------------------------------
Paresh Prajapati
Paresh Prajapati
Old Hand
Old Hand (383 reputation)Old Hand (383 reputation)Old Hand (383 reputation)Old Hand (383 reputation)Old Hand (383 reputation)Old Hand (383 reputation)Old Hand (383 reputation)Old Hand (383 reputation)

Group: General Forum Members
Points: 383 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
Arrow +919924626601
http://paresh-sqldba.blogspot.com/
LinkedIn | Tweet Me | FaceBook | Brijj
Ed Zann
Ed Zann
Mr or Mrs. 500
Mr or Mrs. 500 (563 reputation)Mr or Mrs. 500 (563 reputation)Mr or Mrs. 500 (563 reputation)Mr or Mrs. 500 (563 reputation)Mr or Mrs. 500 (563 reputation)Mr or Mrs. 500 (563 reputation)Mr or Mrs. 500 (563 reputation)Mr or Mrs. 500 (563 reputation)

Group: General Forum Members
Points: 563 Visits: 1391
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.



Paresh Prajapati
Paresh Prajapati
Old Hand
Old Hand (383 reputation)Old Hand (383 reputation)Old Hand (383 reputation)Old Hand (383 reputation)Old Hand (383 reputation)Old Hand (383 reputation)Old Hand (383 reputation)Old Hand (383 reputation)

Group: General Forum Members
Points: 383 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
Arrow +919924626601
http://paresh-sqldba.blogspot.com/
LinkedIn | Tweet Me | FaceBook | Brijj
george sibbald
george sibbald
SSCertifiable
SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)

Group: General Forum Members
Points: 6986 Visits: 13687
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. Smile

---------------------------------------------------------------------
aspiring_dba
aspiring_dba
Grasshopper
Grasshopper (14 reputation)Grasshopper (14 reputation)Grasshopper (14 reputation)Grasshopper (14 reputation)Grasshopper (14 reputation)Grasshopper (14 reputation)Grasshopper (14 reputation)Grasshopper (14 reputation)

Group: General Forum Members
Points: 14 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
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search