Oracle Database 11g Express: Data Pump Export - oracle

I want to invoke the expdp (Data Pump Export) command, but I got an error:
C:\oraclexe\app\oracle\admin\XE\dpdump>expdp test/test#DEVICES CONTENT=METADATA_ONLY FILE=FLEET.DMP
Export: Release 11.2.0.2.0 - Production on Vie Sep 22 12:46:30 2017
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
UDE-12154: operation generated ORACLE error 12154
ORA-12154: TNS:could not resolve the connect identifier specified
and here the file tsnames.ora :
DEVICES =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 212.137.78.211)(PORT = 1521))
(CONNECT_DATA =
(SID = DEVICES)
)
)
and
C:\oraclexe\app\oracle\admin\XE\dpdump>tnsping DEVICES
TNS Ping Utility for 64-bit Windows: Version 11.2.0.2.0 - Production on 22-SEP-2017 16:00:17
Copyright (c) 1997, 2014, Oracle. All rights reserved.
Used parameter files:
C:\oraclexe\app\oracle\product\11.2.0\server\network\admin\sqlnet.ora
TNS-03505: Failed to resolve name

http://docs.oracle.com/cd/E11882_01/network.112/e41945/admintools.htm#NETAG272 please see this post, thear write corectly, but I thinking you write wrong database name

First try what #kfinity suggested, it is good advice. If that doesn't add clarity, try:
sqlplus test/test#device
That will probably not connect in your case. I am on Windows, you will need to do similar if you are on UNIX:
set ORACLE_SID=DEVICE
sqlplus test/test
If this connects, retry your IMPD command. If it doesn't, check out the SQLNET configuration file at %oracle_home%\network\admin\sqlnet.ora.
If it has an entry similar to
NAMES.DEFAULT_DOMAIN = WORLD
you need to add .WORLD to your command, as in
expdp test/test#DEVICES.WORLD CONTENT=METADATA_ONLY FILE=FLEET.DMP

Related

ORA-12154: Can't Connect to Default Oracle XE 21c Database on Windows 10

I've had it. I just can't get this to work. I installed Oracle XE 21c on my Windows 10 desktop. The installation went ok, once I ran the Setup file as an administrator. I basically chose all the defaults.
So now it is running, and there was a default database XE create for me. But I get this when attempting to connect as SYSTEM using SQLPlus:
SQL*Plus: Release 21.0.0.0.0 - Production on Mon Nov 1 19:08:25 2021
Version 21.3.0.0.0
Copyright (c) 1982, 2021, Oracle. All rights reserved.
Enter user-name: SYSTEM
Enter password:
ERROR:
ORA-12154: TNS:could not resolve the connect identifier specified
I looked and there is no tnsnames.ora or listern.ora file, so I attempted to create them, though I am not sure they are correct.
C:\app\sysde\product\21c\dbhomeXE\network\admin\listener.ora
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
)
)
C:\app\sysde\product\21c\dbhomeXE\network\admin\tnsnames.ora
LISTENER = (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
XE = (DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = XE)
)
)
I then stopped the listener as follows lsnrctl stop
which yielded this:
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
64-bit Windows Error: 2: No such file or directory
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521)))
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
64-bit Windows Error: 61: Unknown error
The listener OracleOraDB21Home1TNSListener is no longer running in services.msc. When trying to restart it I get this...
Error 2: The system cannot find the file specified.
My environment variables are:
ORACLE_HOME=C:\app\sysde\product\21c\dbhomeXE\
TNS_ADMIN=C:\app\sysde\product\21c\dbhomeXE\network\admin
I know there are numerous "Can't connect to Oracle" posts. I've tried bits and pieces of them, but none are really suited to my situation and the parts I've tried simply haven't helped. Any suggestions you have to allow me to use the default XE database and connect to it through a GUI such as SQL Developer would be tremendously helpful.
As per the docs, from 21c onwards the default software installation is the read only home layout, which has been available since 18c
https://docs.oracle.com/en/database/oracle/oracle-database/21/nfcon/read-only-oracle-home-default-366970591.html
So by default the sqlnet configuration files are not going to be under ORACLE_HOME/network/admin.
C:\oracle\product\21c\dbhomeXE\network\admin>dir
Volume in drive C is System
Volume Serial Number is EEB1-910D
Directory of C:\oracle\product\21c\dbhomeXE\network\admin
13/10/2021 10:53 AM <DIR> .
13/10/2021 10:53 AM <DIR> ..
13/10/2021 10:51 AM <DIR> sample
13/10/2021 10:52 AM 263 sqlnet.ora.rooh
1 File(s) 263 bytes
3 Dir(s) 78,346,031,104 bytes free
C:\oracle\product\21c\dbhomeXE\network\admin>cd ..\..\..\homes\OraDB21Home1\network\admin
C:\oracle\product\21c\homes\OraDB21Home1\network\admin>dir
Volume in drive C is System
Volume Serial Number is EEB1-910D
Directory of C:\oracle\product\21c\homes\OraDB21Home1\network\admin
13/10/2021 10:54 AM <DIR> .
13/10/2021 10:54 AM <DIR> ..
13/10/2021 10:53 AM 656 listener.ora
13/10/2021 10:53 AM 465 sqlnet.ora
13/10/2021 10:53 AM 263 sqlnet21101310AM5351.bak
13/10/2021 02:51 PM 852 tnsnames.ora
4 File(s) 2,236 bytes
2 Dir(s) 78,345,871,360 bytes free
You don't need to set ORACLE_HOME or TNS_ADMIN. You just need to edit the files in the 'homes' area and you'll be good to go.
A complete top to bottom install video is available here from the Windows team
https://youtu.be/DYleroLay5E
OracleXE21 default path for tnsnames.ora and sqlnet.ora has been changed in Express Edition 21c. The new path will be like this: C:\oracle\product\21c\homes\OraDB21Home1\network\admin
and there where you will find tnsnames.ora and sqlnet.ora.

