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 123»»»

"Sql server error 5120" while attaching database Expand / Collapse
Author
Message
Posted Wednesday, April 9, 2008 12:46 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, March 11, 2009 1:33 PM
Points: 3, Visits: 21
HI,

I am trying to attach few databases to sql server 2005.I have my .mdf files in "D:\MSSQL\Data" and my .ldf files in "E:\SQLLogs".
when i try to attach it gives me below mentioned error

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

Unable to open the physical file "D:\MSSQL\Data\dbAcquisitionStaging_Data1.mdf". Operating system error 5: "5(Access is denied.)". (Microsoft SQL Server, Error: 5120)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=09.00.3042&EvtSrc=MSSQLServer&EvtID=5120&LinkId=20476

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

I am added as administrator to this server. I checked for permissions on the .mdf and .ldf files It says full control.

Could anybody please advise on how to fix this issue.This is hindering my progress. Any kind of help will be greatly appreciated.

Thanks in advance
lays

Post #482559
Posted Wednesday, April 9, 2008 2:03 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, February 13, 2014 8:15 AM
Points: 7, Visits: 242
need to check permissions to the actual file directories if all good then have your admin reset them, this has more to do with permissions with the directory you are trying to read and write.
Post #482597
Posted Wednesday, April 9, 2008 2:10 PM


SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Wednesday, November 26, 2014 4:49 PM
Points: 866, Visits: 7,478
Check the account under which SQL Server is running. That's the account that needs to have permissions to the files.



And then again, I might be wrong ...
David Webb
Post #482605
Posted Wednesday, April 9, 2008 4:04 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, March 11, 2009 1:33 PM
Points: 3, Visits: 21
Thanks for the response.
The problem is fixed. as the .mdf and .ldf files where on different drives
it was giving some wierd error so i attached only mdf files and the server created .ldf files on the same drive as mdf. this way i could attach it but then i took the db offline copied the log from D:\ to E:\ and then brought the db online. it worked.

thanks a ton for the responses.
Post #482660
Posted Wednesday, June 18, 2008 7:45 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, November 1, 2011 6:26 AM
Points: 1, Visits: 1
Hello !!!

try login with Windows Authentication.

Gala;)
Post #519022
Posted Wednesday, June 18, 2008 8:32 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Tuesday, February 1, 2011 3:13 AM
Points: 139, Visits: 282
Hi Lays,

How did u copy the log from D:\ to E:\ as mentioned.

this way i could attach it but then i took the db offline copied the log from D:\ to E:\ and then brought the db online. it worked.

Pls tell me how did u do this.

Thanks in advance.
Post #519107
Posted Saturday, August 28, 2010 1:04 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Saturday, August 28, 2010 1:00 PM
Points: 2, Visits: 0
Although it's an old post, this problem is still actual. As this post wasn't closed with a working solution, I write it here:

Start SQL Server manager as Administrator (right-click on the program, choose "Start as administrator"): problem solved!

I wrote this solution on Developer's Challenges, SQL Server Error 5120 .
Post #976999
Posted Saturday, February 26, 2011 1:36 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Saturday, February 26, 2011 1:35 PM
Points: 1, Visits: 0
You are some amazing!
Yes, it works perfectly.
Thanks a lot
Post #1070066
Posted Monday, May 2, 2011 5:14 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, July 22, 2013 4:41 AM
Points: 1, Visits: 2
If you are using windows 7. Open the studio management by Right click and
Run as Administrator. then log on in windows mode and try to attach the database . It will work for sure
Post #1101502
Posted Wednesday, May 11, 2011 3:47 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, May 11, 2011 3:46 AM
Points: 1, Visits: 0
dotnet-786228 (6/18/2008)
Hello !!!

try login with Windows Authentication.

Gala;)


Yaaaaaaaaaaa, this solution work fine

Viet Anh,
cheers
Post #1106726
« Prev Topic | Next Topic »

Add to briefcase 123»»»

Permissions Expand / Collapse