Mark Minasi's Tech Forum
Register Calendar Latest Topics Chat
 
 
 


Reply
  Author   Comment  
DavidJ

Avatar / Picture

Still Checking the Forum Out
Registered:
Posts: 2
Reply with quote  #1 
Can anyone advise why after detaching then moving to a new drive and then attaching, my database is now read only.

I created a database via an installation script. It didn't allow me to choose the location so the DB was created in the default location. I have a G:\Databases folder on a separate drive that contains databases that are not read only. After moving the DB from the default location to this folder and then attaching its read only!!!!

I can get around this by altering the security permissions on the G:\Databases folder but I don't understand why I should need to do this. If I give User's write permission then the DB changes to read write.

I'm running Server 2012R2 and the version of SQL Server is 2008 R2.

David


0
cj_berlin

Avatar / Picture

Senior Member
Registered:
Posts: 199
Reply with quote  #2 
David,

you have to compare permissions on existing (read-write) DB files in that folder and the files you moved there manually. If you drag drop a file between drives in Explorer, you may not get the expected ACLs applied in the target location. My guess is you have to modify permissions on the moved files, not on the whole folder.

If you have configured SQL to run under a doamin user account, that account needs Full Access permission to the folder and everything in it. If you left the service accounts in they default security context, the permissions need to be set by Service SID as described here: https://msdn.microsoft.com/en-us/library/jj219062(v=sql.110).aspx

FWIW,

__________________
Evgenij Smirnov

My personal blog (German): http://www.it-pro-berlin.de/
My stuff on PSGallery: https://www.powershellgallery.com/profiles/it-pro-berlin.de/
0
DavidJ

Avatar / Picture

Still Checking the Forum Out
Registered:
Posts: 2
Reply with quote  #3 
My instructions for the installation tell me to configure SQL Server (MSSQLSERVER) to run as NT AUTHORITY\NETWORKSERVICE I've read the article, is this the same as it describes???
0
wobble_wobble

Avatar / Picture

Associate Troublemaker Apprentice
Registered:
Posts: 780
Reply with quote  #4 
Yes they are the permissions
__________________
Have you tried turning it off and walking away? The next person can fix it!

New to the forum? Read this
0
Previous Topic | Next Topic
Print
Reply

Quick Navigation: