Home » Open Source » Programming Interfaces » ODBC config/connection string for Oracle RAC (Application: Perl on RHEL, Database: Oracle10g on Solaris )
ODBC config/connection string for Oracle RAC [message #426778] Mon, 19 October 2009 10:21 Go to next message
zaff
Messages: 50
Registered: July 2008
Member
hi guys,
We have an application written in Perl that uses ODBC to connect to a Oracle database. However, we now need this application to connect to a two-node Oracle RAC database. After doing some googling, it appears that the best way of ODBC to talk to RAC is to modify the tnsnames.ora file to refer to both nodes and the modify the ODBC connection string to refer to the tns name:

Sample tns entry:
MIDB =
  (DESCRIPTION = 
  (ADDRESS = (PROTOCOL = TCP)(HOST = rac1)(PORT = 1521))
  (ADDRESS = (PROTOCOL = TCP)(HOST = rac2)(PORT = 1521))
  (LOAD_BALANCE = ON)
  (FAILOVER = ON)
  (CONNECT_DATA =
  (SERVICE_NAME = MYCLUSTER)
  (failover_mode = (type=select)(method=basic))
  )
  ) 


Sample connection string:

my $dbh=DBI->connect('DBI:Oracle:MIDB','myuser','mypwd');



I would like to know if this is the best way of configuring ODBC for RAC without using any third-party add-ons.

Thanks in advance,
Zaff

[Updated on: Mon, 19 October 2009 10:48]

Report message to a moderator

Re: ODBC config/connection string for Oracle RAC [message #426790 is a reply to message #426778] Mon, 19 October 2009 11:36 Go to previous messageGo to next message
TallTed
Messages: 2
Registered: October 2009
Location: Burlington, MA, USA
Junior Member

It appears that you're actually using the DBD::Oracle connector, not the DBD::ODBC connector ... and thus not using ODBC for the connection at all ... but I believe you're on the right track other than that, as the DBD::Oracle connector does use the OCI Client, and inherits all its features including TNSname-based RAC.

Be seeing you,

Ted
Re: ODBC config/connection string for Oracle RAC [message #426793 is a reply to message #426778] Mon, 19 October 2009 11:53 Go to previous messageGo to next message
zaff
Messages: 50
Registered: July 2008
Member
Hey Ted - Thanks for the reply. Would this be the equivalent connection string for ODBC?:

$dbh = DBI->connect('dbi:ODBC:MIDB', 'user', 'password');


Thanks,
Zaff
Re: ODBC config/connection string for Oracle RAC [message #426795 is a reply to message #426793] Mon, 19 October 2009 12:17 Go to previous message
TallTed
Messages: 2
Registered: October 2009
Location: Burlington, MA, USA
Junior Member

If your ODBC DSN is also named MIDB, yes.

Important note --

For Load Balancing and Connection Failover, your setup will probably work fine.

However, please note that TAF (Transparent Application Failover) isn't really transparent, from an application-developer's perspective, and thus, may not be part of what you get here. I'm pretty sure that neither DBD::Oracle or DBD::ODBC handle all necessary aspects of TAF.

In other words -- proceed with caution.

Be seeing you,

Ted
Previous Topic: vb6 and Oracle 8.16 / 11g different results
Next Topic: Oracle 10.2 Startup /Shutdown via JDBC
Goto Forum:
  


Current Time: Fri Dec 02 12:22:26 CST 2016

Total time taken to generate the page: 0.11408 seconds