Find RAC services not running on all preferred instances
I think I ran this SQL a few years ago against OEM repository to see all the services that are supposed to run on certain RAC database instances but are actually not:
col database_unique_name for a10 col cluster_name for a20 col service_name for a30 col preferred_instances for a35 col running_instances for a35 select database_unique_name, cluster_name, service_name, preferred_instances, running_instances from sysman.mgmt_rac_services where preferred_instances != running_instances order by 1, 2, 3, 4;
The result contains some lines that are clearly incorrect if we trust the result of "srvctl status service" run on the target database command line or "select * from gv$active_services" inside the target database.