Strange question, right? You should know you applications and databases and how everything works, right?
Happen that some days ago a client requested me to identify from which database is a service_name. Easy? Not if the server have 46 database instances running…
Ok, now how can I can this information as quick as possible?
I know that the command below give me all distinct databases in CRS:
/u01/app/184.108.40.206/grid/bin/crsctl stat res -t -w "TYPE = ora.database.type"
Now, lets make some sed magic:
[root@nprd01dbadm01 ~]# /u01/app/220.127.116.11/grid/bin/crsctl stat res -t -w "TYPE = ora.database.type" |grep ora. |sed 's/ora./srvctl status service -d /' |sed 's/.db/ |grep \$1/' | head -1 srvctl status service -d dba |grep $1