Oracle 11.2.0.2/3, SE-One
Oracle GI 11.3, stand-alone ASM, no cluster, no RAC
Oracle Linux 5.6 x86-64
Trying to get a better grip on commands dealing with Oracle Restart.
First, from the Database Administrator’s Guide (E25494-03), p. 4-10, under “Preparing to run SRVCTL”, it states that you must run srvctl from the ORACLE_HOME appropriate for the component to be configured. But it seems that this is if you are configuring a component. What about simply querying status – “srvctl config …”? My testing seems to indicate that I can “config” (a bit of a misnomer, no?) both db and ASM components from the ASM home.
The reason I ask is that I’d like to write a generic script to report all configured components without the script being hard-coded for any specific database. I’ve got that working by hard-coding the environment for one of the databases before calling ‘srvctl config database’. But to eliminate that I either have to be able to self-discover the names of the databases, or just run it all from the ASM home. The latter seems to work ok, but I’m not grounded enough on this part to know if I’m overlooking a ‘gotcha’. If that’s not good, them it looks like I’m in a chicken-or-egg situation .. can’t get srvctl to give me the name of the configured databases without setting the HOME for a database, and can’t set the HOME for a database (with oraenv) until I have a database name. And while I’m not dealing with it currently, imagine a configuration with multiple databases from multiple HOMEs. Once I have the list of databases (say, grep'ing and awk'ing the output of 'srvctl config database') the rest is easy. But if that initial srvctl requires the OHOME be set to the db home ... not sure how to proceed. Can't grep oratab because nothing there is guaranteed to identify an entry for a database vs. some sometimes generic entries. And grep'ing 'ps -ef|grep pmon' depends on the databases actually being started.
I’ll be the first to admit that whenever the docs start to deal with anything having to do with the Grid Infrastructure, I have a very hard time knowing when something does NOT apply to my non-cluster, non-RAC environment.