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!

Oracle Heterogeneous Services unixODBC DG4ODBC

2768118Oct 6 2014 — edited Oct 7 2014

Morning

I have a challenge please assist if you have experienced and resolved it.I am trying to connect SQL server to Oracle Using

1.UnixODBC

2.Microsoft ODBC Driver 11 for SQL Server 11.0.2270.0

3.DBversion:11.2.0.3.0

4.LSN:11.2.0.3.0

5.[oracle@xxxxx]:/oracle> odbcinst -q -d

     [ODBC Driver 11 for SQL Server]

6.[oracle@xxx]:/oracle> odbcinst -q -s

     [SQLEXPRESS]

7.[oracle@xxxx]:/oracle> odbcinst -j

     unixODBC 2.3.0

     DRIVERS............: /etc/odbcinst.ini

     SYSTEM DATA SOURCES: /etc/odbc.ini

     FILE DATA SOURCES..: /etc/ODBCDataSources

     USER DATA SOURCES..: /etc/odbc.ini

     SQLULEN Size.......: 8

     SQLLEN Size........: 8

     SQLSETPOSIROW Size.: 8

8.[oracle@xxxx]:/oracle> cat /etc/odbcinst.ini

     [ODBC Driver 11 for SQL Server]

     Description=Microsoft ODBC Driver 11 for SQL Server

     Driver=/opt/microsoft/msodbcsql/lib64/libmsodbcsql-11.0.so.2270.0

     Threading=1

     UsageCount=1

9.[oracle@xxxx]:/oracle> cat /etc/odbc.ini

     [SQLEXPRESS]

     Driver=/opt/microsoft/msodbcsql/lib64/libmsodbcsql-11.0.so.2270.0

     Server=10.201.239.39,1433

     Database=ARsystem

     User=nmcmonitor

     Password=M@puto4321

     Threading=1

     UsageCount=1

10.[oracle@xxxxx]:/etc/ODBCDataSources> isql -v SQLEXPRESS xxxxx xxxxxxxx

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

| Connected!                            |

|                                       |

| sql-statement                         |

| help [tablename]                      |

| quit                                  |

|                                       |

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

11.[oracle@xxxxx]:/oracle/app/product/11.2.0.3/hs/admin> ls

     extproc.ora  initdg4odbc.ora  inithsmssql.ora.sample  listener.ora.sample  tnsnames.ora.sample

12.[oracle@xxxxxx]:/oracle/app/product/11.2.0.3/hs/admin> cat initdg4odbc.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 = SQLEXPRESS

#<odbc data_source_name>

HS_FDS_TRACE_LEVEL = off

#<trace_level>

HS_FDS_SHAREABLE_NAME = /usr/lib64/libodbc.so

#<full path name of odbc driver manager or driver>

HS_FDS_FETCH_ROWS = 1

HS_DB_NAME = ARsystem

HS_FDS_SUPPORT_STATISTICS = FALSE

#

# ODBC specific environment variables

#

set ODBCINI=/etc/odbc.ini

#<full path name of the odbc initilization file>

#

# Environment variables required for the non-Oracle system

#

#set <envvar>=<value>

===================================================================================================

[oracle@xxxx]:/oracle/app/product/11.2.0.3/network/admin> ls

listener.ora  samples  shrept.lst  tnsnames.ora

[oracle@xxxxx]:/oracle/app/product/11.2.0.3/network/admin> cat listener.ora

# listener.ora Network Configuration File: /oracle/app/product/11.2.0.3/dbhome_1/network/admin/listener.ora

# Generated by Oracle configuration tools.

LISTENER =

  (DESCRIPTION_LIST =

        (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = optimadb)(PORT = 1521)) )

  )

ADR_BASE_LISTENER = /oracle/app

SID_LIST_LISTENER =

  (SID_LIST =

     ( SID_DESC =

        (SID_NAME=DG4ODBC)

        (ORACLE_HOME = /oracle/app/product/11.2.0/dbhome_1)

        (PROGRAM =/oracle/app/product/11.2.0/dbhome_1/bin/dg4odbc)

         (ENVS=LD_LIBRARY_PATH=/usr/lib64:/usr/local/lib:/oracle/app/product/11.2.0/dbhome_1/lib/)

     )

   )

[oracle@xxxxxx]:/oracle/app/product/11.2.0.3/network/admin> lsnrctl status

LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 06-OCT-2014 10:45:41

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=optimadb)(PORT=1521)))

STATUS of the LISTENER

------------------------

Alias                     LISTENER

Version                   TNSLSNR for Linux: Version 11.2.0.3.0 - Production

Start Date                05-OCT-2014 13:18:35

Uptime                    0 days 21 hr. 27 min. 5 sec

Trace Level               off

Security                  ON: Local OS Authentication

SNMP                      ON

Listener Parameter File   /oracle/app/product/11.2.0.3/network/admin/listener.ora

Listener Log File         /oracle/app/diag/tnslsnr/optimadb/listener/alert/log.xml

Listening Endpoints Summary...

  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=optimadb)(PORT=1521)))

Services Summary...

Service "DG4ODBC" has 1 instance(s).

  Instance "DG4ODBC", status UNKNOWN, has 1 handler(s) for this service...

Service "OPTPROD" has 1 instance(s).

  Instance "OPTPROD", status READY, has 1 handler(s) for this service...

The command completed successfully

[oracle@xxxxx]:/oracle/app/product/11.2.0.3/network/admin> tnsping DG4ODBC

TNS Ping Utility for Linux: Version 11.2.0.3.0 - Production on 06-OCT-2014 10:46:22

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

Used parameter files:

Used TNSNAMES adapter to resolve the alias

Attempting to contact (DESCRIPTION= (ADDRESS=(PROTOCOL=TCP)(HOST=10.201.239.39)(PORT=1433)) (CONNECT_DATA =(SID=DG4ODBC)) (HS=OK))

TNS-12537: TNS:connection closed

How can I solved this TNS-12537: TNS:connection closed

Thank You

This post has been answered by Mkirtley-Oracle on Oct 6 2014
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 4 2014
Added on Oct 6 2014
21 comments
7,843 views