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!

Odbc from oracle to postgesql linux

Daniil KlimovitskiyNov 28 2011 — edited Nov 28 2011
Hello.

I have enterprise linux 6, oracle SE 11.2, postgresql 8.4.

I try to set ODBC by this scenario: http://docs.oracle.com/cd/B28359_01/gateways.111/b31042/configodbc.htm

In result I have error:
$ tnsping postgresql
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = xxx)(PORT = 5432)) (CONNECT_DATA = (SID = postgresql)) (HS = OK))
TNS-12537: TNS:connection closed

When I try to connect by unixODBC, it connects:
$ isql -v postgresql
---------------------------------------
| Connected! |
| |
| sql-statement |
| help [tablename] |
| quit |
| |
---------------------------------------

Please help where I'm wrong? :(

odbc.ini_
[ODBC Data Sources]
postgresql = PostgreSQL ODBC Driver

[postgresql]
Description = Test to Postgres
Driver = PostgreSQL
Trace = Yes
TraceFile = /tmp/sql.log
Database = postgres
Servername = xxx
UserName = postgres
Password = xxx
Port = 5432
Protocol = 6.4
ReadOnly = Yes
RowVersioning = No
ShowSystemTables = No
ShowOidColumn = No
FakeOidIndex = No
DSN=postgresql

[Default]
Driver = PostgreSQL
Description = PostgreSQL Data Source
Server = xxx
Port = 5432
UserName = postgres
Password = xxx
;Socket = 4096
;end odbc.ini

odbcinst.ini_
# Example driver definitions

# Driver from the postgresql-odbc package
# Setup from the unixODBC package
[PostgreSQL]
Description = ODBC for PostgreSQL
Driver = /usr/lib/psqlodbc.so
Setup = /usr/lib/libodbcpsqlS.so
Driver64 = /usr/lib64/psqlodbc.so
Setup64 = /usr/lib64/libodbcpsqlS.so
FileUsage = 1


# Driver from the mysql-connector-odbc package
# Setup from the unixODBC package
[MySQL]
Description = ODBC for MySQL
Driver = /usr/lib/libmyodbc5.so
Setup = /usr/lib/libodbcmyS.so
Driver64 = /usr/lib64/libmyodbc5.so
Setup64 = /usr/lib64/libodbcmyS.so
FileUsage = 1

hs/admin/initpostgresql.ora_
HS_FDS_CONNECT_INFO = postgresql
HS_FDS_TRACE_LEVEL = off
HS_FDS_SHAREABLE_NAME = /usr/lib64/libodbc.so

set ODBCINI= /etc/odbc.ini

listener.ora*
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = zzz)(PORT = 1521))
)
)

ADR_BASE_LISTENER = /home/splash/oracle

SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC=
(SID_NAME=postgresql)
(PROGRAM=dg4odbc)
(ORACLE_HOME=/home/splash/oracle/product/11.2.0/dbhome_4)
(ENVS=LD_LIBRARY_PATH=/usr/lib64:/home/splash/oracle/product/11.2.0/dbhome_4/lib)
)
)

tnsnames.ora_
ORCLDOCS =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = xxx)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = orcldocs)
)
)

postgresql =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = host_with_postgres)(PORT = 5432))
(CONNECT_DATA = (SID = postgresql))
(HS = OK)
)
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 26 2011
Added on Nov 28 2011
6 comments
492 views