expdp command gives error on Ubuntu server for Oracle Database - oracle

I've been trying to export oracle datadump with "expdp" utility in Oracle 18c. I've set the environment variables under ~/.bashrc as following
export ORACLE_HOME=/home/ubuntu/oracle-database-xe-18c-1.0/opt/oracle/product/18c/dbhomeXE
export ORACLE_SID=ORCL
export ORACLE_BASE=/home/ubuntu/oracle-database-xe-18c-1.0/opt/oracle/product
export PATH=$PATH:$ORACLE_HOME/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export TNS_ADMIN=$ORACLE_HOME/network/admin
When I enter the command "expdp" in terminal - it keep saying your ORACLE_HOME is not set
root#ip-172-30-xx-xxx:~# expdp
UDE-00013: Message 13 not found; No message file for product=RDBMS, facility=UDE
UDE-00019: You may need to set ORACLE_HOME to your Oracle software directory
I'm new to Oracle Database at present. What could be the possible issue ? Do I need to set environment variables at some other places too ?

Note that Oracle XE is not really supported on Ubuntu: if you really want to use Oracle, install it on Oracle Linux (freely available): you will never see Oracle Database running in real production on Debian or Ubuntu and you will need to use Oracle Linux or RedHat Linux or Suse Linux.
Do not run Oracle utilities as root: you don't need to and it is generally a bad practice on Linux to use root account when it is not needed. Use a non privileged account to run Oracle utilities like SQL*Plus or Data Pump and make sure that your Oracle settings are run for each shell session: putting them in .bash_profile for the right account should be enough.
For this specific error message just make sure that ORACLE_HOME is correctly set: it is likely that your .bashrc has not been run.

Related

SP2-0667: Message file sp1<lang>.msb oracle home set correctly 11g

I'm working on a customer server that has the environment setup as listed below. I have verified that the ORACLE_HOME is set correctly and added the environment settings found in /home/oracle/.bashrc to my .bashrc. When I try to access sqlplus I still get SP2-0667: Message file sp1.msb?
# User specific aliases and functions
export ORACLE_BASE=/home/oracle
export ORACLE_HOME=$ORACLE_BASE/app/oracle/product/11g
export ORACLE_SID=xxxORA10
export TNS_ADMIN=$ORACLE_HOME/network/admin
export PATH=$PATH:.:$ORACLE_HOME/OPatch:$ORACLE_HOME/bin:/usr/local/java/bin:~/jre/1.1.8/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORACLE_BASE/oui/bin/linux:/lib:/usr/lib:/usr/X11R6/lib
export ORACLE_UNQNAME=xxxORA10
export ORACLE_HOSTNAME=xxx-df-vm
export LANG=en_US.UTF-8
I added the following with the same results
export ORA_NLS11=$ORACLE_HOME/nls/data
sudo ls ${ORACLE_HOME} >oraclehome.txt returns the following
apex
assistants
bin
ccr
cdata
cfgtoollogs
clone
config
crs
csmig
css
ctx
cv
dbs
dc_ocm
deinstall
demo
diagnostics
emcli
EMStage
has
hs
ide
install
instantclient
inventory
j2ee
javavm
jdbc
jdev
jdk
jlib
ldap
lib
log
md
mesg
network
nls
oc4j
odbc
olap
OPatch
opmn
oracore
oraInst.loc
ord
oui
owb
owm
perl
plsql
precomp
racg
rdbms
relnotes
root.sh
scheduler
slax
sqldeveloper
sqlj
sqlplus
srvm
suptools
sysman
timingframework
ucp
uix
usm
utl
wwg
xdk
first, check the location of your sqlplus binary:
$ which sqlplus
Maybe you are grabbing it from some other installation directory?
I would change this line in your .bashrc:
export PATH=$PATH:.:$ORACLE_HOME/OPatch:$ORACLE_HOME/bin:/usr/local/java/bin:~/jre/1.1.8/bin
to this:
export PATH=.:$ORACLE_HOME/OPatch:$ORACLE_HOME/bin:/usr/local/java/bin:~/jre/1.1.8/bin:$PATH

sqlplus Not showing up after oracle installation

