I’ve been doing a lot of testing with Oracle Database 11g lately and I’m a big fan of using oraenv to set the environment. For many releases, it seemed that Oracle had completely ignored oraenv and dbhome, but they’ve made some changes in 11g that aren’t quite so helpful it seems. I’ll probably file an SR on this stuff soon, but it’s easy to fix.

The issue I encountered was that the dbhome script (which is called by oraenv to determine the ORACLE_HOME for a given ORACLE_SID) failed to return the proper ORACLE_HOME in some cases. After reading dbhome (it’s less than 100 lines long), I realized that the issue was…

Oh, nevermind. I started writing this from memory of one of the beta versions and when I went to check (right where I left off typing in the previous paragraph), I found that the issue had been fixed in the production release. So, apparently that bug did get fixed.

To summarize, the bug in dbhome in beta 5 was particularly interesting since it only came up when the first character in your ORACLE_SID name became a special metacharacter when preceded by a backslash (\). So, everything was going along fine until I created an instance named “rac11g1″ and then dbhome failed to work, which also caused in oraenv becoming ineffective. All fixed now, nevermind. Kudos to Oracle for improving the oraenv and dbhome scripts in 11g to now also look for the ORACLE_BASE setting. As many of you have noted or will find out, ORACLE_BASE is becoming increasingly important to Oracle installations.

  • Josedial

    Hi Dan,

    Is there any utility(oracle script) that let me see all the oracle instances running in a server (some command like dblist or dbadmin, dbhome). I'm a consultant and in every place where I go I have to verify almost every time I log into a server wich DB are running ( I mean , I visit many places, and many server that I cannot remember the names of server or databases) so it's sometimes fatiguing(ps -fea|grep pmon) or creating alias that stay only for the session or letting aliases in the .bashrc

    thanks in advance josedial@gmail.com

  • http://www.dannorris.com/ Dan Norris

    I don't know of a command that displays running instances. I usually use “ps -ef|grep smo”, similar to what you posted. I don't think it's that difficult to type and if it is that bothersome, then the first thing to type is “alias i='ps -ef|grep smon'” so that it's readily accessible. I also typically keep a text file of all the frequent commands handy for easy copy/paste which may also solve your issue.