Re: Oracle-Perl Connection Problem
[email protected] (Sandeep Warikoo) Tue, 04 Jan 2005 20:20:32 +0530
| Newsgroups | perl.dbi.oracle-oci |
|---|---|
| Message-ID | <[email protected]> |
--------------010301030108060606060309
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Hi again,
I tried NLS_LANG too. But still same result.
My database settings are:
NLS_LANGUAGE=AMERICAN
NLS_TERRITORY=AMERICA
NLS_CHARACTERSET=WE8ISO8859P1
I tried:" export NLS_LANG=AMERICAN_AMERICA.WE8ISO8859P1", but still
execution of script gave me same error.
I can connect to database through sqlplus and run queries.
I'm working on HP-UX, and database is also on an HP-UX machine.
LD_LIBRARY_PATH is also correct. :-(
We have reinstalled DBI and other related packages. But that also didn't
work.
Regards,
Sandeep
Richard Foley wrote:
>There's a few things to look at:
>
>Sometimes you need NLS_LANG (etc.) and several others set too.
>
>LD_LIBRARY_PATH may be worth checking.
>
>Have you upgraded this Oracle recently?
>
>Can you connect using sqlplus?
>
>Don't give up - once it works, it'll work forever ;-)
>
>On Tuesday 04 January 2005 14:04, Sandeep Warikoo wrote:
>
>
>>Hi Richards,
>>
>>Thanks for the help.
>>I have checked all the environment variables. All are correctly set
>>including TWO_TASK, ORACLE_SID, ORACLE_HOME. Still the problem persists.
>>
>>here is my modified code:
>>------------------------------------------------------------------------
>>#!/usr/bin/perl
>>
>>use DBI;
>>
>>$ENV{TWO_TASK}="d7_bilab03";
>>$ENV{ORACLE_HOME}="/data/oracle/product/9.2.0/";
>>$ENV{ORACLE_SID}="dmc";
>>
>>$dbH = DBI->connect("dbi:Oracle:","hpbi_owner","hpbi") or die $DBI::errstr;
>>------------------------------------------------------------------------
>>
>>d7_bilab03 is net alias for my database. It works well with tnsping. And
>>I'm able to connect to database through "sqlplus
>>hpbi_owner/hpbi@d7_bilab03"
>>
>>Sandeep
>>
>>Richard Foley wrote:
>>
>>
>>>You usually need to have quite a few environment variables set before you
>>>can access Oracle, as the error message (OCIEnvInit) roughly indicates.
>>>Try reading the docs that came with the DBI (and DBD::Oracle
>>>particularly), I believe there are many examples in there.
>>>
>>>You are at least short of
>>>
>>> ORACLE_SID or TWO_TASK
>>>
>>>Ciao
>>>Richard Foley
>>>---
>>>Ciao - Shorter than Aufwiedersehen
>>>
>>>http://www.oreilly.com/catalog/perldebugpr/index.html
>>>
>>>On Tuesday 04 January 2005 09:47, Sandeep Warikoo wrote:
>>>
>>>
>>>>Hi,
>>>>
>>>>I'm trying the access oracle through perl, but am getting the error
>>>>"ERROR OCIEnvInit".
>>>>
>>>>My perl script is:
>>>>
>>>>-------------------------------------------------------------------------
>>>>use DBI;
>>>>
>>>>$ENV{ORACLE_HOME}='/data/oracle/product/9.2.0';
>>>>
>>>>my $dbh = DBI->connect("dbi:Oracle:d7_bilab03","hpbi_owner","hpbi") or
>>>>die "couldn't connect to database: $DBI::errstr\n";
>>>>
>>>>-------------------------------------------------------------------------
>>>>-
>>>>
>>>>Does anyone know how to solve this?
>>>>
>>>>Regards,
>>>>Sandeep W.
>>>>
>>>>
>
>
>
--------------010301030108060606060309--