Error 6 Initializing SQL*Plus - oracle

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

Related

How to have oracle imp 11gr2 and 12cr2 on the same machine and just choose the one that I want to use

I'm currently developing an application to import oracle dbs. In order to do that I'm using Data Pump and the original imp client (version 12.2.0.1). However I cannot use that imp client against an 11gr2 database, I need to use the 11gr2 imp client.
I already have the client and libraries that I got from one of my 11gr2 DBs however, if I try to execute it I'm getting the following error:
Message 100 not found; No message file for product=RDBMS,
facility=IMP: Release 11.2.0.3.0 - Production on Fri Jan 5 18:28:21
2018
Copyright (c) 1982, 2011, Oracl
Invalid format of Import utility name
Verify that ORACLE_HOME is properly set
Import terminated unsuccessfully
IMP-00000: Message 0 not found; No message file for product=RDBMS,
facility=IMP
Can someone point how to have both clients working on the same machine? Thanks in advance.
[UPDATE]
I'm using Red Hat OS and this is the output of $ORACLE_HOME:
/root/oracle/instantclient_12_2
I tried using the full path and placing the files in ORACLE_HOME but I still get the same error. Thanks!!!
On a Windows machine, I usually changed directory (using the CD command) to the one that contains IMP I wanted to use, for example:
C:\>
C:\>cd C:\oraclexe\app\oracle\product\11.2.0\server\bin
C:\oraclexe\app\oracle\product\11.2.0\server\bin>imp help=y
Import: Release 11.2.0.2.0 - Production on Sub Sij 6 06:45:43 2018
Or, alternatively, if you call those utilities by specifying full path to their executables, such as
C:\>
C:\>C:\oraclexe\app\oracle\product\11.2.0\server\bin\imp help=y
Import: Release 11.2.0.2.0 - Production on Sub Sij 6 06:47:30 2018
I hope you'd be able to do what you're up to.
Most probably your problem is related to setting LD_LIBRARY_PATH and PATH to the Instant Client directory. You may perform all settings in your bash shell script like .bash_profile, .profile, .bashrc :
First of all set
ORACLE_HOME=/root/oracle/instantclient_12_2; export ORACLE_HOME
Add the name of the directory containing the Instant Client libraries to LD_LIBRARY_PATH. Remove any other Oracle directories.
For example, to set LD_LIBRARY_PATH in the Bourne or Korn shells, use the following syntax:
LD_LIBRARY_PATH=${ORACLE_HOME}/lib:${LD_LIBRARY_PATH}
export LD_LIBRARY_PATH
Or, to set LD_LIBRARY_PATH in the C shell, use the following syntax:
% setenv LD_LIBRARY_PATH
$ORACLE_HOME/lib:$LD_LIBRARY_PATH
Make sure the Tools executables installed from the RPM are the first executables found in your PATH. For example, to test this you could enter which impdp which should return $ORACLE_HOME/bin/impdp. If it does not, then remove any other Oracle directories from PATH, or put $ORACLE_HOME/bin before other Tools executables in PATH, or use an absolute or relative path to start Tools Instant Client.
For example, to set PATH in the bash shell:
PATH=/usr/bin:${PATH}:${ORACLE_HOME}:${ORACLE_HOME}/bin
export PATH
Set Oracle globalization variables required for your locale. A default locale will be assumed if no variables are set.
NLS_LANG=AMERICAN_AMERICA.UTF8
export NLS_LANG
After researching, I did not copy all the required files when trying to copy the imp client version 11cr2. I solved this issue by copying all the files in $ORACLE_HOME and making that location my new $ORACLE_HOME. After that, just copied the lib files and the imp from the 12cr2 client installation to $ORACLE_HOME and renamend imp 12cr2 to "imp12cr2".
Now if I want to use the 11.2 I use imp and if want to use the 12cr2 one I use imp12cr2

Unable to login to Oracle Database from OSX

I've downloaded and installed Oracle Instant Client on my Mac Sierra.
I have also created the tnsnames.ora files and exported its path.
However, when I try to login to the remote Oracle server, I get the following error:
Mridulas-MacBook-Pro:~ mridulaprabhu$ sqlplus demo$security/password#ERPONWEB
SQL*Plus: Release 11.2.0.4.0 Production on Fri Aug 18 16:37:03 2017
Copyright (c) 1982, 2013, Oracle. All rights reserved.
ERROR:
ORA-01017: invalid username/password; logon denied
When my colleague connects to the same server using the same credentials on windows, he can login.
Someone told me it could be because of the characterset on my MAC. So I have set NLS_LANG to AMERICAN_AMERICA.US7ASCII but it still doesn't work.
How can I fix this?
OS X is a Unix variant, and you're running this from a shell. So the $ in your username is being interpreted as an environment variable.
If you do:
echo demo$security/password#ERPONWEB
you'll see that it only shows demo/password#ERPONWEB - unless you happen to have an envorinment variable called security, in which case that will be substituted.
You can escape the dollar symbol to stop that interpretation:
sqlplus demo\$security/password#ERPONWEB
or enclose the entire argument in single (not double) quotes:
sqlplus 'demo$security/password#ERPONWEB'

ora-09925 unable to create audit trail file no such file or directory

I have just installed a oracle 12c 12.1.0 DB on a linux machine.
after completing the installation i tried to login to database as sysdba
[oracle#bjorn adump]$ sqlplus sys as sysdba/welcome
SQL*Plus: Release 12.1.0.2.0 Production on Wed Oct 12 16:41:17 2016
Copyright (c) 1982, 2014, Oracle. All rights reserved.
Enter password:
Connected to an idle instance.
Now i tried to startup the DB using below command
SQL> startup mount
ORA-09925: Unable to create audit trail file
Linux-x86_64 Error: 2: No such file or directory
Additional information: 9925
and this error pop up !
my ENV variable are --
[oracle#bjorn adump]$ echo $ORACLE_BASE
/oracle
[oracle#bjorn adump]$ echo $ORACLE_HOME
/oracle/product/12.1.0/db_1
I have checked into pfile which is $ORACLE_HOME/dbs/init.ora
there is the entry for audit file
audit_file_dest="/oracle/admin/orcl/adump"
I also go to this location and check if the folder exists or nt but the folder was there and it aleady has some files in it like
orcl_m000_21634_20161012143245012051143795.aud
there are lots of file with names like this.
I gave permission to this folder
chmod -R 755 /oracle/admin/orcl/adump
tried creating a new file using
touch afile
and file get created.
It also got connect to the idle session but when i tried to do a startup the error pops up !
Please suggest what i am overlooking here which needs to be corrected.
Usually this could happen because:
AUDIT_FILE_DEST is not writable(chown +w $AUDIT_FILE_DEST)
$ORACLE_BASE/admin/$ORACLE_SID/adump exists and is not writable
$ORACLE_HOME/rdbms/audit is not writable
PS: Make sure to check permissions for the oracle user
Also please check for disk space availability
In our case, one of the drives in one of our 2-node RAC servers was failing - the reason why the OS (Linux) limited anyone's access, including root, to read-only.
The amber light was suppose to turn on but it didn't. It only turned on when we restarted that particular node.
You also have 3 things to verify:
- As already mentionned, check free space with df -have
- Check if the file system are Read/Write or read-only: cat /proc/mounts
- Finally, you can check free inodes space with df -i
Detailled information can be found here: https://www.oracle-scripts.net/unable-to-create-audit-trail-file-read-only-file-system/

Message file UTILITY_MEG\spw<lang>.msb not found

I want to open SQL*Plus from CMD
When I try to open it using this command in Sqlplus I encounter this dialog error message:
Message file UTILITY_MEG\spw<lang>.msb not found.
after I close dialog message here is a copy of CMD:
Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Users\Abo-Khaled>sqlplus
Error 14 initializing SQL*Plus
Message file sp1<lang>.msb not found
SP2-0750: You may need to set ORACLE_HOME to your Oracle software directory
C:\Users\Abo-Khaled>
I used these commands to solve the problem:
set oracle_home=C:\app\Abo-Khaled\product\11.2.0\dbhome_1\
set oracle_sid=orcl
BUT that doesn't solve the problem.
Notes:
When I use SQL*Plus directly I can login without any problem. but I need to login using CMD.
I am using oracle 11g in windows 7
About one month ago I hadn't this problem with SQL*Plus.
I just had this issue and was able to resolve it by adjusting my windows path environment variable.
Make sure the path to the bin directory containing the correct sqlplus.exe comes first in the Windows path environment variable.
When you use sqlplus.exe in a command prompt, you may be executing a different sqlplus.exe than intended.
In my case, I also have the Oracle middleware installed which has its own sqlplus.exe which was being referenced and throwing the "Message file" error.
Once I put the path to the database home's bin directory first in the path variable, the issue went away.
You need to set the NLS_LANG parameter in your command prompt. e.g. set nls_lang=ENGLISH
For the newer database 12c and up, I did not need an oracle_home variable. If you have one, then try deleting to see if the "Message file sp1.msb not found" goes away. This has been my experience of installing an Oracle DB on a desktop/laptop.

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.
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

Resources