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!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Odbc driver issue - dblink from Oracle to PostgreSql

ActitudJun 4 2015 — edited Jun 15 2015

Hello Experts!

I tried everything (including the Answered Questions) and nothing seems to work.

  • Library Path

echo $LD_LIBRARY_PATH

/usr/lib64:/usr/lib:/u01/oracle/product/11.2.0.4/lib

  • /u01/oracle/product/11.2.0.4/hs/admin/initPG_LINK.ora

HS_FDS_CONNECT_INFO = PG_LINK

HS_FDS_TRACE_LEVEL = DEBUG

HS_FDS_SHAREABLE_NAME=/usr/lib64/libodbc.so.2.0.0                   

set ODBCINI= /u00/oracle/.odbc.ini


  • /u00/oracle/.odbc.ini

[ODBC Data Sources]

  PG_LINK = PostgreSQL

[PG_LINK]

  Debug = 1

  CommLog = 1

  ReadOnly = no

  Driver = /usr/lib64/psqlodbc.so

  Servername = pgserver_ip

  FetchBufferSize = 99

  Username = pguser

  Password = pgpwd

  Port = 5432

  Database = pg_database

[Default]

  Driver = /usr/lib64/libodbc.so.2.0.0


  • Tnsnames and listener are fine...I can reach the Oracle database with no issues.

  • Sql Query result

SQL> select * from "table"@PG_LINK;

select * from "table"@PG_LINK

                             *

ERROR at line 1:

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

[unixODBC][Driver Manager]Data source name not found, and no default driver

specified {IM002}

ORA-02063: preceding 2 lines from PG_LINK


  • Trace result

...

...

hgopoer, line 231: got native error 0 and sqlstate IM002; message follows...

[unixODBC][Driver Manager]Data source name not found, and no default driver specified {IM002}

Exiting hgopoer, rc=0 at 2015/06/04-13:53:18

hgocont, line 2831: calling SqlDriverConnect got sqlstate IM002

Exiting hgocont, rc=28500 at 2015/06/04-13:53:18 with error ptr FILE:hgocont.c LINE:2851 FUNCTION:hgocont() ID:Something other than invalid authorization

Exiting hgolgon, rc=28500 at 2015/06/04-13:53:18 with error ptr FILE:hgolgon.c LINE:806 FUNCTION:hgolgon() ID:Calling hgocont

Entered hgoexit at 2015/06/04-13:53:18

Exiting hgoexit, rc=0

Any Ideas?

I tried several libraries and none of the worked so far. Different errors for all of them (including the "SQLAllocHandle" error)

Thanks,

Alex.

This post has been answered by Actitud on Jun 5 2015
Jump to Answer

Comments

Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Jul 13 2015
Added on Jun 4 2015
13 comments
9,112 views