0

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

New contributor
Jesus Vidal is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
2
  • might help to say what permissions you have when running the command (& check them on the secondary too) Nov 24 at 17:52
  • Additionally knowing if the databases you want to drop are part of the availability group, and what your drop scripts are, would be helpful.
    – J.D.
    Nov 24 at 18:05
1

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

New contributor
Joshua Harless is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

Your Answer

Jesus Vidal is a new contributor. Be nice, and check out our Code of Conduct.

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.