[dba-SQLServer] Sufficient rights

jwcolby jwcolby at colbyconsulting.com
Mon Jun 1 09:05:01 CDT 2009


The OS is Windows 2003, SQL Server 2005.

The issue appears to be that the "owner" of the files is not the new Administrator, but rather the 
previous Administrator.  From what I can tell the OS creates some kind of key that represents the 
Administrator (and in fact a different such key for every user) and this number is newly created 
(and random) as a user is created.  I am sure you have seen a warning from Windows that if you 
delete a user "bad things will happen", I think it is this key will be deleted and so anything that 
user owned will now be orphaned.

So when I created the files, the owner was represented not by the NAME administrator, but rather a 
"key" for the OLD administrator.  When I rebuilt the system, the new Administrator got a new key, 
and thus the keys didn't match, and the new Administrator didn't own the file.

I found a place in properties to take possession of a directory (or drive) and all the 
subdirectories / files below it, and did so.

THAT problem went away.  However the new owner did not have ALL rights to the files by default.  I 
have to go in and give the new owner all rights, and then things work just as expected.  Rather a 
PITA all around.

I am actually back functioning again, grabbed ownership, set the files (databases) to full rights 
etc. and reattached the databases.  It is just a bit of work to do all of that stuff.  My guess is 
that there is no way around this.

John W. Colby
www.ColbyConsulting.com


Francisco Tapia wrote:
> I've never ran into that error before, what is the OS you rebuilt to?, which
> Verison of Sql Server?
> -Francisco
> http://sqlthis.blogspot.com | Tsql and More...
> 
> 
> On Sun, May 31, 2009 at 3:01 PM, jwcolby <jwcolby at colbyconsulting.com>wrote:
> 
>> I rebuilt one of my servers from the ground up yesterday, OS, SQL Server
>> etc.  Now when I try to
>> reattach the databases I get a "create file encountered operating system
>> error 5" error.  When I
>> Google that I find things that say that the user that SQL Server is trying
>> to use to open the files
>> doesn't have sufficient rights and was pointed to configuration manager /
>> services.
>>
>> I am in Configuration manager / services and the SQL Server Integration
>> Services uses the NT
>> Authority \ Network Services user.  All the others use LocalSystem.
>>
>> What user should all of these services use, and is this even the problem?
>>  Do these services not
>> have sufficient rights?  These directories are on a raid array which is the
>> only survives over a
>> rebuild, were created long ago by users long since killed (by system
>> rebuilds).
>>
>> TIA for your help.
>>
>> BTW, I can create NEW databases (I tried), but cannot attach the existing
>> databases.  And yes, I
>> detached the databases before I rebuilt the system.
>>
>> --
>> John W. Colby
>> www.ColbyConsulting.com
>> _______________________________________________
>> dba-SQLServer mailing list
>> dba-SQLServer at databaseadvisors.com
>> http://databaseadvisors.com/mailman/listinfo/dba-sqlserver
>> http://www.databaseadvisors.com
>>
>>
> _______________________________________________
> dba-SQLServer mailing list
> dba-SQLServer at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/dba-sqlserver
> http://www.databaseadvisors.com
> 
> 



More information about the dba-SQLServer mailing list