Configuring the Operating System Environment Variables

Configuring the Operating System Environment Variables


Before using certain tools that access the Oracle database, such as SQL*Plus, you must configure environment variables for your operating system.

These environment variables are used by Oracle Database to determine the database instance to which the tool should connect.

To configure operating system environment variables for your database instance on Linux and UNIX systems:

1. Open an operating system command window.

2. Ensure that the environment variables ORACLE_HOME and ORACLE_SID are set properly.


                         export ORACLE_SID=orcl
                         setenv ORACLE_SID=orcl

You can set these with the scripts coraenv (for the C shell) and oraenv (for other shells). These scripts are typically located in the /usr/local/bin directory.

3. Ensure that the $ORACLE_HOME/bin directory is in your PATH environment variable.


4. You can also edit the profile file for your default shell in the home directory of the software owner, for example /home/oracle, so that these environment variables are set every time you log in as that user.


Export all the variables mentioned below-

Environment//.bash_profile:

export TMP=/tmp
export TMPDIR=$TMP
export ORACLE_HOSTNAME=db12cstby.profad.com
export ORACLE_UNQNAME=stby
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/12.1.0.2/stby
export ORACLE_SID=stby
export PATH=/usr/sbin:$PATH
export PATH=$ORACLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib

No comments:

Post a Comment