Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: Perl DBI connection with RAC environment
Thanks Peter for Detailed response
Peter McLarty <p.mclarty_at_cqu.edu.au> wrote:
Yes thats it as you can sqlplus to the sansrv you can dbi to the sansrv I loose the host ip and let dbi find its way with tnsnames and let oracle Net do the work for me
But if you have set up tnsname to have sansrv as a service with mumtliple hosts then you can specify the tnsnames entry for it and then you are in action as your tnsnames will have all nodes in its entry.
STUDD1 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = host-vip)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = bhost-vip)(PORT = 1521))
(LOAD_BALANCE = yes)
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = STUDD1.example.com)
(FAILOVER_MODE =
(TYPE = SELECT) (METHOD = BASIC) (RETRIES = 180) (DELAY = 5) )
Seems to work relaibly although not been used in production
my $dsn = "dbi:Oracle:$_[0]";
my $dbh = DBI->connect( $dsn, '/', '',
{
ora_session_mode => 2,
RaiseError => 1,
AutoCommit => 0
}
)
HTH Cheers
Peter
It means that If I have created a service on RAC as SANSRV where I had specified both node as preferred and TAF to SELECT. Now It means I can specify
Host - VIP of any of the RAC Node
SID - SANSRV
Please correct me if I am wrong
-- http://www.freelists.org/webpage/oracle-lReceived on Thu Apr 05 2007 - 08:49:53 CDT
![]() |
![]() |