Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

access to a Postgresql from oracle

3180902Feb 19 2016 — edited Apr 18 2016

Hi,

I am trying to access a postgresql dataface with dg4odbc but I am facing some issue.

I can connect from isql and get table result but when I try to do the same from oracle, I got an issue...

Any help is welcome...

Thx

François

Connection with ISQL

isql Aquiweb

+---------------------------------------+

| Connected!                            |

|                                       |

| sql-statement                         |

| help [tablename]                      |

| quit                                  |

|                                       |

+---------------------------------------+

SQL> select count(*) from role;

+---------------------+

| count               |

+---------------------+

| 17                  |

+---------------------+

SQLRowCount returns 1

1 rows fetched

Connection from sqlplus:

SQL> select count(*) from "role"@PG_LINK;

select count(*) from "role"@PG_LINK

                            *

ERROR at line 1:

ORA-28500: connection from ORACLE to a non-Oracle system returned this message:

ORA-02063: preceding line from PG_LINK

Herer are my config files:

initPG_link.ora

HS_FDS_CONNECT_INFO = Aquiweb
HS_FDS_TRACE_LEVEL = 255

HS_FDS_SHAREABLE_NAME = /usr/lib64/unixODBC_23/libodbcpsql.so

set ODBCINI=/etc/unixODBC_23/odbc_23.ini
set ODBCINSTINI=/etc/unixODBC_23/odbcinst_23.ini

my ODBC_23.ini

[Aquiweb]

Description         = Test to Postgres

Driver              = PostgreSQL

Database            = aquiweb

Servername          = 128.1.10.50

UserName            = mecar

Password            =XXXXX

Port                = 5432

Protocol            = 9.3

ReadOnly            = No

RowVersioning       = No

ShowSystemTables    = No

ConnSettings        =

Trace = 2

TraceFile = /var/log/PostgreSQL_test_trace.log

Debug = 0

DebugFile = /var/log/PostgreSQL_test_debug.log

my odbcinst_23.ini file

[PostgreSQL]

Description=PostgreSQL driver

Driver64=/usr/lib64/unixODBC_23/libodbcpsql.so

FileUsage=1

The oracle log

Oracle Corporation --- FRIDAY FEB 19 2016 16:41:24.071

 

Heterogeneous Agent Release

11.2.0.2.0

 

 

 

Oracle Corporation --- FRIDAY FEB 19 2016 16:41:24.071

  Version 11.2.0.2.0

Entered hgogprd

HOSGIP for "HS_FDS_TRACE_LEVEL" returned "255"

Entered hgosdip

setting HS_OPEN_CURSORS to default of 50

setting HS_FDS_RECOVERY_ACCOUNT to default of "RECOVER"

setting HS_FDS_RECOVERY_PWD to default value

setting HS_FDS_TRANSACTION_LOG to default of HS_TRANSACTION_LOG

setting HS_IDLE_TIMEOUT to default of 0

setting HS_FDS_TRANSACTION_ISOLATION to default of "READ_COMMITTED"

setting HS_NLS_NCHAR to default of "AL32UTF8"

setting HS_FDS_TIMESTAMP_MAPPING to default of "DATE"

setting HS_FDS_DATE_MAPPING to default of "DATE"

setting HS_RPC_FETCH_REBLOCKING to default of "ON"

setting HS_FDS_FETCH_ROWS to default of "100"

setting HS_FDS_RESULTSET_SUPPORT to default of "FALSE"

setting HS_FDS_RSET_RETURN_ROWCOUNT to default of "FALSE"

setting HS_FDS_PROC_IS_FUNC to default of "FALSE"

setting HS_FDS_MAP_NCHAR to default of "TRUE"

setting HS_NLS_DATE_FORMAT to default of "YYYY-MM-DD HH24:MI:SS"

setting HS_FDS_REPORT_REAL_AS_DOUBLE to default of "FALSE"

setting HS_LONG_PIECE_TRANSFER_SIZE to default of "65536"

setting HS_SQL_HANDLE_STMT_REUSE to default of "FALSE"

setting HS_FDS_QUERY_DRIVER to default of "TRUE"

setting HS_FDS_SUPPORT_STATISTICS to default of "FALSE"

Parameter HS_FDS_QUOTE_IDENTIFIER is not set

setting HS_KEEP_REMOTE_COLUMN_SIZE to default of "OFF"

setting HS_FDS_GRAPHIC_TO_MBCS to default of "FALSE"

setting HS_FDS_MBCS_TO_GRAPHIC to default of "FALSE"

Default value of 64 assumed for HS_FDS_SQLLEN_INTERPRETATION

setting HS_CALL_NAME_ISP to "gtw$:SQLTables;gtw$:SQLColumns;gtw$:SQLPrimaryKeys;gtw$:SQLForeignKeys;gtw$:SQLProcedures;gtw$:SQLStatistics;gtw$:SQLGetInfo"

setting HS_FDS_DELAYED_OPEN to default of "TRUE"

setting HS_FDS_WORKAROUNDS to default of "0"

Exiting hgosdip, rc=0

ORACLE_SID is "PG_LINK"

Product-Info:

  Port Rls/Upd:2/0 PrdStat:0

  Agent:Oracle Database Gateway for ODBC

  Facility:hsa

  Class:ODBC, ClassVsn:11.2.0.2.0_0008, Instance:PG_LINK

Exiting hgogprd, rc=0

hostmstr: 0: HOA After hoagprd

hostmstr: 0: HOA Before hoainit

Entered hgoinit

HOCXU_COMP_CSET=1

HOCXU_DRV_CSET=2

HOCXU_DRV_NCHAR=873

HOCXU_DB_CSET=2

HS_LANGUAGE not specified

LANG=en_US.UTF-8

HOCXU_SEM_VER=112000

Entered hgolofn at 2016/02/19-16:41:24

HOSGIP for "HS_FDS_SHAREABLE_NAME" returned "/usr/lib64/unixODBC_23/libodbcpsql.so"

Entered hgolofns at 2016/02/19-16:41:24

libname=/usr/lib64/unixODBC_23/libodbcpsql.so, funcname=SQLAllocHandle

peflerr=6520, libname=/usr/lib64/unixODBC_23/libodbcpsql.so, funcname=SQLAllocHandle

hoaerr:28500

Exiting hgolofns at 2016/02/19-16:41:24

Failed to load ODBC library symbol: /usr/lib64/unixODBC_23/libodbcpsql.so(SQLAllocHandle)

Exiting hgolofn, rc=28500 at 2016/02/19-16:41:24

Exiting hgoinit, rc=28500 with error ptr FILE:hgoinit.c LINE:417 FUNCTION:hgoinit() ID:Loading ODBC aray of function ptrs

hostmstr: 0: HOA After hoainit

RPC Calling nscontrol(0), rc=0

hostmstr: 0: RPC Before Exit Agent

hostmstr: 0: HOA Before hoaexit

Entered hgoexit

HS Gateway: NULL connection context at exit

Exiting hgoexit, rc=0 with error ptr FILE:hgoexit.c LINE:110 FUNCTION:hgoexit() ID:Connection context

hostmstr: 0: HOA After hoaexit

hostmstr: 0: RPC After Exit Agent

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 16 2016
Added on Feb 19 2016
34 comments
9,991 views