Search Postgresql Archives

DBI::Oracle problems

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I am stumped, despite working on this for a week! I am trying to create a 64-bit postgresql 8.4 database server which can retrieve data from various 64-bit Oracle 10gR2 and 11gR2 databases.

If I then immediate select from one of those tables, I get data returned, which is really excellent news ...but the good news ends shortly after that, as this demonstrates:

ims=# select "BRAND_ID" from usdata."BRAND_S";
NOTICE: �SELECT dbi_link.cache_connection( 1 ) at line 12.

�BRAND_ID�
----------
�1032
�1115
�1254
...
�2454
�2455
�2114
�2474
�2475
(290 rows)

ims=# \q
[postgres@pgx64 ~]$ psql -d ims
psql (8.4.4)
Type "help" for help.

ims=# select "BRAND_ID" from usdata."BRAND_S";
NOTICE: �Setting bail in %_SHARED hash. at line 25.

CONTEXT: �SQL statement "SELECT dbi_link.dbi_link_init()"
NOTICE: �Setting quote_literal in %_SHARED hash. at line 25.

CONTEXT: �SQL statement "SELECT dbi_link.dbi_link_init()"
NOTICE: �Setting get_connection_info in %_SHARED hash. at line 25.

CONTEXT: �SQL statement "SELECT dbi_link.dbi_link_init()"
NOTICE: �Setting quote_ident in %_SHARED hash. at line 25.

CONTEXT: �SQL statement "SELECT dbi_link.dbi_link_init()"
NOTICE: �Setting get_dbh in %_SHARED hash. at line 25.

CONTEXT: �SQL statement "SELECT dbi_link.dbi_link_init()"
NOTICE: �Setting remote_exec_dbh in %_SHARED hash. at line 25.

CONTEXT: �SQL statement "SELECT dbi_link.dbi_link_init()"
NOTICE: �SELECT dbi_link.cache_connection( 1 ) at line 12.

NOTICE: �In cache_connection, there's no shared dbh 1 at line 7.

CONTEXT: �SQL statement "SELECT dbi_link.cache_connection( 1 )"
NOTICE: �Entering get_connection_info at line 44.

CONTEXT: �SQL statement "SELECT dbi_link.cache_connection( 1 )"
NOTICE: �ref($args) is HASH
---
data_source_id: 1

CONTEXT: �SQL statement "SELECT dbi_link.cache_connection( 1 )"
NOTICE: �Leaving get_connection_info at line 75.

CONTEXT: �SQL statement "SELECT dbi_link.cache_connection( 1 )"
NOTICE: �---
auth: password
data_source: dbi:Oracle:database=usdata;sid=usdata;host=192.168.0.60
dbh_attributes: |
��---
��AutoCommit: 1
��RaiseError: 1
local_schema: usdata
remote_catalog: ~
remote_schema: ~
user_name: remoteuser

CONTEXT: �SQL statement "SELECT dbi_link.cache_connection( 1 )"
NOTICE: �In get_dbh, input connection info is
---
auth: password
data_source: dbi:Oracle:database=usdata;sid=usdata;host=192.168.0.60
dbh_attributes: |
��---
��AutoCommit: 1
��RaiseError: 1
local_schema: usdata
remote_catalog: ~
remote_schema: ~
user_name: remoteuser

CONTEXT: �SQL statement "SELECT dbi_link.cache_connection( 1 )"
ERROR: �error from Perl function "remote_select": error from Perl function "cache_connection": DBI connect('database=usdata;sid=usdata;host=192.168.0.60','remoteuser',...) failed: ERROR OCIEnvNlsCreate. Check ORACLE_HOME (Linux) env var �or PATH (Windows) and or NLS settings, permissions, etc. at line 137 at line 13.
ims=#�

In my many, many tests, I have read a lot of posts on Google and elsewhere about the need to set ORACLE_HOME, LD_LIBRARY_PATH and so on to avoid these problems... but what I don't get is that the only difference between my two selects is that I quit out of psql! If the environment variables were wrong second time round, why were they OK the first time?!

For the record, here's the contents of my /etc/profile:

ORACLE_BASE=/u01/app/oracle�
ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1�
ORACLE_SID=usdata�
export ORACLE_BASE ORACLE_HOME ORACLE_SID�
export ORA_NLS10=/u01/app/oracle/product/11.2.0/db_1/nls/data�
export TWO_TASK=usdata�
export ORA_USERID=remoteuser/password�
export NLS_LANG=AMERICAN_AMERICA.WE8ISO8859P1�
PATH=$ORACLE_HOME/bin:$PATH:.�
export PATH�
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib64:/lib:/usr/lib64:/usr/lib�
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib�
export LD_LIBRARY_PATH CLASSPATH�
export DISTRIB_RELEASE=5

Root, the oracle user and the postgres user can all do sqlplus remoteuser/password@usdata without drama. So could the postgres database the first time!

Can anyone explain what I'm doing wrong, please?�

Thanks & Regards
HJR


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux