AWS RDS MSSQL cannot alter the availability group ‘RDSAG0’. because it does not exist or you do not have permission

Posted on

Question :

In AWS RDS MSSQL we have mirroring running between primary and replica via Always On.
We want to remove/drop a couple of databases, but when we try:

ALTER AVAILABILITY GROUP RDSAG0 REMOVE DATABASE [db-name]

we receive the error:

Msg 15151, Level 16, State 1, Line 27
Cannot alter the availability group 'RDSAG0', because it does not exist or you do not have permission.

enter image description here

Any advice is greatly appreciated

Answer :

AWS RDS has some platform-specific commands which you should familiarize yourself with. Running EXECUTE msdb.dbo.rds_drop_database N’your-database-name’ will perform all of the tasks necessary to remove the database from the AG and then drop it. Source: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Appendix.SQLServer.CommonDBATasks.DropMirrorDB.html

Leave a Reply

Your email address will not be published. Required fields are marked *