• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 60136
  • Last Modified:

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
0
raju1
Asked:
raju1
1 Solution
 
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 new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
sujith80Commented:
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
 
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

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Tackle projects and never again get stuck behind a technical roadblock.
Join Now