Last post Jun 09, 2017 12:24 AM by priyankmtr
Jun 08, 2017 11:22 PM|priyankmtr|LINK
Recently we came to know that there was some individual owner of the production database that is no more in the organization. Now our database does not have any db owner and due to that our few services are failing. I know we can assign an owner by running
exec sp_changedbowner 'sa','false'
When I run this command it is going into never ending state. It tries to get lock on whole db but could not.
Now the issues are:-
1. We need to assign a owner to this DB without putting it offline or without any downtime. (Its production 24X7).
2. Its in AlwayOnGroup. (I don't know if that would allow to do things seamlessly.)
Please suggest any solution.
Jun 09, 2017 12:24 AM|priyankmtr|LINK
I found a solution. Its a simple one line command with out any locking and all:-
ALTER AUTHORIZATION ON DATABASE::DB_NAME TO sa