0

i connected to sqlplus successfully but After close from terminal and back again ,occurs the following :

[soft3a6ala@soft3a6ala ~]$ su - oracle
Password: 
[oracle@soft3a6ala ~]$ sqlplus / as sysdba
bash: sqlplus: command not found...

How i can save this connect along time

1 Answer 1

2

Seems like you are missing some environment variables.

ORACLE_HOME = {oracle_installation_path}
LD_LIBRARY_PATH = $ORACLE_HOME\lib
PATH=$PATH:$ORACLE_HOME\bin

You should put this into .profile for oracle user, so they get setted on oracle's user login.

For example, if Oracle is installed in /app/oracle/product/10.2.0/db_1

export ORACLE_HOME=/app/oracle/product/10.2.0/db_1
export LD_LIBRARY_PATH=$ORACLE_HOME\lib
export PATH=$PATH:$ORACLE_HOME\bin

The .profile file is located under the user home directory, in this case /home/oracle

If the file doesn't exist, yo can create it

touch .profile

and then edit an paste the values, setting ORACLE_HOME depending on your installation path.

save the file, and give it execution permissions

chmod +x .profile

Then logoff and login again, and you should be able to run it.

Also you can add the environment vars to .bash_profile which is also located on user home directory. If it doesn't exist, create it and do the same as with .profile

Sign up to request clarification or add additional context in comments.

8 Comments

i founded the .bash_profile and open it like the following # .bash_profile # Get the aliases and functions if [ -f ~/.bashrc ]; then . ~/.bashrc fi # User specific environment and startup programs PATH=$PATH:$HOME/.local/bin:$HOME/bin export PATH ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1 LD_LIBRARY_PATH = $ORACLE_HOME\lib PATH=$PATH:$ORACLE_HOME\bin export ORACLE_HOME export LD_LIBRARY_PATH export PATH ------------ but after log off and login again iface this error bash: LD_LIBRARY_PATH: command not found
Read my answer.. you must put the word export before every statement
i follow you exactly but i face this error : -bash: export: =': not a valid identifier -bash: export: /u01/app/oracle/product/11.2.0/dbhome_1lib': not a valid identifier
Do not use ' for paths, also don't use spaces between export VAR=value (I put spaces on the LD_LIBRARY_PATH definition, I'll fix it now)
before any words big thank for you about help you for me but After all this i still facing same problem bash: sqlplus: command not found...
|

Your Answer

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