Cant connect to Oracle

Posts   
 
    
Pm38702003
User
Posts: 3
Joined: 19-Apr-2016
# Posted on: 19-Apr-2016 23:06:18   

First time trying to use the product. I am working on a Windows 7SP1 box. Running Oracle 11.2 I have both the ORA 32 and 64 bit oracle client installed. TNS is in both directories client_1/... and client_2... and appear to work fine with other applications TOAD(32 bit)/SharePoint(64 bit).

When selecting the Database Driver: MS Oracle, and Oracle net Service Name: Data Source=KDEV;User ID=XXX_APP;Password=XXXXXXXXX; this string works in both SP and TOAD

I get the following: Exception message:

Exception type: OracleException ORA-12154: TNS:could not resolve the connect identifier specified

Details: LLBLGen Pro version 4.2. Build March 10th, 2016 -----[Core exception]-------------------- at System.Data.OracleClient.OracleException.Check(OciErrorHandle errorHandle, Int32 rc) at System.Data.OracleClient.OracleInternalConnection.OpenOnLocalTransaction(String userName, String password, String serverName, Boolean integratedSecurity, Boolean unicode, Boolean omitOracleConnectionName) at System.Data.OracleClient.OracleInternalConnection..ctor(OracleConnectionString connectionOptions) at System.Data.OracleClient.OracleConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject) at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) at System.Data.OracleClient.OracleConnection.Open() at SD.LLBLGen.Pro.Gui.Controls.WizardPages.MetaDataRetrievalWizard_Step_ConnectionData.TestConnectionData(Boolean showSuccess)

When using OPD.Net I get: The Driver ODP.NET could not be loaded due to an exception. this likely occurred because you didn't have the proper DO.NET provider installed for the driver to function. the driver is remover from the dropdown... I have confirmed the install in n the Oracle Universal installer. Have trieed without luck the multiple troubleshooting suggestions in the TNS not resolved threads

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 20-Apr-2016 07:21:32   

About the ORA-12154: - Could you show us the TSNames file(s) (client1, client2)? - Could you try running LLBLGenPro_x86.exe instead of the default one?

About the The Driver ODP.NET exception: It looks like LLBLGen can't find the ADO.NET DbProviderFactory for ODP.Net. Please double check that you selected this option in the installer and that you have it installed and added to the machine.config driver list.

David Elizondo | LLBLGen Support Team
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 20-Apr-2016 09:32:31   

Yeah I think it's related to 32bit/64bit. By default llblgen pro runs as a 64bit app, and will use 64bit odp.net, and therefore the tnsnames.ora of the 64bit client and the factory installed in the 64bit machine.config file of .NET.

Frans Bouma | Lead developer LLBLGen Pro
Pm38702003
User
Posts: 3
Joined: 19-Apr-2016
# Posted on: 20-Apr-2016 19:24:47   

here is the TNS entry in both .32 and 64 bit versions of the client.

KDEV = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = xxxxxx.xxxx.mil)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = KDEV) (INSTANCE_NAME = KDEV) ) )

also here are the entries from the machine.conf is something missing??

<add name="Odbc Data Provider" invariant="System.Data.Odbc" description=".Net Framework Data Provider for Odbc" type="System.Data.Odbc.OdbcFactory, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> <add name="OleDb Data Provider" invariant="System.Data.OleDb" description=".Net Framework Data Provider for OleDb" type="System.Data.OleDb.OleDbFactory, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> <add name="OracleClient Data Provider" invariant="System.Data.OracleClient" description=".Net Framework Data Provider for Oracle" type="System.Data.OracleClient.OracleClientFactory, System.Data.OracleClient, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> <add name="SqlClient Data Provider" invariant="System.Data.SqlClient" description=".Net Framework Data Provider for SqlServer" type="System.Data.SqlClient.SqlClientFactory, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> <add name="Microsoft SQL Server Compact Data Provider" invariant="System.Data.SqlServerCe.3.5" description=".NET Framework Data Provider for Microsoft SQL Server Compact" type="System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=3.5.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 20-Apr-2016 20:13:05   

Could you try running LLBLGenPro_x86.exe instead of the default one?

Did you give this a try?

As for the ODP.NET error, if you have installed it correctly, then please examine the machine.config files to see if it has registered itself there, if not, then you may add them to the LLBLGenPro.config files

You should have something like the following for the managed and unmanaged providers.

<add name="ODP.NET, Managed Driver" invariant="Oracle.ManagedDataAccess.Client" description="Oracle Data Provider for .NET, Managed Driver" type="Oracle.ManagedDataAccess.Client.OracleClientFactory, Oracle.ManagedDataAccess, Version=4.121.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342" />
     <add name="ODP.NET, Unmanaged Driver" invariant="Oracle.DataAccess.Client" description="Oracle Data Provider for .NET, Unmanaged Driver" type="Oracle.DataAccess.Client.OracleClientFactory, Oracle.DataAccess, Version=4.121.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342" />
Pm38702003
User
Posts: 3
Joined: 19-Apr-2016
# Posted on: 20-Apr-2016 20:28:01   

yes the results are the same

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 20-Apr-2016 20:38:08   

Check this out.

ORA-12154: TNS:could not resolve the connect identifier specified

Scenario: You just installed Oracle Developer Tools, and now you cannot connect to the database using a Oracle connect alias that has worked in the past. You get a ORA-12154 error when you attempt to connect.

Cause: When you install Oracle Developer Tools, it typically creates a new "Oracle Home" (a new Oracle subdirectory, for example C:\oracle\product\10.2.0\my_new_home ) Each Oracle home maintains it's own copy of your connect aliases in a file called TNSNAMES.ORA. When you try to connect from this new Oracle home, none of your old connect aliases will exist in the new copy of TNSNAMES.ORA, therefore you get this error. They need to be copied over to the new Oracle home.

Solution: Copy <OLD_ORACLE_HOME>\NETWORK\ADMIN\TNSNAMES.ORA to <NEW_ORACLE_HOME>\NETWORK\ADMIN\TNSNAMES.ORA . In some configurations, copying SQLNET.ORA and LDAP.ORA files from the same directory above may also be required.

Additionally: 64-bit Windows users who after doing the above steps still get ORA-12154 should either: 1) Upgrade to the latest version of their Oracle client that contains the fix for bug 3807408, or 2) rename subdirectories in their application that contain parenthesis to remove those parenthesis, in particular: C:\Program Files (x86)\Microsoft SQL Server and C:\Program Files(x86)\Microsoft Visual Studio 8

ref: http://www.oracle.com/technetwork/topics/dotnet/odt-faq-085407.html#ORA-12154:_TNS:could_not_resolve_the

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 21-Apr-2016 09:37:43   

Additionally, there are 2 machine.config files: one for 32bit and one for 64bit. One is in Windows\Microsoft.NET\Framework\v4.0.....\Config and one is in Windows\Microsoft.NET\Framework64\v4.0.....\Config

If you run llblgen pro as 64bit, it will use the one in Framework64.

Frans Bouma | Lead developer LLBLGen Pro