Sql-server – Can Set-DbaAgReplica filter any SqlInstances out

dbatoolssql server

I have been working with an Availability Group with an extra asyncronous secondary, that is always set to manual failover.

I am worried that if I ran:

Get-DbaAgReplica -SqlInstance x -AvailablityGroup y | Set-DbaAgReplica -FailOver Automatic

it would then set all the sqlinstances to auto failover, I was wondering if you can ignore an instance?

Best Answer

The command works at the Availability Group level - not database level. Therefore ALL databases that have been added to that Availability Group will failover at the same time. You cannot have some of them on the Primary and some of them on the Secondary.

If you need to have different databases failover at different times then put them in different Availability Groups.

So NO, it doesn't set all the databases to auto-failover, it sets the Availability Group to auto-failover.