ORACLE Data Provider for .net OREA -12154 - visual-studio-2010

I am using Oracle data provider for .net to try to connect to the oracle DB, to add a ADO entity data framework model file, but i am getting the error below.
ORA-12154: TNS could not resolve the connect identifier specified
when I try to tnsping the data source name that i provide in the VS dialog i can successfully resolve it to the correct ip and host names. But for some reason the Oracle Data provider doesn't seem to be reading it from from my C:\oracle\product\10.2.0\client_1\NETWORK\ADMIN\tnsnames.ora
any ideas ?
i am using vs 2010 with the 32 bit oracle data provider from http://www.oracle.com/technetwork/topics/dotnet/index-085163.html
i can use the same TNS names on different sql client like sqlDbx it works smoothly on the same machine.

If you set a system environment variable TNS_ADMIN to the location of your tnsnames.ora file, does that help?

Related

Export Database connection to Oracle Developer

I have a database Connection established in odbcad and Microsoft Access (aswell as working in Excel) via ODBC and want to also get it working in Oracle SQL developer.
It is a Windows SQL Server as far as i know and I have tried several Settings, of which None works. I have also installed Driver for ODBC. I would like to Import Settings into SQL developer as applied in MS Access, is there any possibility?
No, SQL Developer is a Java application and uses a JDBC driver.
But if you look at the odbc properties for your connection, those should largely translate to what you need to define a basic connection.
Oracle:
Server name or IP address of the DB, port # for the listener, and the name of the SID or Service, plus a valid username and password is all you need to connect to Oracle.
What error do you get when you try to connect?
Show us what you're trying.
Update:
You're trying to connect to SQL Server but you're getting"
Native SSPI library not loaded
You're trying to use OS Authentication for your connection. For this to work with the jTDS driver, you need to copy a DLL file named ntlmauth.dll (which is for NT authentication) under the jtds-x.x.x-dist\x86\SSO\ or jtds-x.x.x-dist\x64\SSO\, to any directories in the PATH environment.
Please update your question such that's it's clear you're connecting to SQL Server and share the error message so others can find it.
I imagine this question is a duplicate of many previous iterations of the same challenge.

Online public Database for testing TNS connectivity Crystal Reports

Using crystal reports 2011 I am unable to connect to a remote oracle database.
Getting Error : ORA-12154: TNS:could not resolve the connect identifier specified
Using 32 bit Oracle 11g driver on 64 bit Windows.
The DSN is set up correctly and testing the connection works.
The DSN also works with other tools such as TNSPING and even Eclipse.
Is there any online public Oracle databases that I could try testing my connection via Crystal reports?
Let's say you are trying to connect to a TNS entry called "XYZ".
ORA-12154 is not saying that your tnsnames configuration for XYZ is incorrect - it is saying that we could not even find an entry called XYZ. Which either means
we could not find the tnsnames.ora file,
we were looking at the wrong tnsnames.ora file
If you can set environment variables as part of your Crystal Reports environment, the try set TNS_ADMIN to the location of your tnsnames.ora file

Communication between two databases (Oracle, VirtualBox)

