46

I have the same problem as listed here: How to recover or change Oracle sysdba password although I did not lose the password, I entered it twice in the configure script originally, and then when I went to login (localhost:8080/apex, password not accepted.

I don't have anything in the database, I just want to install and use Oracle-XE. I have tried apt-get removing it twice and reinstalling, but if I try to run /etc/init.d/oracle-xe configure again and I get "Oracle Database 10g Express Edition is already configured" despite the second time removing any folders I could find for Oracle XE.

I tried running sqlplus "/ as sysdba" but all I get is:

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

I tried setting the variable via export. (also tried set).

Tried: export ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/sqlplus and all the subdirectories of that. Same error every time.

What is the ORACLE_HOME supposed to be set to? The only reference I have seen either just say general or say the above up to the version number then "/db_1". I do no thave a db_1.

Let me know if you need any clarification. I don't understand what I did wrong in this process.

Community
  • 1
  • 1
coderintherye
  • 901
  • 1
  • 11
  • 20
  • Just to clarify the $ORACLE_HOME is getting set fine, I can echo it, just apparently I do not have it set to the correct path? – coderintherye Apr 30 '10 at 20:28
  • 1
    By the way, I had the worst problems getting rid of Oracle. One needs to run the following command to wipe out any configuration on Ubuntu: apt-get purge oracle-xe or dpkg -P oracle-xe – coderintherye May 05 '10 at 19:51

9 Answers9

80

Usually the msb file not found problems are the result of an environment setting problem, but in your case I'm a little suspicious of the installation (I've never used the apt-get + configure method).

To check the sanity of the installation:

  • ORACLE_HOME should be set to a directory path one level above the bin directory where sqlplus executable is found.
  • There should some .msb files under $ORACLE_HOME/sqlplus/mesg
  • There should be hundreds (not sure of the number with XE) of .msb files under $ORACLE_HOME (try find $ORACLE_HOME -name "*.msb" -print to show them)
  • Your PATH should include $ORACLE_HOME/bin.
  • All files under ORACLE_HOME should be owned by user:oracle group:dba.
GreenGiant
  • 4,930
  • 1
  • 46
  • 76
dpbradley
  • 11,645
  • 31
  • 34
  • Thanks, this is exactly the kind of answer I was looking for. I will mark it as accepted if it works when I try it out on Monday. – coderintherye May 02 '10 at 02:12
  • 2
    ORACLE_HOME wasn't set correctly for me on Ubuntu 10.04.4 LTS after converting the redhat package to a debian package with Alien. I'm getting this ORACLE_HOME not set when trying to run SQLPLUS now. – fIwJlxSzApHEZIl Aug 30 '12 at 02:54
  • 1
    same here, i'm on ubuntu and had to convert RPM to DEB with alien. the $ORACLE_HOME/bin/mesg does not exist at all! My $ORACLE_HOME is set to root folder of instant client installation – brunobliss Oct 25 '16 at 10:40
  • I had to add "export LD_LIBRARY_PATH=/usr/lib/oracle/12.1/client64/lib" else sqlplus didn't work. – WoodyDRN Nov 14 '16 at 12:39
23

I had the same issue. In my home folder I've got a script named sqlplus.sh that takes care of this for me, containing:

ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server
export ORACLE_HOME
ORACLE_SID=XE
export ORACLE_SID
NLS_LANG=`$ORACLE_HOME/bin/nls_lang.sh`
export NLS_LANG
PATH=$ORACLE_HOME/bin:$PATH
export PATH
sqlplus /nolog
Jeffrey Kemp
  • 59,135
  • 14
  • 106
  • 158
  • Thanks for your answer, however setting NLS_LANG=`$ORACLE_HOME/bin/nls_lang.sh` caused a problem as that file doesn't exist. The other answered seemed to work. – coderintherye May 03 '10 at 17:47
  • Thanks for your answer. Helped me set up my Oracle Home! +1 – Rhyuk Jan 17 '13 at 20:16
14

Had the same problem,

All i had to do whas set the oracle shell variable:

. /u01/app/oracle/product/11.2.0/xe/bin/oracle_env.sh

Sorterd!

Taryn
  • 242,637
  • 56
  • 362
  • 405
