List replicas / cluster nodes
Oracle
-- Standby destinations:
SELECT dest_id, destination, status, target
FROM v$archive_dest
WHERE status <> 'INACTIVE';
-- RAC instances: SELECT inst_id, instance_name, status FROM gv$instance;The Data Guard configuration can also be viewed with DGMGRL> SHOW CONFIGURATION.
PostgreSQL
SELECT application_name, client_addr, state, sync_state
FROM pg_stat_replication;Lists connected replicas only on the PRIMARY; each row is a standby.
MySQL
SHOW REPLICAS;
-- Before 8.0.22: SHOW SLAVE HOSTS;Run on the source server; shows replicas that have report-host set. SHOW SLAVE HOSTS is an alias in 8.0.22–8.3 and was removed in 8.4.
SQL Server
SELECT ar.replica_server_name, ars.role_desc,
ars.connected_state_desc, ars.synchronization_health_desc
FROM sys.dm_hadr_availability_replica_states ars
JOIN sys.availability_replicas ar ON ars.replica_id = ar.replica_id;role_desc distinguishes PRIMARY/SECONDARY; synchronization_health_desc gives overall health.
MongoDB
rs.status().members.map(m => ({ name: m.name, state: m.stateStr, health: m.health }))stateStr returns PRIMARY/SECONDARY/ARBITER; health 1 means healthy.
Redis
INFO replication
# If Sentinel is used:
# SENTINEL replicas <master-name>The slave0, slave1... lines give the ip/port/offset of each replica.