Ora 12154 Error Visual Studio
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About
Ora-12154 Tns Could Not Resolve The Connect Identifier
Us Learn more about Stack Overflow the company Business Learn more about hiring ora-12154 tns could not resolve service name developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the
Ora-12154 Tns Could Not Resolve The Connect Identifier Specified Windows 7
Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up VS2010 + Oracle driver: ORA-12154: TSN:could tns could not resolve the connect identifier specified visual studio not resolve the connect identifier specified up vote 3 down vote favorite I am using: Visual Studio 2010 .Net Framework Data Provider for Oracle Oracle Developer Tools for Visual Studio (from Oracle's website) I tried installing 'Oracle Developer Tools for Visual Studio' and created tnsnames.ora and sqlnet.ora files in my C:\app\ [my username]\product\11.2.0\client_1\Network\Admin directory. They look like this: # tnsnames.ora ORATEST = (DESCRIPTION = (ADDRESS_LIST = visual studio ora-12154 (ADDRESS = (PROTOCOL = TCP)(HOST = dbs-oratest)(PORT = 1521)) ) (CONNECT_DATA = (SID = [ORATEST]) ) ) and # sqlnet.ora SQLNET.AUTHENTICATION_SERVICES= (ALL) NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT) When I try using the .Net Framework Data Provider for Oracle driver to set up a new connection (or any other driver for that matter: OLE, ODBC, etc) it gives the error: ORA-12154: TSN:could not resolve the connect identifier specified Using the OLE driver on a machine without the Oracle client installed DOES work though: OleDbConnection conn = new OleDbConnection( "Provider=MSDAORA;Data Source=ORATEST;" + "Persist Security Info=True;Password=readonly;User ID=readonlyuser"); What am I doing wrong? Are there any simple instructions online about how to install a basic Oracle driver? Thank you in advance! .net visual-studio oracle driver share|improve this question asked Nov 19 '10 at 19:40 Matt 1,79631833 add a comment| 4 Answers 4 active oldest votes up vote 3 down vote accepted The best solution I found was to use the Oracle Data Access Client library, and include the entire TNS names entry in the connection string. This allows the project to be easily published to a web server, ClickOnce, etc. Here are the steps necessary to set up the Oracle driver work
while creating a linked server to Oracle ★★★★★★★★★★★★★★★ SnehadeepJune 30, 201028 Share 0 0 This is one of the most common errors while creating linked server to Oracle database. Today I will discuss the
Tns Could Not Resolve The Connect Identifier Specified Oracle 10g
reason for this error and possible resolutions.
Full error message: OLE ora-06413 DB provider "MSDAORA" for linked server "LINKED_ORA" returned message "ORA-12154: TNS:could not resolve the connect identifier specified". Msg 7303,Tnsnames.ora Location
Level 16, State 1, Line 1
Cannot initialize the data source object of OLE DB provider "MSDAORA" for linked server "LINKED_ORA". First of all make sure you have reviewed the following http://stackoverflow.com/questions/4228739/vs2010-oracle-driver-ora-12154-tsncould-not-resolve-the-connect-identifier Microsoft KB article that has a lot of good information on troubleshooting Oracle linked server issues. How to set up and troubleshoot a linked server to an Oracle database in SQL Server http://support.microsoft.com/kb/280106 Also make sure you have installed Oracle Client on the SQL server. If the SQL server is 64 bit then we need to install 64 bit Oracle provider. You can also create https://blogs.msdn.microsoft.com/dataaccesstechnologies/2010/06/30/ora-12154-tns-could-not-resolve-the-connect-identifier-specified-error-while-creating-a-linked-server-to-oracle/ linked server using Oracle ODBC driver together with Microsoft OLE DB provider for ODBC. Once again on a 64 bit SQL server you need to install the 64-Bit OLEDB Provider for ODBC (MSDASQL) and 64 bit Oracle ODBC drivers. However 64-Bit OLEDB Provider for ODBC (MSDASQL) is already there in Windows Vista/Windows Server 2008 and later OS. This particular error message is a very general error message and can happen for quite a number of reasons. For general understanding of the error, you can review oracle documentation like this http://ora-12154.ora-code.com/ In SQL Server Linked Server, it could indicate a few things (not limited to)– 1. SQL Server (and oracle net libraries) is not able to get the TNS alias from tnsnames.ora file. 2. Something is wrong with the way the alias is created in the tnsnames.ora file (incorrect syntax) 3. TNS alias could not be resolved into a connect descriptor Below is a list of things that you can try to resolve this issue. 1. Verify that the tnsnames.ora file has the alias and the service name that the customer is using. TNS entry for the Oracle database ==through Server Explorer in Visual Studio, you have to ensure that:1. You have installed the Oracle Data Provider (downloadable from the Oracle Website)2. Have created the tnsnames.ora file, holding information about http://www.yyosifov.com/2011/10/ora-12154-tnscould-not-resolve-connect.html the databases (http://www.orafaq.com/wiki/Tnsnames.ora). This file should be created most often in the Network\Admin folder under the Oracle Provider. In my case: C:\app\user\product\11.2.0\client_1\Network\AdminAfter having these prerequisites, I still couldn't connect to the Oracle Database. The Visual Studio wizard told me: "ORA-12154: TNS:could not resolve the connect identifier specified". What resolved this issue for me was to add the Environment Variable with name "TNS_ADMIN" and value the Path to the tns could directory containing the "tnsnames.ora" file.Something like:TNS_NAMES="C:\app\user\product\11.2.0\client_1\Network\Admin"Then just restart Visual Studio and you're free to go.Hope this helps someone out there :) Posted by cypressx at 8:05 AM Email ThisBlogThis!Share to TwitterShare to FacebookShare to Pinterest 27 comments: Anonymous said... Has the same issue as you and this blog post helped me resolve my issue.Thanks ......... December 24, 2011 at 8:45 AM Anonymous said... this helped me a tns could not lot. i love you man. April 9, 2012 at 10:06 AM Kannan said... will u please explain me further clear.. am using oracle 10g express edition.. i am facing this problem for a week.. pls help me.. April 29, 2012 at 11:14 AM abdul sharique said... Hi kannanCan u plz share oracle database 10g . bcoz we r unable to find it on Oracle site. June 14, 2012 at 4:26 AM Anonymous said... You are the man! It worked pretty easy. June 22, 2012 at 1:26 AM Anonymous said... how can i add enviorment variable ??kindly tell me please June 26, 2012 at 12:35 AM cypressx said... This comment has been removed by the author. June 26, 2012 at 3:48 AM cypressx said... Hi, please take a look here:http://www.windows7hacker.com/index.php/2010/05/how-to-addedit-environment-variables-in-windows-7/There is a step-by-step guide with screenshots.Best,Yosif June 26, 2012 at 3:49 AM Kishore Peddada said... Yosif...YO man .THANK YOUYou same hell of time, I was breaking my dead, I did added environment variables, but not restarted VS2010After reading your blog, I restarted VS, it started working..thanks September 7, 2012 at 1:38 PM alain said... I spent hours Binging/Googling on this topic. Yosif, You're the man! September 14, 2012 at 4:12 PM kutu