Tag Archives: Oracle

Oracle 11g XE: Setting Environment Variables on CentOS/RHEL

There are many posts on how to set the required environment variables, namely ORACLE_HOME, after the installation of Oracle 11g Express Edition (XE). They usually tell you to change some init scripts for bash (e.g. ~/.bashrc or ~/.bash_profile). While this is a possible approach, it is more complicated than necessary and certainly not elegant.

CentOS/RHEL has a nice mechanism to add environment variables on a global basis and separately for different programs. Just check out this directory:
/etc/profile.dEach file in there sets the environment variables for just a single program, so things are kept nicely separated. The files are just normal shell scripts with regard to syntax and do not need to be executable.

And since Oracle 11g XE has already created a file with exactly the right content as part of the installation, it is just enough to create a symlink from /etc/profile.d to this file.
ln -s /u01/app/oracle/product/11.2.0/xe/bin/oracle_env.sh /etc/profile.d/Just login to another shell session and check the environment variables with set. You should see, among other variables, the following values
Hope that helps!

Oracle DB does not start

Sometimes people wonder why Oracle DB (both 10g and 11g) will not start after installation on Linux/Unix. In many cases the simple reason is the content of /etc/oratab. For each database it contains a line in the format $ORACLE_SID:$ORACLE_HOME:START_DB_FLAG:The last column is set to “N” by default. Just change it to “Y” and run $ORACLE_HOME/bin/dbstart again. Your database should come up now.