March 18, 2015 at 11:34 am
We have some databases where the query
select name, SUSER_SNAME(owner_sid) from sys.databases
where name = 'DBNAME'
come up NULL.
There is a SID in sys.databases for the database, but my guess is that it is an Active Directory SID belonging to the DBA who created the database and no longer works here, so the SID no longer resolves.
I know one practice is to set db_owner to 'sa' unless there is a requirement to do otherwise, but sa has all the rights anyway. Is there any harm to leaving this as is?
March 18, 2015 at 12:21 pm
dan-572483 (3/18/2015)
Is there any harm to leaving this as is?
Yes.
You'll go to set up something like replication, or maybe CDC, or any one of the other features that check the db_owner and you'll get an error that says nothing like ''database does not have a valid owner" and you'll spend days trying to figure it out until you run across a forum post where someone mentions the database owner not being valid.
Set it to sa. There's little reason not to, it's not escalating permissions since sa is sysadmin (and should be disabled anyway)
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 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply