freddenis/oracle-scripts

Option to only display services based on database state

Closed this issue · 4 comments

It would be great to have an option to only display services that are supposed to be online. As example, if the database is in physical standby mode only display services that should come up when in physical standby.

Hi,

I am not sure I get you, could you please give a real life example ?

Thanks,

Fred

rac-status-example.txt

You are already displaying the role of the database as primary (P) or standby (S). All you should need to do is also check the role of the service and only display them if they are the same type. You have the res -p commented out for services but in that output you have the role type of the service.

If you look at the help for srvctl modify database/service you will also see that there are 4 roles possible (PRIMARY, PHYSICAL_STANDBY, LOGICAL_STANDBY, SNAPSHOT_STANDBY). The services that are of the same type as the database are the ones that are supposed to be started. If you do a role transition from physical_standby to primary then it will stop the standby services and start the primary services. Same thing goes for a role transition from physical_standby to snapshot_standby.

We currently use all but logical_standby and do regular transitions. If you are able to put something together we will easily be able to test it.

You will also notice from my saved output that our service names contain multiple periods. I had to hack the script to be able to display the full service name. I'll open another issue for that one.

Got it, I will be working on it.

It would be great to have an option to only display services that are supposed to be online. As example, if the database is in physical standby mode only display services that should come up when in physical standby.

Closing this old issue, there was work done on the services part which I think have fixed this.