Set environment variables

Previous Topic

Next Topic

Book Contents

Set environment variables

In this section, you edit configuration scripts to set environment variables for the command shells you use on your application server using your privileged account and sudo.

To edit files, you use commands such as the following:

$ sudo su - root

# vi <file_name>

# exit

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.

You must log out and log in again for the changes you make in this section to take effect.

To set environment variables, perform the following:

  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

      NLS_LANG=AMERICAN_AMERICA.AL32UTF8

      JAVA_HOME=<jdk_home_location>

      export ORACLE_BASE ORACLE_HOME 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 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