thanks!
i've managed (the instance name was different in tnsnames.ora)

-----Original Message-----
From: Michael A Chase [mailto:[EMAIL PROTECTED]]
Sent: Sunday, January 12, 2003 7:29 PM
To: [EMAIL PROTECTED]; Moshe Rivel
Subject: Re: can't connect to oracle


On Sun, 12 Jan 2003 18:09:33 +0200 Moshe Rivel <[EMAIL PROTECTED]> wrote:

> -----Original Message-----
> From: Moshe Rivel [mailto:[EMAIL PROTECTED]] 
> Sent: Sunday, January 12, 2003 10:47 AM
> To: 'Michael A Chase'; '[EMAIL PROTECTED]'
> Subject: RE: can't connect to oracle

> (guess i don't have to mention i'm a DBI newbie, so thanks for your
> patience)
> this is a test script (btw, 'make test' worked fine when installing
> DBD::Oracle):
> #!/usr/bin/perl -w
> use strict;
> use DBI;
> DBI->trace(4, '/tmp/trace.trc');
> my $dbs = DBI->connect ('DBI:Oracle:ora901','system','manager',)|| die
> "DB connect not made: $DBI::errstr"; $dbs->disconnect();

Try leaving out the ',' after 'manager'.  Ordinarily it wouldn't make
any difference, but connect() in DBD::Oracle plays some games with
its parameter list to accomodate an older argument syntax and a
undefined fourth parameter may confuse it.

If that doesn't help, please cut and paste your actions logging in
via SQL*Plus.  I'm guessing it's something like
'sqlplus system/manager@ora901',  but then the DBI connect should have
worked, so something less obvious may be going on.

Try running your snippet again in the same session immediately after
you successfully log in with SQL*Plus.

> the trace log doesn't reveal something to me:
>     DBI 1.32-nothread dispatch trace level set to 4
>     -> DBI->connect(DBI:Oracle:ora901, system, ****)
>     -> DBI->install_driver(Oracle) for linux perl=5.006 pid=2633
> ruid=119 euid=119
>        install_driver: DBD::Oracle version 1.12 loaded from
> /usr/lib/perl5/site_ perl/5.6.0/i386-linux/DBD/Oracle.pm
>     New DBI::dr (for DBD::Oracle::dr, parent=, id=)
>     dbih_setup_handle(DBI::dr=HASH(0x8186828)=>DBI::dr=HASH(0x81ecc48),
> DBD::Oracle::dr, 0, Null!)
>     dbih_make_com(Null!, DBD::Oracle::dr, 88) thr#(nil)
>     <- install_driver= DBI::dr=HASH(0x8186828)
>     -> connect for DBD::Oracle::dr (DBI::dr=HASH(0x8186828)~0x81ecc48
> 'ora901' 'system' **** HASH(0x81609c8))
>     New DBI::db (for DBD::Oracle::db, parent=DBI::dr=HASH(0x81ecc48),
> id=)
>     dbih_setup_handle(DBI::db=HASH(0x81ecc0c)=>DBI::db=HASH(0x8159020),
> DBD::Oracle::db, 81840a8, Null!)
>     dbih_make_com(DBI::dr=HASH(0x81ecc48), DBD::Oracle::db, 116)
> thr#(nil)
>     OCIErrorGet after OCIServerAttach (er1:ok): -1, 12154: ORA-12154:
> TNS:could not resolve service name

-- 
Mac :})
** I normally forward private questions to the appropriate mail list. **
Ask Smarter: http://www.tuxedo.org/~esr/faqs/smart-questions.html
Give a hobbit a fish and he eats fish for a day.
Give a hobbit a ring and he eats fish for an age.

Reply via email to