-1

I installed Oracle 19c on Centos. When I try to run the sqlplus command, it says "bash: sqlplus: command not found..." So, I have to configure the variables. I went to the vi editor to configure when I restart sqlplus it still doesn't work I try .oraen here is what it means

vi editor
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/19.0.0/dbhome_1
export ORACLE_SID=ORCLDB
export PATH=$ORACLE_HOME/bin:$PATH


PATH=$PATH:$HOME/.local/bin:$HOME/bin

export PATH
# User specific environment and startup programs

Oraenv
[oracle@localhost ~]$ . oraenv
ORACLE_SID = [ORCLDB] ?  ORCLDB
ORACLE_HOME = [/home/oracle] ? /u01/app/oracle/product/19.0.0/dbhome_1
ORACLE_BASE environment variable is not being set since this
information is not available for the current user ID oracle.
You can set ORACLE_BASE manually if it is required.
Resetting ORACLE_BASE to its previous value or ORACLE_HOME
The Oracle base remains unchanged with value /u01/app/oracle
[oracle@localhost ~]$ 

1 Answer 1

0

Welcome to learning the Oracle Database!

The main point to understand is that you can have multiple Oracle Databases running on the same host running different versions of the database. Every database is instantiated out of an ORACLE_HOME - the binary area. This is key. When you are a beginner, this can be overwhelming because you only have one ORACLE_HOME and one database. In the corporate world, there are typically databases running different versions in different binary areas - ORACLE_HOMEs

After installing the database, you need to set the environment.

  1. login as user oracle
  2. Use the oraenv utility to set the environment based on /etc/oratab
  3. use the tools (sqlplus,datapump,sqlldr,rman,etc..)

An example

# there is no environment set (output is empty)
[oracle@host01 ~]$ env | grep ORA

# list my environments
[oracle@host01 ~]$ grep dbhome /etc/oratab
ORCLDB:/u01/app/oracle/product/19.0.0/dbhome_2:N

# I have one environment. '<<<' is a bash construct. Remember the dot '.'
# you can also do this interactivly
[oracle@host01 ~]$ . oraenv <<< ORCLDB
ORACLE_SID = [oracle] ? The Oracle base has been set to /u01/app/oracle

# is my environment set?
[oracle@host01 ~]$ env | grep ORA
ORACLE_SID=ORCLDB
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=/u01/app/oracle/product/19.0.0/dbhome_2

# yes it is 
[oracle@host01 ~]$ type sqlplus
sqlplus is /u01/app/oracle/product/19.0.0/dbhome_2/bin/sqlplus

Side note. I recommend Oracle Linux. (It is free). There you have the "preinstall*" dnf-packages where the kernel is configured correctly before installing the database.

Best of luck!

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.