I am new to databases. I installed oracle on my centos 7 machine. After successfull installation I am getting "sqlite3" but not "sqlplus". Can someone let me know why "sqlplus" utility isn't came of its own and how I can get it.
CentOS Linux release 7.6.1810 (Core)
Package : linuxx64_12201_database.zip
Your sqlplus program is under $ORACLE_HOME/bin/sqlplus . When you installed Oracle, you must have to select an ORACLE_HOME. If you use the one by default, probably it would be some like ( see below ).
Ensure that the environment variables ORACLE_HOME and ORACLE_SID are set properly. The commands to use to set these environment variables depend on the shell you use to interface with the operating system. For example ( bash ):
export ORACLE_SID=xxxxxx # where xxxxx is the name of the database sid
export ORACLE_HOME=/u01/app/oracle/product/12.2/dbhome_1 # example by default
export PATH=$ORACLE_HOME/bin:$PATH
# Once you execute these commands, you can run sqlplus
sqlplus user/pwd

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

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

connecting to remote oracle via cygwin sqlplus

I'm trying to use cygwin sqlplus to connect to a remote oracle installation located at myserver.mycompany.com port 1530. When I try
sqlplus username#myserver.mycompany.com:1530/orcl
I get the error:
ORA-12154: TNS:could not resolve the connect identifier specified
When I set ORACLE_HOME to /cygdrive/c/oracle/product/10.2.0/client_1, I get a different error:
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 can telnet to the server's port 1530, and the SQL Developer installed locally is also able to connect to the database. What am I doing wrong?
I wasn't aware there was a native cygwin client for Oracle (correct me if I'm wrong here but I can't find any mention of it on Oracle's web site either). If you're using Cygwin with the Windows client you need to use a native windows path. It won't understand your /cygdrive path.
However, I have used Win32 Oracle clients with cygwin and made it work - the same shell scripts would work on Cygwin, Linux and Solaris.
There isn't a cygwin Oracle client. As above answer, use the ORACLE_HOME set to the windows path.
For the first half of your question, try seeing what the TNS_NAMES env variable is set to, and if not set, you may need to try setting it to the correct place. Usually it defaults to %ORACLE_HOME%/network/admin/tnsnames.ora . SQL Developer keeps it's own copy of the tnsnames file, so you can't reply upon that to fix the problem.
Combining the details from the other answers (which took me a little, so I post it as separate answer instead of comments):
The $ORACLE_SID and, if set, $TNS_ADMIN (and probably other path-related Oracle variables) must use Windows-paths. Your Cygwin $PATH variable should of course use the Cygwin notation (/drives/c/…). So I've included into my .bashrc:
export ORACLE_HOME=c:\\Oracle\\product\\12.1.0\\dbhome_1
export TNS_ADMIN=d:\\Oracle\TNSAdmin
export PATH=$PATH:$(cygpath -u $ORACLE_HOME)/BIN
After that, I had no more issues calling e.g. tnsping or sqlplus. As the above is just an example, you must of course adjust the paths to reflect your installation/configuration :)
NXC is right - it wasn't a cygwin client I was using, but the windows sqlplus client.
I set the windows environment variables for ORACLE_HOME and ORACLE_SID and was then able to run sqlplus in a cygwin bash shell using the net_service_name from tnsnames.ora.
The way it worked for me was to remove /cygdrive/d or /cygdrive/c and replace them with with d:/ or c:/ and then your sqlplus call within cygwin session will work. The /cygdrive/DriveLetter is confusing it.
I have same error like you,
you should set not only ORACLE_HOME in windows Variables,
But also PATH include %ORACLE_HOME%\bin
then you can open windows cmd,
try sqlplus username/password#your_define_tnsname
if okay, then remove all ORACLE PATH setting in cygwin, restart cygwin,try it.
if failure, should let sqlplus works well in windows cmd at first
I have TNS_ADMIN variable configured and it works properly in Win Environ
I used cygpath mnodification in .bashrc
If TNS_ADMIN is configured add following row to .bashrc
export TNS_ADMIN=$(cygpath -m $TNS_ADMIN)

Resources