1
votes

Hi i have a azure sql managed instance and when i execute the below query i get the error as

The operation cannot be performed on database "" because it is involved in a database mirroring session or an availability group. Some operations are not allowed on a database that is participating in a database mirroring session or in an availability group.

Query :

alter database <dbname> set ENABLE_BROKER with ROLLBACK immediate

how do i solve this?

I tried the below

ALTER DATABASE [dbName] REMOVE SECONDARY ON SERVER [serverName]

but it gives me error as This feature is not supported through T-SQL on SQL Database Managed Instance.

1
What Service Tier is your Managed Instance? A Premium/Business Critical uses Availability Groups under the covers to provide redundancy which may be a factor here. You might try changing the tier to Standard/General Purpose to then retry the command and see if that works.Martin Cairney
@MartinCairney I am in general purposeashish
Then check whether the issue identified by @Leon is the culpritMartin Cairney
@LeonYue Yes geo replication is on. But how do i drop the replicated database? I have edited what i tried as per the link suggested by youashish

1 Answers

0
votes

You can use PowerShell to manage the Geo-Failover Group. I think you will need to remove the failover group first with Remove-AzSqlDatabaseInstanceFailoverGroup , make you changes and then recreate the Failover Group.