Encountered a problem where my Oracle 10g database on Solaris 9 would not automatically shutdown or startup during a reboot. The error generated is:
/etc/rc0.d/K01oracle: dbhome: not found
ORACLE_HOME =  ?
On my server, dbhome is located in $ORACLE_HOME/bin as well as /usr/local/bin. This led me to believe the PATH for root might not have /usr/local/bin included during the UNIX system startup/shutdown process. I copied the script to /usr/bin and now the system appears to function fine during UNIX system startup/shutdown.
Strange thing is both directories are in root’s PATH during normal operation.
I will need to investigate further on why /usr/local/bin is not included in the PATH of root during UNIX system startup/shutdown. Is that by system design (i.e. security) or system misconfiguration?
Another strange thing is this does not occur on my Solaris 10 server running Oracle 10g. Even more confused now.
On Solaris 10 when running the shutdown/startup scripts manually as the root user, this problem does not occur. However, when the system is rebooted the error does occur. Found the error in /var/svc/log/milestone-multi-user:default.log.
Executing legacy init script “/etc/rc2.d/S99oracle”.
Oracle Startup/Shutdown Begins
/etc/rc2.d/S99oracle: dbhome: not found
ORACLE_HOME =  ? /etc/rc2.d/S99oracle: test: argument expected
Legacy init script “/etc/rc2.d/S99oracle” exited with return code 1.
My resolution to this problem was to copy dbhome from /usr/local/bin to /usr/bin. The error no longer occurs during server reboot.