SP2-0750: You may need to set ORACLE_HOME to your Oracle software directory

Hi experts,
I get the following error when I want to start sqlplus:

[oracle@localhost ~]$ sqlplus
Error 6 initializing SQL*Plus
Message file sp1<lang>.msb not found
SP2-0750: You may need to set ORACLE_HOME to your Oracle software directory
[oracle@localhost ~]$

For more information, tnsnames.ora is as follows:

# tnsnames.ora Network Configuration File: /u01/app/oracle/product/10.2.0/db_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.

ORCL =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = localhost.localdomain)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orcl)
    )
  )

EXTPROC_CONNECTION_DATA =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
    )
    (CONNECT_DATA =
      (SID = PLSExtProc)
      (PRESENTATION = RO)
    )
  )

for more information, oracle's .bash_profile is as follows:

# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
      . ~/.bashrc
fi
ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1
PATH=$PATH:$HOME/bin:$ORACLE_HOME:$ORACLE_HOME/bin
export PATH
LIBPATH=$ORACLE_HOME/lib:$LIBPATH;export LIBPATH
ORACLE_SID=orcl;export ORACLE_SID
# User specific environment and startup programs
unset USERNAME


regards,
raju1
raju1Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

omarfaridCommented:
can you export the env variables as well?

in .bash_profile add the following line after setting the env variables:

export ORACLE_HOME LIBPATH

Why you unset USERNAME
0
raju1Author Commented:
I have mentioned it on the question. I wrote it in .bash_profile as follows:
LIBPATH=$ORACLE_HOME/lib:$LIBPATH;export LIBPATH

Is it correct?

I am new to linux for oracle. I don't know Why you unset USERNAME.
0
omarfaridCommented:
Ok, the line

LIBPATH=$ORACLE_HOME/lib:$LIBPATH;export LIBPATH

is correct, but you need to do so for ORACLE_HOME as well:

ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1 ; export ORACLE_HOME

0
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

SujithData ArchitectCommented:
Set this in command line:

ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1
export ORACLE_HOME

and then try to connect to sqlplus.
0
raju1Author Commented:
I have mentioned on the question that I wrote as follows:
ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1
PATH=$PATH:$HOME/bin:$ORACLE_HOME:$ORACLE_HOME/bin

is it correct?
0
omarfaridCommented:
You need to change

ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1

to

ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1 ; export ORACLE_HOME
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
raju1Author Commented:
Thanks. I have re-written my .bash_profile as follows:

ORACLE_BASE=/uo1/app/oracle; export ORACLE_BASE
ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1; export ORACLE_HOME
ORACLE_OWNER=oracle; export ORACLE_OWNER
PATH=$PATH:$HOME/bin:$ORACLE_HOME:$ORACLE_HOME/bin
export PATH
NLS_LANG=AMERICAN; export NLS_LANG
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib:/usr/local/lib; export LD_LIBRARY_PATH
LIBPATH=$ORACLE_HOME/lib:$LIBPATH;export LIBPATH
ORA_NLS33=$ORACLE_HOME/nls/data; export ORA_NLS33
ORACLE_SID=orcl;export ORACLE_SID
# User specific environment and startup programs
unset USERNAME
#export ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1
#export PATH=/u01/app/oracle/product/10.2.0/db_1/bin


It is working now. But it shows the following errors now:

SQL> connect system/immi123
ERROR:
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Linux Error: 2: No such file or directory
0
raju1Author Commented:
Enter user-name: sys/immi123 as sysdba
Connected to an idle instance.

SQL> select table_name from tabs;
select table_name from tabs
*
ERROR at line 1:
ORA-01034: ORACLE not available
0
omarfaridCommented:
Oracle database is not started, or you are using the wrong SID

Check if oracle is started or if you SID is different.

To check if oracle is running, run

ps -ef | grep ora

You should see some processes that are owned by oracle

OR

ipcs

You should see some shared memory owned by Oracle, etc.

OR

contact your DBA to start oracle DB.

0
omarfaridCommented:
0
raju1Author Commented:
Pls can you solve the prrblem of php installment. Whe I run the following command:
./configure --prefix=/web/php --with-oci8=$ORACLE_HOME --with-apxs2=/usr/sbin/apxs --with-config-file-path=/etc/httpd/conf --enable-sigchild

Errors after checking:
Checking OCI8 libraries dir... Configure: error: Oracle (OCI8) required libraries not found


I have also run the following command, but it generates the same error.
./configure --prefix=/web/php --with-oci8=$ORACLE_HOME/lib --with-apxs2=/usr/sbin/apxs --with-config-file-path=/etc/httpd/conf --enable-sigchild

After this make command shows the following errors:
make; *** No target specified and no makefile found. Stop.
0
raju1Author Commented:
I have submitted full path instead of $ORACLE _HOME.
0
prashant nagarCommented:
hey experts i'm also getting the same error as
[oracle@prashant ~]$ sqlplus
bash: sqlplus: command not found
and my bash profile is as
[oracle@prashant ~]$ vi .bash_profile
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi

# User specific environment and startup programs

# Oracle Settings
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR

ORACLE_HOSTNAME=prashant.localdomain; export ORACLE_HOSTNAME
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.1.0/db_1; export ORACLE_HOME
ORACLE_SID=prd; export ORACLE_SID
ORACLE_TERM=xterm; export ORACLE_TERM
PATH=/usr/sbin:$PATH; export PATH
PATH=$ORACLE_HOME/bin:$PATH; export PATH

LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
@
any comments plz
0
omarfaridCommented:
if you run

find / -name sqlplus

what do you get?
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Oracle Database

From novice to tech pro — start learning today.