Noticed that one of our databases was not getting backed up.
And, so launched ‘Management Studio’, selected the database and tried to review its properties..
But, no was instead greeted with this message:
Property Owner is not available for Database ‘[xyz]’. This property may not exist for this object, or may not be retrievable due to insufficient access rights. (Microsoft.SqlServer.Smo)
Launched a query tool to determine the database owner:
select name, database_id, owner_sid, suser_sname(owner_sid) as owner from sys.databases
Noticed that suser_sname(owner_sid) came back null — This usually means the owner is no longer valid per the SQL Instance (sql native user) or Active Directory (Windows OS user).
And, so went ahead and changed the owner:
use go exec sp_changedbowner
Re-ran the maintenance job and we are good.
Will monitor for a few — Not sure if this is a pattern – Are SQL Server Maintenance Plans skipping orphaned databases?