how can I find the list of databases I actually can connect to?
I am using sys.master_files to check the state of my database files however, on the secondary, the database is synchronizing and it is showing as ONLINE
I cannot do this:
use my_database
and I cannot do this:
select * from my_database.sys.master_files
Msg 976, Level 14, State 1, Line 364 The target database, 'my_database', is participating in an availability group and is currently not accessible for queries. Either data movement is suspended or the availability replica is not enabled for read access. To allow read-only access to this and other databases in the availability group, enable read access to one or more secondary availability replicas in the group. For more information, see the ALTER AVAILABILITY GROUP statement in SQL Server Books Online.