To connect to Oracle with sqplus you need to load the environment.
You need to use the .oraenv or .profile file to load the environments.
In this article I will describe how to create a .profile file.
You can use the “How To Connect To Oracle With sqlplus” article to connect to oracle with sqlplus.
First we go to the root directory using the cd command. Then we run the following command.
After opening the file, you need to edit the following contents according to your system and add it to the file.
You can learn the parameters you need to fix by using the following script.
select * FROM V$DIAG_INFO;
There are two parameters we can not learn from the script above. I also explained below how to find these parameters.
You can find Instance_SID with the command below.
ps -ef |grep pmon
In the section after “pmon _” you can see the SID of the instances.
You can find ‘uniquename’ with the command below.
select name,db_unique_name from v$database;
Here is the content of the .profile file
#export NLS_LANG=AMERICAN_AMERICA.AL32UTF8; export NLS_LANG;
LD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORACLE_HOME/rdbms/lib:$ORACLE_HOME/ctx/lib; export LD_LIBRARY_PATH
PATH=$ORACLE_HOME/bin:$PATH:$ORACLE_HOME/OPatch:$CRS_HOME/bin; export PATH
LIBPATH=$ORACLE_HOME/lib; export LIBPATH
alias oh='cd $ORACLE_HOME'
alias gh='cd $GRID_HOME'
alias crs='cd $CRS_HOME'
alias oa='cd tracefile_path'