April 9, 2008 at 12:46 pm
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
April 9, 2008 at 2:03 pm
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.
April 9, 2008 at 2:10 pm
Check the account under which SQL Server is running. That's the account that needs to have permissions to the files.
April 9, 2008 at 4:04 pm
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.
June 18, 2008 at 7:45 am
Hello !!!
try login with Windows Authentication.
Gala;)
June 18, 2008 at 8:32 am
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.
August 28, 2010 at 1:04 pm
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 .
February 26, 2011 at 1:36 pm
You are some amazing!
Yes, it works perfectly.
Thanks a lot ๐
May 2, 2011 at 5:14 am
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 :w00t:
May 11, 2011 at 3:47 am
dotnet-786228 (6/18/2008)
Hello !!!try login with Windows Authentication.
Gala;)
Yaaaaaaaaaaa, this solution work fine ๐
Viet Anh,
cheers
May 12, 2011 at 10:53 am
Thank You Very Much:-)
June 16, 2011 at 7:42 am
THANK YOU!!!!!!!!!!!!! You saved me from more hours of frustration ๐
August 10, 2011 at 8:11 pm
Hello Mr.
รจ an old post, but decided that situation as follows:
When you attach the base within the D: \ <folder> \ MSSQL \ Data presented this error so I created another folder inside the Data folder put the base you want to attach inside the folder I created and it worked then the path was D: \ <folder > \ MSSQL \ Data \ <new <folder
Note: We attach multiple database within the directory D: \ <folder> \ MSSQL \ Data, and have never been read-only just this last.
August 17, 2011 at 11:48 am
Hello, I'm receiving this error also. I'm trying to attach some databases that came with the MCTS 70-433 Exam Training Kit. After copying the databases from the CD to my hard drive, two of the databases attached fine. But a third, which required I copy an .ldf file, an .mdf file, and a documents folder, will not attach. The error message says that it cannot find the Documents file specified. Which is weird, because it's in the same place as the data files. It's looking for '\MSSQL10.MSSQLSERVER\MSSQL\DATA\DOCUMENTS' but the default name of the program file given (which I can't/don't know how to change) is '\MSSQL10_50MSSQLSERVER\MSSQL\DATA....'
Just trying to learn SQL Server after learning Oracle.
Any help on this? I'm running Windows 7, SQL Server 2008 R2. And I've logged in Windows Authentication mode. Thanks in advance.
August 17, 2011 at 12:05 pm
Please post new questions in a new thread. Thanks
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
Viewing 15 posts - 1 through 15 (of 26 total)
You must be logged in to reply to this topic. Login to reply