question

SaiVijaya avatar image
SaiVijaya asked

How to change database's owner which are in Availability group from user account to SA account.

Need to change database's owner from user account to SA account where databases are in Availability group in the 4 node cluster.

Here my question is

  • Is it a best practice to move the database owner to a 'sa' account or windows service account.

  • SQL Server Availability Group does not update DB owner automatically. How to change DBowner in primary and secondary nodes.

I read the below steps in a article

  1. Apply change to primary replica

  2. Fail over the Availability Group

  3. Apply change to the new primary replica

Is it the only option or any other process to sync automatically?

Please guide me if any risk factors while changing DB ownership.

Thanks

sqlserver2012
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
anthony.green avatar image
anthony.green answered

That’s the only way once they are created, otherwise when you do the restoration on the secondary run the command as SA using “execute as” instead that way the restore is done under that context and SA will be the DB owner when restored.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.