Currently I am trying to understand how can two databases communicate to each other (for instance: get data from one to another).
Detailed description
I have two Oracle databases, one on Windows and latter on Oracle VirtualBox. On Windows DB I have one user (PAI) with single table called TESTME. On VirtualBox, only user (PAI_VB) was created. Now, I want to display the content of the TESTME table from SQL Developer from VB.
I have done
I want to display table TESTME using LINK statement:
CREATE DATABASE LINK LINK_TO_PAI
CONNECT TO PAI IDENTIFIED BY PAI
USING 'DESCRIPTION = (ADDRESS=(PROTOCOL=TCP)(HOST=myIP)(PORT=1521))
(CONNECT_DATA=(SERVICE_NAME=XE))';
Note: data from 'DESCRIPTION' section were taken from tnsname.ora file on Windows.
Having that, via following query I will manage to display table:
SELECT * FROM PAI.TESTME#LINK_TO_PAI;
Unfortunately, it does not work.
Error from console
ORA-12154: TNS:could not resolve the connect identifier specified
12154. 00000 - "TNS:could not resolve the connect identifier specified"
*Cause: A connection to a database or other service was requested using
a connect identifier, and the connect identifier specified could not
be resolved into a connect descriptor using one of the naming methods
configured. For example, if the type of connect identifier used was a
net service name then the net service name could not be found in a
naming method repository, or the repository could not be
located or reached.
*Action:
- 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
Questions
Could you please propose solution to my problem (I know that in *Action section there is a hint but still I cannot solve it).
Maybe, you could introduce me another way to make communication between two databases possible.
EDIT
I managed to connect from my VB machine to one on Win10 via SQLDeveloper and SQLPlus. Unfortunately, using Oracle LINK I can not access data from database.
SOLVED !!
I managed to solve my issue. The problem laid in LINK. Since following part:
'DESCRIPTION = (ADDRESS=(PROTOCOL=TCP)(HOST=myIP)(PORT=1521))
(CONNECT_DATA=(SERVICE_NAME=XE))'
was inside tnsnames.ora file i should define my link as follows:
CREATE DATABASE LINK LINK_TO_PAI
CONNECT TO PAI IDENTIFIED BY PAI
USING 'xe';
After that minor change, I was able to freely us LINK in my example. Cheers :)
Here's what you need to have for a working database link:
Network connectivity between the two hosts.
Oracle Listener process running on the host you want to connect to.
Correct TNS entry while creating the link.
Correct username and password to connect to the remote database.
The TNS-12154 error you're getting means the database running on the virtual host can't get to XE's listener using the description you gave it.
Make sure you're using the correct IP address when trying to connect to your Windows host from your virtual machine.
Run tnsping from your virtual environment to see if it can get to the Windows host listener.
tnsping 'DESCRIPTION = (ADDRESS=(PROTOCOL=TCP)(HOST=your_windows_host_ip_from_step_1)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=XE))'
or just tnsping XE if you have the TNS entry stored as XE in tnsnames.ora file on your virtual machine.
See also: Oracle documentation — Testing Connections.
Once you get OK response from tnsping try connecting to XE with sqlplus (sqlplus PAI/PAI#XE) or via SQL Developer running on the virtual host. If you can connect that way your database link should also work with the same TNS entry.
This is a tricky part of oracle because there are a number of diverent ways to make a connection.
I suggest that you begin to make sure that you have a tnsnames.ora file both on windows and in your virtualbox environment. What os are you running in VirtualBox by the way?
In both tnsnames.ora files both databases should be named. Easiest to make them identical.
Then connect with sql*plus from windows to your database in VirtualBox and from VirtualBox to your database on Windows.
Just to make sure your network and tns config are OK.
If this works recreate your db-link with the servce alias from tnsnames after using. This should work.

How do I connect to Oracle with SSIS? I am getting the error: "tns listener was not given the service_name in connect_data"

I am trying to connect to an Oracle DB through the Oracle Provider for OLE DB in SSIS, but am getting the following error when testing the connection: "tns listener was not given the service_name in connect_data". I am not too familiar with Oracle, so could someone provide me some direction for how to fix this error?
You can add the service name after the host name with a forward slash between them. This has worked in both the Microsoft and Oracle OLE DB providers.
IP/Service_Name also works, "12.12.123.123/Server1.domain.com"
First of all, always use Oracle driver. Not the Microsoft one.
Then, when connecting, supply the TNSNAME, USERNAME and PASSWORD to a OLEDB Connection.
That's all!
Ok ok, been here, and this is what works:
You need oracle data access components http://www.oracle.com/technetwork/topics/dotnet/utilsoft-086879.html
Download the one that applies to you (11g, 12c...)
It installs an OLE DB provider which is FAST and also .NET connectors (wich also work really well), so I recommend using OLEDB (also, attunity connector works wonders aswell after you installed ODAC).
Then just connect using ip/service name + credentials, for example
Image
You need to type "Servername/ServiceName" to Server Name Field .

ODP.NET doesn't work System.Data.OracleClient does

We are switching from the obsolete System.Data.OracleClient. I have switched all the references in the ASP.NET 2.0 code, however when I try to access the database server using ODP.NET calls I get ORA-12154: TNS:could not resolve the connect identifier specified. This works when I use System.Data.OracleClient on the same machine. Any suggestions about what is going wrong here?
You can avoid a dependency on Tnsnames.ora altogether, and go for the "independent" connection string in format:
Data Source =(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=MyHost)(PORT=MyPort)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=MyOracleSID))); User Id =myUsername; Password =myPassword;
BTW, you can look at connectionstrings.com/oracle for a quick, in-your-face list of supported connection string formats.
It sounds like your client install doesn't have your TNS names setup correctly. If you just installed ODP.NET on this machine, you probably just installed another Oracle client, and have yet to configure it.
Copy the TNSNAMES.ORA from the /NETWORK/ADMIN directory in the Oracle home where the OracleClient was installed and copy over to the new /NETWORK/ADMIN directory where ODP.NET is installed.
http://www.oracle.com/technetwork/topics/dotnet/odt-faq-085407.html#ORA-12154:_TNS:could_not_resolve_the
Christian Shay
Oracle

Resources