Databases Not Visible in Availability Groups on Primary or Secondary Server
In MS SQL Servers with version "Microsoft SQL Server 2022 (RTM-CU10) (KB5031778) - 16.0.4095.4 (X64) Oct 30 2023 16:12:44 Copyright (C) 2022 Microsoft Corporation Enterprise Edition: Core-based Licensing (64-bit) on Linux (Ubuntu 20.04.6 LTS) <X64>", there is an issue with an availability group setup. A second availability group has been created successfully, but the databases are not visible under the availability databases on the primary server.
When attempting to add the database to the group, a message indicates that the database already exists in the group. On the secondary server, the databases appear in the availability group, and synchronization functions correctly.
Additionally, it has been noted that sometimes the databases are visible on the primary server but not on the secondary, while in other availability groups, the databases are not visible on either server.
The queries on the following views return relevant information about the availability group and the databases:
-
sys.dm_hadr_database_replica_states
-
sys.availability_groups
-
sys.availability_replicas
-
sys.dm_hadr_availability_replica_states
However, sys.availability_databases_cluster
does not return the names of the invisible databases, only the names from the availability groups where the databases are visible. The AG Dashboard also fails to display the databases.
Any insight into resolving this issue would be greatly appreciated.