Cannot connect to RAC setup using TNS

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
cbc700
Posts: 46
Joined: Fri 03 Aug 2007 17:25

Cannot connect to RAC setup using TNS

Post by cbc700 » Sat 04 Dec 2010 18:49

I am having trouble getting UniDAC to connect to a RAC setup via TNS (non-direct). In design mode, I've specified the usename, password, and have selected the appropriate alias in the server dropdown (it is correctly populated with all the aliases from TNSNAMES.ORA). Of course, Direct is set to false.

When I attempt to connect, I consistently receive:

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

If I set up the exact same connection is SQL Developer, I can connect without trouble.

Here is my TNSNAMES.ORA file:

mydb =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = mydb-cluster)(PORT = 1521))
(LOAD_BALANCE = yes)
(FAILOVER = yes)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = mydb)
)
)


I'm using the latest version of UniDAC (3.5.0.13) under Delphi 2010. And I'm using the full client (32 bit).

Thanks.

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Post by AlexP » Mon 06 Dec 2010 12:26

Hello,

Please specify the exact version of Oracle Client and Server and the version of the client OS.

cbc700
Posts: 46
Joined: Fri 03 Aug 2007 17:25

Post by cbc700 » Wed 08 Dec 2010 02:10

I know overall the Oracle version is 11g (I'll have to ask someone for an exact number).

The client OS is Windows 7 Ultimate 64 bit.

I'm running the 32 bit version of the full Oracle 11.2 client.

My oci.dll is version 11.2.0.1. It was installed in the default location.

Thanks.

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Post by AlexP » Wed 08 Dec 2010 09:15

Hello,

Unfortunately I can not reproduce the problem.
I have tested it on the same configuration: Windows 7 x64, Oracle Client 11.2. x32, Delphi 7 and XE, and all works fine.
Please try to connect in the run-time mode.
Also please check the correct settings the TNS_ADMIN values in the registry and in the Environment variables.
We have the same problem with the Oracle XE client, it is caused by the Oracle XE client behavior.
If the application that tries to connect to Oracle is located in a folder the name of which contains brackets - '(' or ')' ,
then client cannot resolve the connection identifier. But in the other Oracle clients the problem doesn't arise.

cbc700
Posts: 46
Joined: Fri 03 Aug 2007 17:25

Post by cbc700 » Wed 08 Dec 2010 20:27

Thanks.

Just for reference, my full client path is C:\app\carlton\product\11.2.0\client_1. And there is a BIN subfolder full of binaries (and many other subfolders).

Could you please post your TNSNAMES.ORA file.

Are you sure your TNS file specifics a RAC set up with a service name reference, and not a direct reference using an SID?

Could your answer in my other post about service name support coming for direct mode be part of the issue (as in UniDAC might not support service names yet under any circumstances)?

Thanks.

cbc700
Posts: 46
Joined: Fri 03 Aug 2007 17:25

Post by cbc700 » Mon 13 Dec 2010 17:59

Still hoping for a reply to my last post. Thanks!

ioannisa
Posts: 13
Joined: Fri 19 Jun 2009 13:23

Post by ioannisa » Tue 14 Dec 2010 12:16

Same problem in topic I started few minutes ago.

bork
Devart Team
Posts: 649
Joined: Fri 12 Mar 2010 07:55

Post by bork » Tue 14 Dec 2010 14:12

Hello

Here is my TNSNAMES.ORA file:
ORCL1110_FO =
(DESCRIPTION =
(ADDRESS_LIST =
(FAILOVER=on)
(LOAD_BALANCE=on)
(ADDRESS = (PROTOCOL = TCP)(HOST = dboracle)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = dboracle)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = dboracle)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = ORCL1110)
)
)
All works correctly.

Maybe your SQL Developer is using x64 Oracle client and can connect successfully. Please try to connect to another server without Balancing and Failover support. Also please define Homename correctly, because Delphi compiles Win32 applications only and cannot use x64 DLL (and required Win32 Oracle client). So you should set the Win32 Oracle client to your Homename property. And please check that TNSNAMES.ORA files for x64 Oracle client and for Win32 Oracle Client are the same.

We are working for supporting Service name in the Direct mode. As soon as Service names will be supported in the direct mode we will notify you.

to ioannisa
Please specify your Oracle Client and Server versions and your client OS version. If they are the same as cbc700's ones then please try to connect to standard Oracle server by Win32 Oracle client (see advices before).

I am waiting for results.

ioannisa
Posts: 13
Joined: Fri 19 Jun 2009 13:23

Post by ioannisa » Tue 14 Dec 2010 16:10

I am sorry to object, but

The very same project. Compiled at x86 pc with Delphi7, runs on PC with x64 faulty connection.

The very same project. Compiled at x64 pc with DelphiXE, doesn't run on itself.

In both cases the exe file is a x86 application since both delphi7 and delphiXE produce 32bit applications. We are talking about the same project being compiled at the two different versions of delphi! So I don't think it has to do with the oracle and OCI.DLL or I would have problem on the project being compiled at Delphi7 as well.

I still belive its the delphiXE version of the component being installed on 64bit machine running DelphiXE that is responsible for the problem. Ofcourse I might be wrong.

I might be wrong, however I will try what you say tomorrow and let you know.

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Post by AlexP » Fri 17 Dec 2010 12:29

Hello,

ioannisa:
Also please specify the following information:
- the exact version of Oracle Client for both OS's;
- the exact version of UniDAC;
- your tnsnames.ora file.

ioannisa
Posts: 13
Joined: Fri 19 Jun 2009 13:23

Post by ioannisa » Mon 20 Dec 2010 12:21

I posted all this info at my own thread by bork told me that I should not post duplicate threads as its similar problem to this thread and told me to continue on this one.

http://www.devart.com/forums/viewtopic.php?t=19759

On the link above is the info you ask

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Post by AlexP » Mon 20 Dec 2010 16:19

Hello,

Please make sure that a firewall is disabled.
Please check what you have only one Oracle Client installed and that it it is a x32 application.
Please check what you have only one tnanames.ora file.
Please try installing the latest Oracle Client, or try connecting using Oracle Instant Client.
I can successfully connect from both Delphi XE and Delphi 7 in both modes.

cbc700
Posts: 46
Joined: Fri 03 Aug 2007 17:25

Post by cbc700 » Sun 06 Mar 2011 06:32

Would you be able to try it from Delphi 2010 since that remains a configuration that still shows the trouble? With that RAC setup I am trying to get to, with the 3.60.0.15 version, I have been unable to connect in direct mode with a service name or via non-direct mode. Only connections to one instance is possible in direct mode.

Could this be something specific to Delphi 2010?

Even after reviewing your previous list (firewall, etc.), the problem persists.

Thanks.

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Post by AlexP » Mon 07 Mar 2011 09:12

Hello,

cbc700:
UniDAC can't connect to RAC servers in the direct mode, connection to these servers is possible only in the OCI mode.
Please specify your tnsnames.ora file.

Post Reply