I have Availability Group with below config:
replica-01: SQL Server 2012 (primary) replica-02: SQL Server 2012 (secondary synchronous) replica-03: SQL Server 2016 (secondary asynchronous)
replica-01 and 02 are in on-premise data center replica-03 is on Azure VM (03 is synchronizing, no problems here)
When I try to use replica-03 as reporting read-only server, running "use MyDB" statement shows the following
Cannot open database 'TestDB' version 706. Upgrade the database to the latest version.
I tried to run ALTER DATABASE MyDB SET COMPATIBILITY_LEVEL = 130 But it shows error message:
ALTER DATABASE failed because a lock could not be placed on database
Tried to exclude MyDB from availability group, set compatibility level to 130, and include back to AG But since database in NORECOVERY mode, it does not allow me to set compatibility level
If I restore database with recovery, I can set compatibility level to 130, but can't return database in norecovery mode, and can't add back to AG
What do you suggest on above ?
I need to keep primary SQL server replica as 2012 for now, and I need to make async replica (SQL server 2016) to be available for read-only access