Answered by:
Making adventureworks2012 Read write

Question
-
I have tried to make the adventureworks2012 read write through Object Explorer and get the following error:
TITLE: Microsoft SQL Server Management Studio
------------------------------Alter failed for Database 'AdventureWorks2012'. (Microsoft.SqlServer.Smo)
------------------------------
ADDITIONAL INFORMATION:An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
------------------------------
Unable to open the physical file "C:\Program Files\Microsoft SQL Server\AdventureWorks2012_log.ldf". Operating system error 5: "5(Access is denied.)".
CREATE FILE encountered operating system error 5(Access is denied.) while attempting to open or create the physical file 'C:\AdventureWorks2012_Data_log.ldf'.
Could not restart database "AdventureWorks2012". Reverting to the previous status.
ALTER DATABASE statement failed.
File activation failure. The physical file name "C:\Program Files\Microsoft SQL Server\AdventureWorks2012_log.ldf" may be incorrect. (Microsoft SQL Server, Error: 5120)------------------------------
BUTTONS:OK
------------------------------Monday, January 7, 2013 4:25 PM
Answers
-
hi,
right click Computer - > Manage - > Local Users and Groups - > for all SQL Server groups add NT SERVICE
Thanks & Regards, sathya
- Marked as answer by jmalecki Monday, January 7, 2013 5:41 PM
Monday, January 7, 2013 5:09 PM -
I think I had this problem and sorted it by running SSMS as Administrator.
- Marked as answer by jmalecki Monday, January 7, 2013 5:40 PM
Monday, January 7, 2013 5:14 PM
All replies
-
Did you place the AW files in that folder? Have you then tried attaching this database to your SQL Server instance?
For every expert, there is an equal and opposite expert. - Becker's Law
My blogMonday, January 7, 2013 4:28 PM -
Yes the data file and log files are there with full access. And yes I can attach.Monday, January 7, 2013 4:36 PM
-
So, what happens after ATTACH? Have you also re-started SSMS after that?
For every expert, there is an equal and opposite expert. - Becker's Law
My blogMonday, January 7, 2013 4:38 PM -
The database is read only state.Monday, January 7, 2013 4:50 PM
-
hi,
in windows,try giving administrator privilege for the user thru which you logged-in and using SQL Serrver
right click Computer - > Manage - > Local Users and Groups
and then try this link - http://sathyadb.blogspot.in/2012/10/sql-server-2012-database-read-only.html
Thanks & Regards, sathya
Monday, January 7, 2013 4:55 PM -
hi,
copy the mdf file to some other folder ,if it in C:\ ,then again try attaching and make the database to read-write mode
Thanks & Regards, sathya
Monday, January 7, 2013 4:59 PM -
I am the administrator. I have tried both methods and get the same error msg.Monday, January 7, 2013 5:01 PM
-
hi,
drop the database and try again from beginning....
1.)copy the mdf file to some other folder ,if it in C:\ ,then again try attaching and make the database to read-write mode
2.) in windows,try giving administrator privilege for the user thru which you logged-in and using SQL Serrver
right click Computer - > Manage - > Local Users and Groups
and then try this link - http://sathyadb.blogspot.in/2012/10/sql-server-2012-database-read-only.html
Thanks & Regards, sathya
Monday, January 7, 2013 5:04 PM -
hi,
right click Computer - > Manage - > Local Users and Groups - > for all SQL Server groups add NT SERVICE
Thanks & Regards, sathya
- Marked as answer by jmalecki Monday, January 7, 2013 5:41 PM
Monday, January 7, 2013 5:09 PM -
I think I had this problem and sorted it by running SSMS as Administrator.
- Marked as answer by jmalecki Monday, January 7, 2013 5:40 PM
Monday, January 7, 2013 5:14 PM