export table with expdp oracle - oracle

I am trying to export a table from my oracle database with SID=DB034 with username=b034. I am using this command:
expdp b034/aDmin123456789#DBB034 tables=B034.BIL_CUSTOMER_GROUP, DEPT directory=exp_test dumpfile=dump_test.dmp logfile=log_test.log
My directory is correct and also I had granted privileges to b034 user. After running the command I get this error:
ORA-12154: TNS:could not resolve the connect identifier specified
Can anyone help me with this?

The most common cause of ORA-12154 is that database alias (DBB034) can't be found in TNSNAMES.ORA file (the one expdp is using. If you have more than a single Oracle product installed on your computer, I suggest you use TNS_ADMIN environment variable. Say if you need instructions).
That's something like old-fashioned telephones - you're trying to call someone, but can't find their name in any phone book.
So, what to do? Add DBB034 into TNSNAMES.ORA.
As you asked (in a comment) how TNSNAMES.ORA alias looks like, here you are:
DBB034=
(DESCRIPTION=
(ADDRESS=
(PROTOCOL=TCP)
(HOST=11.222.33.44) --> put host name or its IP address here
(PORT=1521) --> usually 1521, but doesn't have to be
)
(CONNECT_DATA=
(SERVICE_NAME=dbb034) --> lucky guess; maybe it is called differently
)
)
Basically, if you aren't sure what to put in there, ask your DBA, they know.

Related

How should I set up my sqlnet.ora and tnsnames.ora files?