SveguS
  • 141
  • 1
  • 2
  • Wonderful! That ORACLE_HOME path `/u01/app/oracle/product/11.2.0` is exactly what's mapped in the offcial `oracle-xe-11.2.0-1.0.x86_64.rpm` file. – Devy Jun 20 '14 at 21:20
5

You have to set LANG as well, look for files named 'sp1*.msb', and set for instance export LANG=us if you find a file name sp1us.msb. The error message could sure be better :)

Kjell
  • 51
  • 1
  • 1
1

Once I also got that same type of error.

I.E:

C:\oracle\product\10.2.0\db_2>SQLPLUS SYS AS SYSDBA
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

This error is occurring as the home path is not correctly set. To rectify this, if you are using Windows, run the below query:

C:\oracle\product\10.2.0\db_2>SET ORACLE_HOME=C:\oracle\product\10.2.0\db_2
C:\oracle\product\10.2.0\db_2>SQLPLUS SYS AS SYSDBA

SQL*Plus: Release 10.2.0.3.0 - Production on Tue Apr 16 13:17:42 2013

Copyright (c) 1982, 2006, Oracle.  All Rights Reserved.

Or if you are using Linux, then replace set with export for the above command like so:

C:\oracle\product\10.2.0\db_2>EXPORT ORACLE_HOME='C:\oracle\product\10.2.0\db_2'
C:\oracle\product\10.2.0\db_2>SQLPLUS SYS AS SYSDBA

SQL*Plus: Release 10.2.0.3.0 - Production on Tue Apr 16 13:17:42 2013

Copyright (c) 1982, 2006, Oracle.  All Rights Reserved.
Ren
  • 1,111
  • 5
  • 15
  • 24
Abhi
  • 11
  • 1
1

This is the right way to clear this error.

export ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1 sqlplus / as sysdba

1

ORACLE_HOME needs to be at the top level of the Oracle directory structure for the database installation. From that point, Oracle knows how to find all the other files it needs. For example, the error message you get is because Oracle can't locate the message files to report errors with (should be in the various mesg directories below the oracle home. Instead of the above value you give, I would try

export ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0
DCookie
  • 42,630
  • 11
  • 83
  • 92
  • Thanks, however I had already tried that as mentioned above, I tried all of the subdirectories. k@k:/$ export ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0 k@k:/$ echo $ORACLE_HOME /usr/lib/oracle/xe/app/oracle/product/10.2.0 k@k:/$ /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/sqlplus "/ as sysdba" Error 6 initializing SQL*Plus Message file sp1.msb not found SP2-0750: You may need to set ORACLE_HOME to your Oracle software directory – coderintherye Apr 30 '10 at 22:36
  • +1 Thank you, well for me I had to do `export ORACLE_HOME=/oracle/product/11.1.0/db_1/` and it worked :D – Kevdog777 Feb 15 '13 at 10:18
  • How to `export ORACLE_HOME=/oracle/product/11.1.0/db_1/` on Windows? – bjan Aug 07 '13 at 06:22
1

After installing weblogic and forms server on a Linux machine we met some problems initializing sqlplus and tnsping. We altered the bash_profile in a way that the forms_home acts as the oracle home. It works fine, both commands (sqlplus and tnsping) are executable for user oracle

# .bash_profile

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

# User specific environment and startup programs

PATH=$PATH:$HOME/bin

export JAVA_HOME=/mnt/software/java/jdk1.7.0_71
export ORACLE_HOME=/oracle/Middleware/Oracle_FRHome1
export PATH=$PATH:$JAVA_HOME/bin:$ORACLE_HOME/bin
export LD_LIBRARY_PATH=/oracle/Middleware/Oracle_FRHome1/lib
export FORMS_PATH=$FORMS_PATH:/oracle/Middleware/Oracle_FRHome1/forms:/oracle/Middleware/asinst_1/FormsComponent/forms:/appl/myapp:/home/oracle/myapp
ridi
  • 162
  • 9
-2
set <ORACLE_HOME> path variable

example

path ORACLE_HOME

value is C:\oraclexe\app\oracle\product\10.2.0\server

enter image description here

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
kkpadhy
  • 15