0

Error message appears when I try to login to my instance. This happened after I have stopped contained AG in the middle of the configuration. Than went and stupidly deleted my AG with databases and backups. Now when the always on high availibity is enabled in Configuration Manager it wont let me login into the instance in SSMS. It yells at me the error below. Please could you help

Error message'Could not find database ID 0. Database may not be activated yet or may be in transition. Reissue the query once the database is available. If you do not think this error is due to a database that is transitioning its state and this error continues to occur, contact your primary support provider. Please have available for review the Microsoft SQL Server error log and any additional information relevant to the circumstances when the error occurred. '

So I have run all the dmv below. The only think it came back was the replica_id but the rest of the info was null from this dmv

select * from [sys].[availability_replicas]
select * from sys.dm_hadr_ag_threads
select * from sys.dm_hadr_auto_page_repair
select * from sys.dm_hadr_automatic_seeding
select * from sys.dm_hadr_availability_group_states
select * from sys.dm_hadr_availability_replica_cluster_nodes
select * from sys.dm_hadr_availability_replica_cluster_states
select * from sys.dm_hadr_availability_replica_states
select * from sys.dm_hadr_cluster
select * from sys.dm_hadr_cluster_members
select * from sys.dm_hadr_cluster_networks
select * from sys.dm_hadr_database_replica_cluster_states
select * from sys.dm_hadr_database_replica_states
select * from sys.dm_hadr_db_threads
select * from sys.dm_hadr_instance_node_map
select * from sys.dm_hadr_name_id_map
select * from sys.dm_hadr_physical_seeding_stats
select * from sys.dm_tcp_listener_states
select * from [sys].[availability_replicas]
Thom A
  • 88,727
  • 11
  • 45
  • 75
Mars
  • 3
  • 1

1 Answers1

0

I encountered a similar issue with another person who had the same problem.

They eventually resolved it by successfully connecting to the SQL Server instance via cmd and dropping the availability group.

My guess is that there was a specific connection saved in SSMS that tried to connect to the specific database that was a member of the CAG (Contained Availability Group), and that's why SQL Server tried to initiate the connection into the (partially configured) CAG.

Most likely the saved connection in SSMS was either to the AG listener, or its "Initial Catalog" was configured as the database that was a member of the CAG.

Once they connected via CMD, they connected to the instance and a different default database (probably "master"), and that's why SQL didn't try to initiate the connection into the CAG.

In other words: Double-check your saved connection in SSMS and make sure that it's not connecting to the AG listener, nor to a database that is/was a member of the AG.

Once you connect successfully, drop the availability group (again).

Eitan Blumin
  • 113
  • 1
  • 8