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.