RE: Insights into DBI->connect differences
- From: Ron.Reidy@xxxxxxxxxxxxxxxxxx (Ron Reidy)
- Date: Wed, 15 Feb 2006 21:22:08 -0700
Sorry, pushed the send button too fast ...
You also should set your oracle environment using the shell script
oraenv. There are many other env vars that need to be set in order for
the DBD to load and function correctly. Again, see the link I sent
earlier and set for oraenv.
-----Original Message-----
From: Reidy, Ron
Sent: Wednesday, February 15, 2006 9:19 PM
To: Capacio, Paula J; dbi-users@xxxxxxxx
Subject: RE: Insights into DBI->connect differences
The Oracle error docs are your friend:
http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96525.pdf
--
Ron Reidy
Lead DBA
Array BioPharma, Inc.
-----Original Message-----
From: Capacio, Paula J [mailto:PCAPACIO@xxxxxxxxx]
Sent: Wednesday, February 15, 2006 1:37 PM
To: dbi-users@xxxxxxxx
Subject: Insights into DBI->connect differences
Hello, I'm hoping someone can explain why one of these connect
statements work and the other doesn't. The script sets environment
values as such: $ENV{ORACLE_HOME} = "/usr/oracle/product/8.1.7_64";
$ENV{ORACLE_SID} = $db_alias; #$db_alias passed to script via
$ARGV[1]
my $dbh;
if ($method =~ /2/) { # $method passed to script via $ARGV[2]
#this works
$dbh = DBI->connect('', "scott/tiger", '', 'Oracle')
or die "Connect failed: $DBI::errstr\n";
}else{ #this doesn't
$dbh = DBI->connect("dbi:Oracle:$db_alias",'scott','tiger')
or die "Connect failed: $DBI::errstr\n";
}
The error I'm getting on the latter case is: DBI->connect(mp3i) failed:
ORA-12154: TNS:could not resolve service name (DBD ERROR:
OCIServerAttach) at ./OraConn3.pl line 49
Connect failed: ORA-12154: TNS:could not resolve service name (DBD
ERROR: OCIServerAttach)
Does this imply that the first case does not use TNS service names?
The DBI docs state: "There is no standard for the text following the
driver name. Each driver is free to use whatever syntax it wants. The
only requirement the DBI makes is that all the information is supplied
in a single string. You must consult the documentation for the drivers
you are using for a description of the syntax they require." The
DBD::Oracle doc doesn't go into detail on the variations and what they
imply. Can anyone provide some insight?
The issue I'm really trying to address is that both connection
variations work on an HP/UX 11.00 server, perl version: 5.006001, DBI
(version 1.20), DBD::Oracle (version 1.12); but on an HP/UX 11.11 server
with the same perl and oracle libraries/versions only the first
variation works. I'm trying to determine why and suggest a resolution.
BTW, I'm a lowly programmer (aka: hacker); I'm not the DBA or the server
sysadmin and the DBA doesn't know perl.
Thanks in advance.
Paula
This electronic message transmission is a PRIVATE communication which
contains information which may be confidential or privileged. The
information is intended
to be for the use of the individual or entity named above. If you are
not the
intended recipient, please be aware that any disclosure, copying,
distribution
or use of the contents of this information is prohibited. Please notify
the sender of the delivery error by replying to this message, or notify
us by telephone (877-633-2436, ext. 0), and then delete it from your
system.
This electronic message transmission is a PRIVATE communication which contains
information which may be confidential or privileged. The information is intended
to be for the use of the individual or entity named above. If you are not the
intended recipient, please be aware that any disclosure, copying, distribution
or use of the contents of this information is prohibited. Please notify the
sender of the delivery error by replying to this message, or notify us by
telephone (877-633-2436, ext. 0), and then delete it from your system.
.
- Prev by Date: RE: Insights into DBI->connect differences
- Next by Date: Re: Some progress on Strange selectall_hashref/fetchall_hashref problem with DBD::mysql
- Previous by thread: RE: Insights into DBI->connect differences
- Next by thread: RE: Insights into DBI->connect differences
- Index(es):