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!

Connect to PostgreSQL from Oracle 11gR2

PavelE.Nov 15 2011 — edited Nov 21 2011
Hi folks!

Trying to connect to PostgreSQL from Oracle 11.2.0.3(RAC). My configuration files are:

initRT.ora:
#
# HS init parameters
#
HS_FDS_CONNECT_INFO = RT
HS_FDS_TRACE_LEVEL = ON
HS_FDS_TRACE_FILE_NAME = /tmp/odbc_trace.log
HS_FDS_TRACE_LEVEL = 4
HS_FDS_SHAREABLE_NAME = /usr/lib64/libodbc.so

# ODBC specific environment variables
#
set ODBCINI=/etc/unixODBC/odbc.ini
listener.ora:
LISTENER_SCAN2=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN2))))                # line added by Agent
LISTENER=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER))))            # line added by Agent
LISTENER_SCAN1=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1))))                # line added by Agent
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN1=ON                # line added by Agent
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER=ON              # line added by Agent
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN2=ON                # line added by Agent


SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = PLSExtProc)
      (ORACLE_HOME =/u01/app/oracle/product/11.2/db)
      (PROGRAM = extproc)
    )
    (SID_DESC=
      (SID_NAME = RT)
      (ORACLE_HOME = /u01/app/oracle/product/11.2/db)
      (PROGRAM = dg4odbc)
      (ENVS = "LD_LIBRARY_PATH=/usr/lib64:/u01/app/oracle/product/11.2/db/lib:/u01/app/oracle/product/11.2/db/hs/lib")
    )
  )
tnsnames.ora:
RT = (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=hostname)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SID=RT))(HS = OK))
isql rt rt3 passw
+---------------------------------------+
| Connected!                            |
|                                       |
| sql-statement                         |
| help [tablename]                      |
| quit                                  |
|                                       |
+---------------------------------------+
SQL> quit
oracle@hostname: psql -h rt rt3 passw
Welcome to psql 8.3.9, the PostgreSQL interactive terminal.

Type:  \copyright for distribution terms
       \h for help with SQL commands
       \? for help with psql commands
       \g or terminate with semicolon to execute query
       \q to quit

rt3=>
As you can see, I can connect to PostgreSQL. Then in DB I've created DB link as follows:
 CREATE DATABASE LINK "RT"
   CONNECT TO "RT3" IDENTIFIED BY "passw"
   USING 'RT';


oracle@hostname: sqlplus rt3/passw

SQL*Plus: Release 11.2.0.3.0 Production on Tue Nov 15 03:46:12 2011

Copyright (c) 1982, 2011, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, Oracle Label Security,
Data Mining and Real Application Testing options

rt3@sid1> select * from users@rt;
select * from users@rt
                    *
ERROR at line 1:
ORA-28545: error diagnosed by Net8 when connecting to an agent
Unable to retrieve text of NETWORK/NCR message 65535
ORA-02063: preceding 2 lines from RT


Elapsed: 00:00:00.01
rt3@sid1>
Don'tunderstand why I can't connect from Oracle? Thanks in advance.

Regards,
Pavel.
This post has been answered by Kgronau-Oracle on Nov 21 2011
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 19 2011
Added on Nov 15 2011
58 comments
9,528 views