Quantcast
Channel: SQL Server High Availability and Disaster Recovery forum
Viewing all articles
Browse latest Browse all 4689

SQL Server 2012 AlwaysOn sys.databases.is_read_only does not indicate the database is read only on the REPLICA

$
0
0

Facts first:  1. We are running AlwaysOn in production.  2. We have three servers in a cluster.   3. Two of the servers are the Primaries and the 3rd is the replica of both primaries.  

When I run the below query on the replica

select dbdb.name, dbdb.is_read_only, dbdb.is_auto_update_stats_async_on, dbdb.log_reuse_wait_desc, * 
from sys.databases                      as dbdb
where dbdb.database_id > 4
and dbdb.[state] = 0  --guard against a database being offline
and dbdb.is_read_only = 0
and dbdb.[user_access_desc] <> 'SINGLE_USER'

The is_read_only from the table sys.databases is zero!!!!!!!!  Yet, on the replica the databases are indeed read only and read only intent queries are indeed running against the replica.  Is this a bug?  I mean if an AlwaysOn database on the replica is in fact read only, why would this not be marked as read only in the sys.databases?


Viewing all articles
Browse latest Browse all 4689

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>