11g XE Version 11.2.0
instance name is xe
Path to SQLPLUS.exe
G:\JaveWebApps\Oracle11gDb\app\oracle\product\11.2.0\server\bin
When I try to run sqlplus in cmd in C:\Users\User> I keep getting this error:
SP2-0750: You may need to set ORACLE_HOME to your Oracle software directory.
Here are my ENVIRONMENT VARS
ORACLE HOME
G:\JaveWebApps\Oracle11gDb\app\oracle\product\11.2.0\server
Path
%ORACLE_HOME%\bin;C:\Python34\Lib\site-packages\PyQt4;C:\Python34\;C:\Python34\Scripts;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;G:\XAMPP\php;C:\ProgramData\ComposerSetup\bin;%USERPROFILE%.dnx\bin;C:\Program Files\Microsoft DNX\Dnvm\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files\Java\jdk1.7.0_45\bin
These are the commands I ran in this order
echo %ORACLE_HOME%
G:\JaveWebApps\Oracle11gDb\app\oracle\product\11.2.0\server
set ORACLE_SID = xe
set ORACLE_HOME = G:\JaveWebApps\Oracle11gDb\app\oracle\product\11.2.0\server
sqlplus
ERROR 6 initializing SQLPLUS
You may beed to set ORACLE_HOME to your Oracle software directory.
There are multiple cases online with the same error, but none of them are working for me.
Related
I am using Windows 10 pro x64, Oracle database 21c Express edition, Oracle SQL Developer 22.2.1 . How to set ORACLE_HOME correct?
I know this my setting was wrong (because sqlplus.exe cannot run/open with this system variable, I tried)
Is ORACLE_HOME
C:\app\Administrator\product\21c
C:\app\Administrator\product\21c\dbhomeXE
C:\app\Administrator\product\21c\homes
C:\app\Administrator\product\21c\homes\OraDB21Home1
?
Please guide me set ORACLE_HOME correctly!
On Windows you don't need to explicitly set an Oracle Home because we can work it out from the registry and the PATH.
But if you want to set an ORACLE_HOME its the parent folder of the 'bin' directory. Thus if sqlplus was found in C:\app\Administrator\product\21c\homes\OraDB21Home1\bin then your ORACLE_HOME would be C:\app\Administrator\product\21c\homes\OraDB21Home1
If you're running multiple versions/installations of Oracle (as I do), I'll often create a little batch file for each version,eg
sql19.cmd
=========
set ORACLE_SID=db19
set ORACLE_HOME=C:\oracle\product\19
set PATH=C:\oracle\product\19\bin;%PATH%
sqlplus scott/tiger#db19_pdb1
sql21.cmd
=========
set ORACLE_SID=db21
set ORACLE_HOME=C:\oracle\product\21
set PATH=C:\oracle\product\21\bin;%PATH%
sqlplus scott/tiger#db21_pdb1
and so on
I'm installing Oracle 11g R2 and when I log in in SQL PLUS, It have error ORA-12560: TNS:protocol adapter error, and I think because I don't have Oracle folder in HKEY_LOCAL_MACHINE\SOFTWARE, how to create Oracle folder
If you are trying to connect to a database locally on the computer, ensure that you have set ORACLE_SID environment variable:
SET ORACLE_SID=ORCL
SQLPLUS user/password
Database Version : 10g Enterprise Edition Release 10.2.0.4.0
Client Version: 11g Enterprise Edition Release 11.2.0.1.0 (windows 7 64bit)
When I try to export (exp) a table from database:
exp usr/pass#remote_db file=f.dmp tables=table
I get the following error:
EXP-00008: ORACLE error 904 encountered
ORA-00904: "POLTYP": invalid
identifier EXP-00000: Export terminated unsuccessfully
I know this question was answered earlier (the answer is "install 10g client to use its exp utility"), but I still didn't understand correctly:
Is Oracle 10g client 10.2.0.4 is ok for this? Do I need to setup TNS etc?
If I use the previous command to export the DB will the system automatically use the Ora10g client exp tool?
1) Yes, the 10.2.0.4 client would be OK. Yes, assuming that you use a tnsnames.ora file to connect to the database, you would need to configure a tnsnames.ora file in the Oracle Home for the newly installed 10.2.0.4 client or set the TNS_ADMIN environment variable to point at a single tnsnames.ora file for all Oracle Homes on the server. If you don't use a tnsnames.ora file to connect to the database, you would not need to configure one.
2) The command you posted will use the operating system's name resolution logic to determine which executable to invoke. Generally, that will be the executable in whichever Oracle Home is first in the operating system's PATH environment variable. Of course, you could specify an explicit path or change the current directory to the %Oracle Home%\bin of the 10.2.0.4 Oracle Home if that home was not first in the path.
When i open sqlplus it shows
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
Generally speaking, you don't want to set ORACLE_HOME in a Windows environment - it's handled in the registry, and it's given me grief the times I've set it. Here is an Oracle Doc on Oracle Homes.
How many Oracle installations are on this computer?
Ancient question with hopefully a helpful new answer! Ready?
First, as others have said, you must set your ORACLE_HOME (e.g. export ORACLE_HOME=/opt/oracle/instantclient_12_2), but secondly, and oddly, you can't be cd'd into the oracle home when you run sqlplus!
$ export ORACLE_HOME=/opt/oracle/instantclient_12_2
$ cd $ORACLE_HOME
$ sqlplus
Error 6 initializing SQL*Plus
SP2-0667: Message file sp1<lang>.msb not found
SP2-0750: You may need to set ORACLE_HOME to your Oracle software directory
$ cd /
$ sqlplus
SQL*Plus: Release 12.2.0.1.0 Production on Wed Jan 3 11:02:36 2018
Copyright (c) 1982, 2016, Oracle. All rights reserved.
Enter user-name:
Whoaaa mind blown. It's... a feature?
If ORACLE_HOME & ORACLE_BASE are all properly set,
Make sure that someone does not delete some installation folders/files. I experienced similar problem, in one of my customers, Half of the folders in OraHome had been accidently deleted by the IT Guy.
In my case, ORACLE_HOME in my windows registry was changed when I installed another Oracle tool (Workflow builder in my case), hence I got the following error. After I modified it back to where the Oracle SQLPLUS product was installed, it worked fine. We don't need to set ORACLE_HOME in the environment variables, the system would read it form the registry.
Before:
Error 6 initializing SQL*Plus
SP2-0667: Message file sp1.msb not found
SP2-0750: You may need to set ORACLE_HOME to your Oracle software directory
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.
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.
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
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!
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 :)
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
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.
This is the right way to clear this error.
export ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1
sqlplus / as sysdba
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
set <ORACLE_HOME> path variable
example
path ORACLE_HOME
value is C:\oraclexe\app\oracle\product\10.2.0\server