Skip to Main Content

Oracle Database Express Edition (XE)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

access oracle 10g xe with perl

wucisAug 29 2011 — edited Sep 12 2011
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
oracle-xe-universal 10.2.0.1-1.0
oracle-instantclient-basic 10.2.0.3-2

after using
#!/usr/bin/perl
 
my $ORACLE_HOME = "/usr/lib/oracle/xe/app/oracle/product/10.2.0/server";
my $ORACLE_SID="XE";
 
$ENV{ORACLE_HOME}=$ORACLE_HOME;
$ENV{ORACLE_SID}=$ORACLE_SID;
$ENV{PATH}="$ORACLE_HOME/bin";
# $ENV{LD_LIBRARY_PATH}="$ORACLE_HOME/lib";
 
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";
 
$dbh->disconnect;
I get the error:

wucis@dell6400:~/perlora$ perl zugriff1.pl
DBI connect('XE@localhost','scott',...) failed: ORA-12154: TNS:could not resolve the connect identifier specified (DBD ERROR: OCIServerAttach) at zugriff1.pl line 13



although sqlplus scott/tiger works properly
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 10 2011
Added on Aug 29 2011
3 comments
730 views