Oracle database service could not be connected on ubuntu , ORA-27101: shared memory realm does not exist

I got a linux server with ubuntu 16.04 and successfully installed oracle 11gR2 on it. After system boot , I could use the following code startup oracle and do a simple query:
db#dbpc:~$ sudo lsnrctl start
db#dbpc:~$ sqlplus /nolog
SQL> conn / as sysdba
SQL> startup
SQL> select * from scott.dept;
DEPTNO DNAME LOC
---------- -------------- -------------
10 ACCOUNTING NEW YORK
20 RESEARCH DALLAS
30 SALES CHICAGO
40 OPERATIONS BOSTON
However I could not login via IP , for example if I use the following command:(after start the hole services)
db#dbpc:~$ sqlplus scott/123456#192.168.1.100:1521/orcl
It will shows:
SQL*Plus: Release 11.2.0.4.0 Production on Thu Dec 31 12:58:42 2020
Copyright (c) 1982, 2013, Oracle. All rights reserved.
ERROR:
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Linux-x86_64 Error: 2: No such file or directory
Process ID: 0
Session ID: 0 Serial number: 0
Here's my setting files:
db#dbpc:/home/rogear/tools/oracle11g/product/11.2.0/dbhome_1/network/admin$ cat listener.ora
# listener.ora Network Configuration File: /home/rogear/tools/oracle11g/product/11.2.0/dbhome_1/network/admin/listener.ora
# Generated by Oracle configuration tools.
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.100)(PORT = 1521))
)
)
ADR_BASE_LISTENER = /home/rogear/tools/oracle11g
db#dbpc:/home/rogear/tools/oracle11g/product/11.2.0/dbhome_1/network/admin$ cat tnsnames.ora
# tnsnames.ora Network Configuration File: /home/rogear/tools/oracle11g/product/11.2.0/dbhome_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.100)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)
What's wrong?
The first thing that is wrong is that Oracle is not certified nor was ever designed for Ubuntu. Ubuntu is from an entirely different branch of the linux family. Getting oracle to work at all on it is a hack, and beyond that, nothing is guaranteed.
Also note that your connection string (sqlplus scott/123456#192.168.1.100:1521/orcl) never uses your tnsnames.ora. To use your tnsnames.ora, your connection string would be:
sqlplus scott/123456#orcl
where 'orcl' is the name of the entry in tnsnames.
Third we don't know the name of the database instance. I'd want to see the output of
ls -l | grep pmon
Fourth, Oracle 11 is old and out of support, even on supported operating systems.
If you are stuck with an Ubuntu machine (the very fact of using Ubuntu tells me this is a personal pc that you are using for self-study or schoold) your best bet would be to install Oracle VirtualBox, then use that to create a VM running a recent version of Oracle Linux, and install a recent version of Orcle on that. I have an article on that, which is a bit dated now, at https://edstevensdba.wordpress.com/category/personal-test-systems/

How do I setup an ODBC connection to Oracle using FireDAC?

I can succesfully connect to Oracle through the native drivers, but cannot get an ODBC connection to work. The Oracle 11g client software is installed on my Windows 7 64 bit machine, as well as the 32-bit ODBC drivers downloaded from
Instant Client Downloads for Microsoft Windows 32-bit.
Let me first describe the succesful connections:
TNSNames.ORA contains data for an Oracle 10 installation:
# TNSNAMES.ORA Network Configuration File: C:\oracle\ora92\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.
VS2003-2005-10.TimeTellBV.nl =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = VS2003-2005-10)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = Orclvs10)
)
)
I set up my TFDConnection with
DriverName := S_FD_OraId;
Params.Database := 'VS2003-2005-10';
Alternatively, I can bypass TNSNAMES.ORA by specifying directly:
DriverName := S_FD_OraId;
Params.Database := '(DESCRIPTION=(ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = VS2012-2012.timetellbv.nl)(PORT = 1521)) ) (CONNECT_DATA = (SERVICE_NAME = orcl12.timetellbv.nl) ))';
(As you can see, this is another Oracle server not in TNSNAMES.ORA)
Now the failing attempts through ODBC
Two 32-bit Oracle ODBC drivers are installed:
Microsoft ODBC for Oracle version 6.01.7601.19135 - I think this came with the Win7 OS
Oracle in instantclient_11_2 version 11.02.00.04 - I installed this manually from the source mentioned at the top (running as admin as suggested in the Oracle Instant Client ODBC Release Notes).
I have set up two System DSNs through these drivers but neither work.
The version 6 ODBC driver, giving it the TSNAMES.ORA entry name for 'Server':
and the version 11 Oracle driver idem:
For that second one I added another entry to TNSNAMES.ORA, since that dialog obviously suggested I had to go through that file:
VS2012-2012.TimetellBV.nl =
(DESCRIPTION=
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = VS2012-2012)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = orcl12.timetellbv.nl)
)
)
I set up my TFDConnection with
DriverName := S_FD_ODBCId;
Params.Add('DataSource=' + lODBCName); // The ODBC DSN Name
Params.Database := lDataSection.Values[INISTRING_DATABASENAME];
Both this code and the test button in de 32-bit ODBC admin fail with error:
Unable to connect
SQLState IM003
The specified driver could not be loaded due to system error 127: cannot find procedure<br />
(Oracle in instantclient_11_2; D:\app\jan\product\11.2.0\client_1\SQORA32.dll)
That folder is where my Oracle client software is installed, it contains SQORA32.DLL (and others) and is in my system path.
I have tried all kinds of variations including/excluding domain name, database name, etc, without success.
How do I properly set up an ODBC connection to connect to Oracle, to be used in a Delphi-Tokyo 32 bit app through FireDAC?
What also did not help:
Reinstalling the Visual Studio 2013 32-bit redistributable
Copy sqora32.dll to the Windows SysWOW64 folder
Setting ORACLE_HOME environment variable to d:\app\jan\product\11.2.0\client_1\
Setting TNS_ADMIN environment variable to d:\app\jan\product\11.2.0\client_1\
Renaming sqora32.dll to SQORA32.dll
Replaced c:\windows\syswow64\mfc42.dll dated 11 March 2011 with a newer one from the Oracle home folder, dated 27 April 2011
I don't know what was wrong. I found a client installer executable (i.e. that's different from the "instant client", which has no installer, and whose reinstallation did not help either), cleaned up my VM from all Oracle stuff, ran the installer with 'administrator' selection (=all available software in the package) and that finally works. ODBC was installed as well.
The only things that need to be set for the TFDCOnnection are:
DriverName := S_FD_ODBCId;
Params.Add('DataSource=' + lODBCName);
with lODBCName being the ODBC System DSN name.
(I intended to leave this as a comment for 10K users and then delete the question, but that's not possible since I put a bounty on it earlier today. Well, maybe it serves anyone else).
I have already encountered similar issue.
I can use SQLPLUS or JDBC to connect to Oracle database, but when I try to define an ODBC connection or a .Net Linq connection, that don't work.
I have then modified my TNSNAMES.ora file and replaced SERVER-NAME by SID and suddently ODBC connection has been possible.

Tnsping, "Used parameter files" is empty

I am using Ruby API oci8 to connect to a remote Oracle DB, got ORA 12514.
My operating system is linux, the weird thing is when I do:
tnsping <hostname:port>
I get:
TNS Ping Utility for Linux: Version 10.2.0.2.0 Production on 22-JUL-2017 14:46:28
Copyright (c) 1997, 2005 Oracle Corporation. All rights reserved.
Used parameter files:
Used HOSTNAME adapter to resolve the alias
Attempting to contact (DESCRIPTION = (CONNECTDATA = (SERVICE_NAME= my-orasvr.db)) (ADDRESS= (PROTOCOL =TCP)(HOST = 10.15.222.44)(PORT = 1521)))
OK (0 msec)
The "Used parameter files" is empty, not sure whether it does matter.
Don't have any clue, any help is appreciate~!!

write command log to file in window

I want to write log of following command to file in window:
C:\Users\The Linh>IMP system/Thelinh05#orcl FILE= D:\source\rabbit\db_dmp\billus
er.dmp FULL=Y IGNORE=Y;
(This command use to import data in to oracle).
I try to use this command:
C:\Users\The Linh>IMP system/Thelinh05#orcl FILE= D:\source\rabbit\db_dmp\billus
er.dmp FULL=Y IGNORE=Y;>log.txt
But it not write log to file. The output in command line is:
Import: Release 11.2.0.1.0 - Production on Thu Jan 14 16:32:47 2016
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
IMP-00058: ORACLE error 1017 encountered ORA-01017: invalid
username/password; logon deniedUsername:
I've found solution for this problem. use below command:
IMP system/Thelinh05#orcl FILE= D:\source\rabbit\db_dmp\billuser.dmp
FULL=Y IGNORE=Y logfile=log.txt

Resources