1

Lets imagine that i have two servers/nodes with TWO availability groups Group01 and Group02. I will need to ensure that the server objects are all the time recreated over the secondary replica.

If i have the Group01 in one node as primary, and the Group02 in the other node as primary, how will the sync of server objects be processed?

I was thinking of using dbatools with one command line only:

Start-DbaMigration -Source $PrimaryInstance `
                   -Destination $SecondaryInstance ` 
                   -Exclude Databases

What am I missing here?

1 Answer 1

3

The server object are at the server level e.g. logins, jobs, etc. So you can just use Sync-DbaAvailabilityGroup

Syncs depdendent objects for availability groups. Such objects include:

SpConfigure
CustomErrors
Credentials
DatabaseMail
LinkedServers
Logins
LoginPermissions
SystemTriggers
DatabaseOwner
AgentCategory
AgentOperator
AgentAlert
AgentProxy
AgentSchedule
AgentJob

What you are using is a much bigger umbrella that folks use for migration from one server to another.

3
  • Thank you very much Commented Jun 13, 2019 at 14:03
  • If this ps function is scheduled to run as an agent job, and it will also sync this agent job then how do I ensure it only runs on primary? Commented Jan 18, 2023 at 17:12
  • you check before executing the function if it is a primary node or not .. e.g. dba.stackexchange.com/a/66068/8783 will help you. Commented Jan 30, 2023 at 10:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.