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!

Creating link between oracle and postgres databases

user8867416Feb 7 2019 — edited Mar 21 2019

The postgresql-odbc-09.03.0100-2.el7.x86_64.rpm is installled on oracle 11.2 and when I am trying to ping postgres server i am getting this error

tnsping 10.147.1.41:5433

TNS Ping Utility for Linux: Version 11.2.0.4.0 - Production on 07-FEB-2019 15:13:24

Copyright (c) 1997, 2013, Oracle.  All rights reserved.

Used parameter files:

/u01/app/oracle/product/11.2.0.4/db_1/network/admin/sqlnet.ora

Used HOSTNAME adapter to resolve the alias

Attempting to contact (DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=))(ADDRESS=(PROTOCOL=TCP)(HOST=10.147.1.41)(PORT=5433)))

TNS-12547: TNS:lost contact

I prepared the server by making below entries in oracle database side

1) odbc.ini

[PG]

Description = PG

Driver = /usr/lib64/psqlodbc.so

ServerName = 10.147.1.41

Username = postgres

Password = xxxxx

Port = 5433

Database = AmPosgress

[Default]

Driver = /usr/lib64/liboplodbcS.so

2) initPG.ora

# This is a sample agent init file that contains the HS parameters that are

# needed for the Database Gateway for ODBC

#

# HS init parameters

#

HS_FDS_CONNECT_INFO = PG

HS_FDS_TRACE_LEVEL = 0

HS_FDS_SHAREABLE_NAME = /usr/lib64/psqlodbc.so

HS_LANGUAGE = AMERICAN_AMERICA.WE8ISO8859P9

HS_FDS_TRACE_FILE_NAME = /u01/app/oracle/product/11.2.0.4/db_1/hs/log/hsodbc.trc

HS_FDS_SUPPORT_STATISTICS = FALSE

#

# ODBC specific environment variables

#

set ODBCINI=/etc/odbc.ini

#

# ODBC specific environment variables

#

#

# Environment variables required for the non-Oracle system

#

#set =

3) tnasname.ora

PG =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP)(HOST = 10.147.1.41)(PORT = 1521))

(CONNECT_DATA =

(SID = AmPosgres)

)

(HS = OK)

)

4) Listener.ora

SID_LIST_LISTENER =

(SID_LIST =

   (SID_DESC=

     (SID_NAME=AmPosgres)

     (ORACLE_HOME=/u01/app/oracle/product/11.2.0.4/db_1)

     (PROGRAM=dg4odbc)

(ENV="LD_LIBRARY_PATH=/usr/lib64:/u01/app/oracle/product/11.2.0.4/db_1/lib")

   )

)

Comments
Post Details
Added on Feb 7 2019
8 comments
1,094 views