ALERT: Some images may not load properly within the Knowledge Base Article. If you see a broken image, please right-click and select 'Open image in a new tab'. We apologize for this inconvenience.

$ORACLE_HOME or $ORACLE_SID environment variable not found (RedHat)

book

Article ID: 173210

calendar_today

Updated On:

Products

Data Loss Prevention Enforce

Issue/Introduction

There are two possible situations:

  1. the export $ORACLE_HOME or export $ORACLE_SID command does not save on reboot
  2. when running echo $ORACLE_HOME or echo $ORACLE_SID from terminal, no path is returned

Generally, there is no error. The environment variables do not save when rebooted and no path is listed when echoing the variable.

Cause

environment variable is not loaded when BASH loads

Environment

Red Hat 6.*, 7.* (RHEL)

Resolution

open terminal and type the following:

  • su - oracle
  • cp ~/.bash_profile ~/.bash_profile.bak
  • vi ~/.bash_profile

*Click here for assistance with VI*

add the relevant lines to the oracle user ~/.bash_profile and save:

  • export ORACLE_HOME=/opt/oracle/product/12.2.0.1/db_1
  • export ORACLE_SID=protect

as the oracle user, type the following into the terminal in order to initialize your changes:

  • source ~/.bash_profile

you can now see your changes with the following command(s):

  • cat ~/.bash_profile
  • env | grep ORACLE
  • echo $ORACLE_HOME && echo $ORACLE_SID