The Standby Server is failing with metadata login issue . The metadata is on Always on group . The primary does not have any issue and is running. Where can we locate the metadata connection string and how do we resolve the issue.
Below is exception seen in the standby DE tracelog.
20221128 11:20:06.788 [relationaldatabase] [ERROR] main: [2022-11-28_11:20:06.783] Exception: The target database, 'CAWADE', 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. ClientConnectionId:xxxxxxxxxxxx
com.microsoft.sqlserver.jdbc.SQLServerException: The target database, 'CAWADE', 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. ClientConnectionId:xxxxxxxxxxxx
at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:262)
at com.microsoft.sqlserver.jdbc.TDSTokenHandler.onEOF(tdsparser.java:283)
at com.microsoft.sqlserver.jdbc.TDSParser.parse(tdsparser.java:129)
at com.microsoft.sqlserver.jdbc.TDSParser.parse(tdsparser.java:37)
Release : 12.x
Use the setdbparm utility to update the database properties file (db.properties) to point to the appropriate URL for your Always On database. The server must be reachable on your network..
In this case, you'll use the following syntax and provide the appropriate DB URL details when prompted.
setdbparm.bat jdbc.URL
Below is example of db.properties file:
######################
# Database
######################
jdbc.Driver=com.microsoft.sqlserver.jdbc.SQLServerDriver
jdbc.URL=jdbc:sqlserver://;servername=cawadesql;DatabaseName=CAWADE;selectMethod=cursor
rdbms.type=Microsoft SQL Server
rdbms.userid=CAWADE_USER
rdbms.password=<masked>