pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Robert Haas <robertmhaas@gmail.com>
To: Li Hongbing <lihongbing@intasect.com.cn>
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #5994: Can't excute DBI->connect to oracle by client site
Date: Mon, 9 May 2011 22:40:56 -0400
Message-ID: <BANLkTi=+OWgHT8xVQ2VLKtB3E5v6AdSOUQ@mail.gmail.com> (raw)
In-Reply-To: <201104260936.p3Q9aZTP029148@wwwmaster.postgresql.org>
References: <201104260936.p3Q9aZTP029148@wwwmaster.postgresql.org>

On Tue, Apr 26, 2011 at 5:36 AM, Li Hongbing <lihongbing@intasect.com.cn> wrote:
> I am trying to create a 64-bit postgresql 8.4 database server which can
> retrieve data from Oracle(10gR2) at an other server by DBI-LINK.
>
> DBI-LINK works good on postgresql server site when I connect to linux by
> telnet.When I connect to postgresql server by postgresql client just like
> pgAdmin or EMS SQL Manager,I got a error like this:
> error from Perl function "set_up_connection": DBI
> connect('host=192.168.138.173;sid=smmacs;port=1521','rmtrsys',...) failed:
> ORA-24327: need explicit attach before authenticating a user (DBD ERROR:
> OCISessionBegin) at line 43 at line 35.
>
> so I write test code to confirm DBI connect function
>
> CREATE OR REPLACE FUNCTION dbi_link.test2()
>  RETURNS char AS
> $BODY$
> use DBI;
> use DBD::Oracle;
>
>
> my $dbname = 'xxx';
> my $user = 'rmtrsys';
> my $passwd = 'rmtrsys';
>
> my $dbh =
> DBI->connect("dbi:Oracle:host=192.168.138.173;sid=smmacs;port=1521", $user,
> $passwd,{ora_charset => 'UTF8'}) or
> die "Database connection not made: $DBI::errstr";
>
> $dbh -> disconnect;
>
> return "OK";
>
> $BODY$
>  LANGUAGE 'plperlu' VOLATILE
>  COST 100;
>
>
> When I connect to linux by telnet and excute psql -d dbi_link_test to run,it
> works good
>
> dbi_link_test=# select dbi_link.test2();
>  test2
> -------
>  OK
> (1 row)
>
> But when I connect by  postgresql client (pgAdmin or EMS SQL Manager) to run
> same sql, it returned an error:
> NOTICE:  DBI
> connect('host=192.168.138.173;sid=smmacs;port=1521','rmtrsys',...) failed:
> ORA-24327: need explicit attach before authenticating a user (DBD ERROR:
> OCISessionBegin) at line 10
>
>
> ERROR:  error from Perl function "test2": Database connection not made:
> ORA-24327: need explicit attach before authenticating a user (DBD ERROR:
> OCISessionBegin) at line 10.
>
> ********** エラ�` **********
>
> ERROR: error from Perl function "test2": Database connection not made:
> ORA-24327: need explicit attach before authenticating a user (DBD ERROR:
> OCISessionBegin) at line 10.
> SQLステ�`ト:XX000
>
>
> when got this error,I can't shutdown the server normally,ths shutdown
> command will not terminate unless I cancel it.
> [postgres@localhost ~]$ pg_ctl stop -D /usr/local/pgsql/data
> waiting for server to shut down...LOG:  received smart shutdown request
> .LOG:  autovacuum launcher shutting down
> ..........................
>
> Above test let me know the DBI-LINK crushed by DBI->connect, I think the
> really reason is one of these:
> 1.postgresql create backend process has a bug,most likely with bad process
> environment var
> 2.Orace OCI functions has a bug
> 3.DBD:Oracle has a bug
>
> However,I should report this as a postgresql bug ,becourse of run same sql
> must get same result anywhere(server or client).

My guess is that, depending on how you connect, something in your
environment is different, and that is what is making the Oracle
connection succeed or fail.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



view thread (10+ messages)  latest in thread

Message-ID: <BANLkTi=+OWgHT8xVQ2VLKtB3E5v6AdSOUQ@mail.gmail.com>
Permalink:  ../BANLkTi=+OWgHT8xVQ2VLKtB3E5v6AdSOUQ@mail.gmail.com/
Also on:    postgresql.org/message-id/BANLkTi=+OWgHT8xVQ2VLKtB3E5v6AdSOUQ@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: robertmhaas@gmail.com, lihongbing@intasect.com.cn
  Subject: Re: BUG #5994: Can't excute DBI->connect to oracle by client site
  In-Reply-To: <BANLkTi=+OWgHT8xVQ2VLKtB3E5v6AdSOUQ@mail.gmail.com>
  References: <201104260936.p3Q9aZTP029148@wwwmaster.postgresql.org> <BANLkTi=+OWgHT8xVQ2VLKtB3E5v6AdSOUQ@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox