perl DBI连接oracle的问题
对于不同的ORACLE连接串,可能需要调整连接方式,都需要有ORACLE客户端:
1. dwapprac =
(DESCRIPTION=
(ADDRESS=(PROTOCOL=TCP)(HOST=10.125.60.25)(PORT=1521))
(ADDRESS=(PROTOCOL=TCP)(HOST=10.125.60.26)(PORT=1521))
(LOAD_BALANCE=yes)
(CONNECT_DATA=
(SERVER=DEDICATED)
(SERVICE_NAME=dwapprac)
(FAILOVER_MODE=
(TYPE=SELECT)
(METHOD=BASIC)
(RETRIES=180)
(DELAY=5)
)
)
)my $db_url="dbi:Oracle:$database_name"; my $dbh = DBI->connect($db_url,$db_user,$db_password ,{AutoCommit => 1 ,RaiseError => 0 ,PrintError => 0} ) or printf STDERR "$DBI::err ($DBI::errstr)\n"; unless ( defined($dbh) ) { return undef; } return ($db_type,$dbh);
2. dwapp =
(DESCRIPTION=
(LOAD_BALANCE=NO)
(ADDRESS_LIST=
(ADDRESS=(PROTOCOL=TCP)(HOST=10.125.70.54)(PORT=1522))
(ADDRESS=(PROTOCOL=TCP)(HOST=10.125.70.55)(PORT=1522))
)
(CONNECT_DATA=
(SERVICE_NAME=dwapp)
)
)my $db_url="dbi:Oracle:host=$host;sid=$database_name;port=$port"; my $dbh = DBI->connect($db_url,$db_user,$db_password ,{AutoCommit => 1 ,RaiseError => 0 ,PrintError => 0} ) or printf STDERR "$DBI::err ($DBI::errstr)\n"; unless ( defined($dbh) ) { return undef; } return ($db_type,$dbh);
相关推荐
lklong 2020-11-22
oraclemch 2020-11-06
shilukun 2020-10-10
周嘉笙 2020-11-09
iilegend 2020-10-19
EricRay 2020-10-16
zhuzhufxz 2020-09-16
dataminer 2020-08-17
bfcady 2020-08-16
Hody 2020-08-16
FightFourEggs 2020-08-16
数据库设计 2020-08-16
Seandba 2020-08-16
Omega 2020-08-16
zjyzz 2020-08-16
yanghuatong 2020-08-16
ktyl000 2020-08-16
dbasunny 2020-08-16