I facing login issue with sqlplus login. when I m logging in using hostname, port and service name, its working fine.
sqlplus <userid>/<password>#<hostname>:<port>/<servicename>
No issues with above command. Its working as expected.
When I m trying to login with connect string,
sqplus <userid>/<password>#<connectstring>
I m getting
ORA-12154: TNS:could not resolve the connect identifier specified
I know my sqlnet.ora and tnsnames.ora are not correct, but not able to figure out where the issue is.
sqlnet.ora
SQLNET.AUTHENTICATION_SERVICES = (NTS)
NAMES.DEFAULT_DOMAIN = world
Just above two line are there in the file.
tnsnames.ora
MYTNSENTRY=
(DESCRIPTION =
....
hostname, port and service name defined in tnsnames.ora, just one entry is there.
I m executing sqlplus commands on windows platform.
Any pointers regarding this is much appreciated.
You have in your sqlnet.ora this line:
NAMES.DEFAULT_DOMAIN = world
That means '.world' is going to be appended to your connect string before looking it up in tnsnames. Either remove that line from sqlnet.ora, or append '.world' to the entry name in tnsnames.ora
mytnsentry.world =
(description...)
Agree with what #EdStevens said, and also remove the SQLNET.AUTHENTICATION_SERVICES line from sqlnet.ora. That setting is intended to help authenticate users with Windows native security (like OS authentication), but if you're not using that then it can often create problems.

Error- pl/sql developer -12154 tns could not resolve the connect identifier specified

Good Morning. I tell you my connection problem with pl / sql Developer.
First, I will indicate my environment:
-SO Windows10 64 bits.
-PLSQL Developer 13 (64 bit)
-Client Oracle 12-64bits.
Now I put the screenshots of my settings.
But finally the connection error message returns
Cause of this issue would be you tried to connect to Oracle, but the service name is either missing from the TNSNAMES.ORA file or is incorrectly defined.
You can try below options:
Make sure that the TNSNAMES.ORA file exists and is in the correct directory.
Make sure that the service name that you are connecting to is included in the TNSNAMES.ORA file and that it is correctly defined.
Make sure that there are no syntax errors in the TNSNAMES.ORA file. For example, if there are unmatched parentheses in the file (ie: open bracket without the corresponding close bracket), the file will be rendered unusable.
Check if tnsping works. Open command window type tnsping SERVICE_NAME. Here SERVICE_NAME is the oracle database you want to connect to and it must already exist in tnsnames.ora file where your client product is installed.
If tnsping works and still PL/SQL Developer complains about ORA-12154 then check where PL/SQL Developer program is installed. If it is located in an address which contains brackets this is the problem. So uninstall and reinstall it in a location where location address doesn't contain brackets.
set Environment Variables: ORACLE_BASE, ORACLE_HOME, ORACLE_SID
I hope this works with the above options

Why can I log in with SQL Developer but not with SQL*Plus?

I'm trying to connect to from SQL*Plus and get error ORA-12154, but I can connect from SQL Developer without any error. I can tnsping and also lsnrctl is okay and the listener is up and running.
I can connect as sys like sqlplus sys as sysdba which works fine; but with another user I do sqlplus username and when I type the password it gives me:
ORA-12154: TNS:could not resolve the connect identifier specified
SQL*Plus interprets an # symbol as the start of a TNS alias. If your password has that in it then it will be interpreted that way even if you are not trying to connect over SQL*Net, but with a local connection. So if you do:
sqlplus user/p#ssword
... then it will take just the p as the password, and the #ssword as the alias, so it will try to find a TNS alias of ssword in your tnsnames.ora file. Since that doesn't exist, you'll get the "ORA-12154: TNS:could not resolve the connect identifier specified" error.
That applies when you put your password in at the prompt too, so if you do:
sqlplus user
Enter password: p#ssword
you'll get the same thing. You can connect by enclosing the password in double-quotes:
sqlplus user
Enter password: "p#ssword"
but you can't do that with the unprompted version.
You're probably better off changing your password to something without that particular character if you want to be able to connect from SQL*Plus as well as from other clients that don't interpret TNS in the same way.
SQL Developer, for example, accepts the password and connection settings as separate fields; it isn't trying to parse the string you entered to identify its components, so it doesn't get confused. Even if you tell SQL Developer to connect using a TNS alias, it will use the tnsnames.ora value you select from its drop-down list, it won't try to take it from the user or password fields.
This one worked for me ( and was easier to implement from my behalf )
From : TNSPING OK but sqlplus gives ORA-12154?
Create an environment variable TNS_ADMIN that points to the directory where your tnsnames.ora file resides. Then try to connect with sqlplus.
TNS_ADMIN = D:\oracle\12.1.0\dbhome_1\NETWORK\ADMIN\tnsnames.ora
If that works, then my guess is you maybe installed the Oracle client software too, and when you run sqlplus, it looks for the tnsnames.ora file in your client home.
-- Instructions for Adding the Environment variable TNS_ADMIN in windows
Go to control panel / system
select Advanced system settings
Select "Advanced" tab, and the environment variable button is at the bottom.
create new variable TNS_ADMIN and give the path where the .ora files are stored. e.g. C:\app\oracle\product\11.2.0\client_1\network\admin

Cannot connect to database using TOAD?

I get a error while trying to connect using TOAD:
ora 12154 tns could not resolve the connect identifier specified(myDBname)
You might be mis-naming the server...
If you are using local naming (TNSNAMES.ORA file):
Make sure that "TNSNAMES" is listed as one of the values of the NAMES.DIRECTORY_PATH parameter in the Oracle Net profile (SQLNET.ORA)
Verify that a TNSNAMES.ORA file exists and is in the proper directory and is accessible.
Check that the net service name used as the connect identifier exists in the TNSNAMES.ORA file.
Make sure there are no syntax errors anywhere in the TNSNAMES.ORA file. Look for unmatched parentheses or stray characters. Errors in a TNSNAMES.ORA file may make it unusable.
Try using the IP(rather then the name) of the Oracle serverin tnsnames.ora, and check you have permissions. Can you ping the server?

how can I use "impdp" command importing .dmp data with port number?

I am trying to import data to an Oracle database. I have ".imp" and ".dmp" files for importing data. The database is using port 1521 and database name is "DB".
I have tried the following command, but doesn't work.
impdp root/password#xxx.xxx.xxx.xxx:1521:DB
dumpfile=transmart.dmp
logfile=transmart.imp
schemas=i2b2hive,i2b2metadata,i2b2sampledata,i2b2demodata,i2b2workdata
,biomart,biomart_user,deapp,searchapp,tm_cz,tm_lz,tm_wz
ERROR: either ORA-12504: TNS:listener was not given the SERVICE_NAME in CONNECT_DATA or ORA-12545: Connect failed because target host or object does not exist
I can telnet the IP and port with no problem.
Can anyone suggest please?
Thanks!
You have a syntax error in your EZConnect string.
Try this instead (no need to fuss with tnsnames.ora this way):
impdp root/password#xxx.xxx.xxx.xxx:1521/DB
Notice the replacement of the ":" with a "/" between port and service name.
As a side note, I long ago got out of the habit of putting passwords in command lines, where they may be easily snooped while the command is running. Let the program prompt you for the password:
impdp root#xxx.xxx.xxx.xxx:1521/DB
Especially if you're going to use root for your commands ;-)
Your reference to telnet suggests you are running this from a remote client rather than locally on the database server.
You need to edit your client's TNSNAMES.ORA file with the location information for DB. Perhaps you think you've already done this, in which case you've probably introduced a typo or got the syntax wrong.
The other thing to check is that the listener is running on the database server, as that's a very common cause of ORA-12545.
to import the latest transmart database dump we used the following:
wget https://github.com/transmart/transmartApp-DB/zipball/master
unzip master
tar zxvf transmart.dmp.tar.gz
cp transmart.dump /u01/app/oracle/admin/XE/dpdump
chown oracle:dba /u01/app/oracle/admin/XE/dpdump/transmart.dmp
impdp SYSTEM dumpfile=transmart.dmp logfile=transmart3.log full=y
If you don't use the full=y you will end up missing a number of tables. Hope this is still useful to you or someone else.

Resources