Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to correctly set the ORACLE_HOME variable on Ubuntu 9.x?

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.

like image 406
coderintherye Avatar asked Apr 30 '10 20:04

coderintherye


People also ask

What should I set ORACLE_HOME to?

Set up the ORACLE_HOME environment variable to point to the directory where the Oracle database client software is installed. Set the variable on the admin application server and each non-admin application server.

What is the ORACLE_HOME path?

The Oracle home location is the directory where products are installed. Data files may or may not be installed within an Oracle home. You can use the Browse button to choose a directory to install your product.

How do I permanently set Oracle environment variables in Linux?

To make the change permanent, enter the command PATH=$PATH:/opt/bin into your home directory's . bashrc file. When you do this, you're creating a new PATH variable by appending a directory to the current PATH variable, $PATH .


2 Answers

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.
like image 170
dpbradley Avatar answered Sep 23 '22 14:09

dpbradley


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 
like image 33
Jeffrey Kemp Avatar answered Sep 24 '22 14:09

Jeffrey Kemp