Some weeks ago I've seen a queryable way to check whether a wiki is closed or not. Unfortunately I don't find it anymore (should have written down the link due to my age...). Any hints?
Topic on Talk:Quarry
If Wikimedia - https://noc.wikimedia.org/conf/highlight.php?file=dblists/closed.dblist
This configuration is stored in configuration file, not in database.
wikitech:Help:Toolforge/Database#Metadata_database is probably what you are looking for.