ericdp has asked for the wisdom of the Perl Monks concerning the following question:
Is it possible to do a connect to a database when there is no entry in the local machines TNSNAMES.ORA file?
perl, v5.6.1 built for sun4-solaris
$DBI::VERSION = "1.20";
$DBD::Oracle::VERSION = '1.12';
I've tried the following, but to no avail.
I get the following errors... my $conn = "dbi:Oracle:HOST=$host;SID=$sid;port=1521"; my $db_h = DBI->connect ( $conn, $user, $pwd, { AutoCommit => 0, # 0 = false RaiseError => 0, PrintError => 0, ChopBlanks => 1 # CHAR chopped } ) || BEGIN { print color 'red on_black'; warn "\n" . "x" x 70 . "\n" . "\t--> Connecting to " . uc ( $sid ) . " as " . uc ( $user ) . " <--\n\n" + . $DBI::errstr . "\n" . "x" x 70 . "\n"; print color 'reset'; print "\n"; return undef; }; ...
********************************************************************** +* Fatal NI connect error 12541, connecting to: (DESCRIPTION=(ADDRESS=(HOST=machineA.com)(PROTOCOL=tcp)(PORT=1521))(CO +NNECT_DATA=(SID=aaa)(CID=(PROGRAM=t2.pl@bbb) (HOST=aaa)(USER=uuuuu)))) ********************************************************************** +* Fatal NI connect error 12535, connecting to: (DESCRIPTION=(ADDRESS=(HOST=machineA.com)(PROTOCOL=tcp)(PORT=1521))(CO +NNECT_DATA=(SID=aaa)(CID=(PROGRAM=t2.pl@bbb) (HOST=aaa)(USER=uuuuu)))) ********************************************************************** +* Fatal NI connect error 12505, connecting to: (DESCRIPTION=(ADDRESS=(HOST=machineA.com)(PROTOCOL=tcp)(PORT=1521))(CO +NNECT_DATA=(SID=aaa)(CID=(PROGRAM=t2.pl@bbb) (HOST=aaa)(USER=uuuuu))))
Edited (davorg): Replace <pre> tags with <code>
Back to
Seekers of Perl Wisdom