Monday, 20 June 2011

SetDb.env - Oracle Database Key environment Settings.

 You need the following environment setting set in your linux environment so that you can start working with the Oracle DB.

ORACLE_SID=<NAME of your DB>
export ORACLE_SID
ORACLE_HOME=<complete path of your oracle home>
export ORACLE_HOME
PATH=$ORACLE_HOME/bin:$PATH
export PATH

you can either have them typed every time you log in to the linux environment or create them as an  environment file which you can execute every time you log in to your Linux Environment.

Steps as follows:
==============
1. vi <Filename>.env or <Sid_ServerName>.env
2. copy paste the below:

ORACLE_SID=<NAME of your DB>
export ORACLE_SID
ORACLE_HOME=<complete path of your oracle home>
export ORACLE_HOME
PATH=$ORACLE_HOME/bin:$PATH
export PATH

3. Replace the parameters <Values> with your Database values.
4. Save the file.
5. Make sure that you have provided execute permissions for the file.
6. Now execute the file (Source the file) as shown below:

.<Space>./<Filename>.env.

Now all your environment variables are set.

If you would like to verify the environment Variables try the following:

$ echo $ORACLE_HOME or $ORACL_SID

You should see the values as set earlier.

Note: When the above environment variables are not set most of the Database utilities will fail to work.

For example when you run sqlplus will return an error such as:

message file spl<lang>.msb not found

SP2-0750 need to set ORACLE_HOME to your ORACLE software directory 


Reference Source: sqlplus not initializing in linux (Oracle Forum)


No comments:

Post a Comment