This discussion is archived
2 Replies Latest reply: Aug 29, 2011 7:30 AM by fac586 RSS

access oracle 10g xe with perl

449363 Newbie
Currently Being Moderated
I'm using ubuntu lucid as OS, oracle 10g xe as db and want to access the oracle db via perl.
Installed software:
libdbd-oracle-perl 1.21-2
libdbi-perl 1.609-1build1
perl, v5.10.1 (*) built for i486-linux-gnu-thread-multi

after using

my $ORACLE_HOME = "/usr/lib/oracle/xe/app/oracle/product/10.2.0/server";


use strict;
use DBI;
my $dbh = DBI->connect( 'dbi:Oracle:XE@localhost','scott','tiger',{ RaiseError => 1, AutoCommit => 0 }
                      ) || die "Database connection not made: $DBI::errstr";

I get the error:
wucis@dell6400:~/perlora$ perl
DBI connect('XE@localhost','scott',...) failed: ORA-12154: TNS:could not resolve the connect identifier specified (DBD ERROR: OCIServerAttach) at line 13
although sqlplus scott/tiger works properly


  • Correct Answers - 10 points
  • Helpful Answers - 5 points