Hi ,
Iam a newbie to DBI/DBD. I face a problem in connecting to a remote Oracle
database ( on a different machine)
thru DBD::Oracle from my machine.
I use perl 5.004 ,DBI 1.15 , DBD 1.06 , Oracle 7.16(local client ) and Oracle7 Server
Release 7.3.4.5.0 (remote Oracle server )
My machine is a B2000 HPUX Box.And iam pretty sure that the remote database is also
on a HPUX box.
Since i dont need a local database in my node , i installed only the Oracle client
(sqlplus,sqlnet v2) in my node.
Here's the list of Oracle components installed locally on my machine:
==============================
Sqlplus 3.1.3.7.1
Sqlnet V2 2.1.6.1.0
Sqlnet TCP(V1) 1.2.7.8.1
Oracle network manager 2.1.6.0.0
TCP-IP Protocol adaptor V2 2.1.6.1.0
Pro*C 2.0.6.0.0
PL/SQL V2 2.1.6.2.0
==============================
Here's my piece of code:
================================
#!/usr/bin/perl -w
use DBI;
$ENV{'ORACLE_SID'}='IRDO';
$ENV{'ORACLE_HOME'}='/home/oracle/7.1.6';
print ("check 1\n");
$dbh = DBI->connect('dbi:Oracle:IRDO@bcarhzq0:1521', 'User' , 'Pass') || die
$DBI::errstr;
print ("check 2\n");
$dbh->disconnect;
=================================
when executed :
************************
mynode $> perl dbi_test.pl
check 1
************************
and then it just hangs and gives no error message.I have to do a <Ctrl+C> to get back
my prompt.
I have attatched oracle installation log (oracle_install.log) , DBI installation log (
DBI_install.log) and
DBD installation log (DBD_install.log) with this mail.
However DBD 'make test' failed ,may be because of the absence of a local database.
I've also created a tnsnames.ora file in $ORACLE_HOME/network/admin and here's the
file contents:
==================================
IRDO =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS =
(COMMUNITY = oraottawa.world)
(PROTOCOL = TCP)
(Host = bcarhzq0)
(Port = 1521)
)
)
(CONNECT_DATA =
(SID = IRDO)
(GLOBAL_NAME = irdo.world)
)
)
===================================
However, I can use sqlplus to connect to the remote database from
my node and execute SQL statements ?
Can you please suggest me what can be done to test my environment extensively ?
I would really appreciate if u could help me in this regard.
Glossary :
=======
Here's the Perl -V 's output from my machine:
------------------------------------------------------
Summary of my perl5 (5.0 patchlevel 4 subversion 0) configuration:
Platform:
osname=hpux, osvers=10, archname=s700
uname='hp-ux nrtphcd9 b.10.20 e 9000831 2000300077 8-user license '
hint=recommended, useposix=true, d_sigaction=define
bincompat3=n useperlio= d_sfio=
Compiler:
cc='cc', optimize='-O', gccversion=
cppflags='-D_HPUX_SOURCE -Aa'
ccflags ='-D_HPUX_SOURCE -Aa'
stdchar='unsigned char', d_stdstdio=define, usevfork=false
voidflags=15, castflags=0, d_casti32=define, d_castneg=define
intsize=4, alignbytes=8, usemymalloc=y, randbits=15
Linker and Libraries:
ld='ld', ldflags =''
libpth=/lib/pa1.1 /lib /usr/lib /usr/ccs/lib
libs=-lnet -lnsl_s -lndbm -ldld -lm -lc -lndir -lcrypt
libc=/lib/libc.sl, so=sl
useshrplib=false, libperl=libperl.a
Dynamic Linking:
dlsrc=dl_hpux.xs, dlext=sl, d_dlsymun=, ccdlflags='-Wl,-E -Wl,-B,deferred '
cccdlflags='+z', lddlflags='-b'
Characteristics of this binary (from libperl):
Built under hpux
Compiled at Oct 3 1997 10:20:34
@INC:
/opt/corp/local/perl-5.004/lib/s700/5.004
/opt/corp/local/perl-5.004/lib
/opt/corp/local/perl-5.004/lib/site_perl/s700
/opt/corp/local/perl-5.004/lib/site_perl
.-------------------------------------------------
Thanx & Regards,
S Bala
3500 Carling Ave, Ottawa ON, K2H8E9
ESN: 6-398-0247
-----------------------------------------------
FREE! The World's Best Email Address @email.com
Reserve your name now at http://www.email.com
DBI_install.log
DBD_install.log
oracle_install.log