Set environment variables

Previous Topic

Next Topic

Book Contents

Set environment variables

In this procedure, you edit configuration scripts, which set environment variables for the command shells you use. You must log out and log in again for the changes you make in this section to take effect.

In this section, you configure environment variables for your application server using your privileged account and using sudo. This section requires you to edit files, using commands such as the following. The first command logs you in as root. If you are prompted for your password after entering this command, enter your password, not the password of root.

$ sudo su - root

# vi <file_name>

# exit

To set environment variables:

  1. Edit the /etc/profile file, as follows
    1. Add the following lines to the file.

      ORACLE_BASE=/u01/app/oracle

      ORACLE_HOME=/u01/app/oracle/product/12.1.0

      ORACLE_SID=<server_sid>

      NLS_LANG=AMERICAN_AMERICA.AL32UTF8

      JAVA_HOME=<jdk_home_location>

      export ORACLE_BASE ORACLE_HOME ORACLE_SID NLS_LANG JAVA_HOME

      Note: For the values in the first two lines, use information about your Oracle client installation. For <jdk_home_location>, use the location where the JDK is installed.

    2. Add the bin directories of your Oracle client and Java installations to the PATH variable. For example, add the following line as the last line where the PATH variable is set:

      export PATH=$ORACLE_HOME/bin:$JAVA_HOME/bin:$PATH

  2. Edit the /etc/csh.login file, as follows:
    1. Add the following lines to the file.

      setenv ORACLE_BASE /u01/app/oracle

      setenv ORACLE_HOME /u01/app/oracle/product/12.1.0

      setenv ORACLE_SID <server_sid>

      setenv NLS_LANG AMERICAN_AMERICA.AL32UTF8

      setenv JAVA_HOME <jdk_home_location>

      Note: For the values in the first two lines, use information about your Oracle client installation. For <jdk_home_location>, use the location where the JDK is installed.

    2. Add the bin directories of your Oracle client and Java installations to the PATH variable. For example, add the following line as the last line where the PATH variable is set:

      setenv PATH ${ORACLE_HOME}/bin:${JAVA_HOME}/bin:${PATH}

Send Feedback