Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

4/19/2021 Document 1086365.

PowerView is Off Last Login: April 19, 2021 11:11 AM UZT Khizar (Available) (0) Contact Us Help

Dashboard Knowledge Service Requests Patches & Updates Community


Patches & Updates >
Give Feedback...

Copyright (c) 2021, Oracle. All rights reserved. Oracle Confidential.

How to Configure DG4MSQL (Database Gateway for MS SQL Server) on a 64bit Windows post install (Doc ID To Bottom
1086365.1)

Was this document helpful?


APPLIES TO:
Yes
Oracle Database Gateway for SQL Server - Version 11.2.0.1 and later No
Microsoft Windows x64 (64-bit)
Checked for relevance on 09-Mar-2014
Document Details

GOAL
Type:
HOWTO
Status:
Starting with 11.2 Oracle now offers a Database Gateway for MS SQL Server (DG4MSQL) for Windows 64bit operating systems. PUBLISHED
Last Major
This gateway is certified with Oracle release 10.2.0.3 after applying a gateway compatibility patch bug 5965763 to the Oracle Sep 29, 2017
Update:
database. The gateway is directly supported with 10.2.0.4, 10.2.0.5 and 11.1 and 11.2 Oracle database releases. Mar 13, 2021
Last Update:

The 12c gateway is certified with Oracle Databases 11.1 and above.
Related Products
Refer to the product certification matrix at www.oracle.com/technetwork/database/gateways/certmatrix-168347.pdf for complete
certification information. Oracle Database Gateway for
SQL Server

SOLUTION
Information Centers

Information Center: Overview


How to Setup DG4MSQL (Oracle Database Gateway for MS SQL Server) on Windows x86 64bit of Oracle Database Gateways
11.1 and Later [1350118.2]
The Oracle Database Gateway for MS SQL Server for Windows x86 64bit platforms comes on a separate CD. It can be installed
into an existing 11.2 database Oracle_Home (please pay attention: if the Oracle_Home contains an already patched release of
the database, you MUST apply this patchset again. The reason for eapplying the patchset is the gateway installation might Document References
overwrite already patched libraries with the base version as delivered on the CD. To get a proper environment again, the already
Master Note for Oracle
applied patchset needs to be reapplied). Gateway Products [1083703.1]

Please do NOT install DG4MSQL into a database ORACLE_HOME that is not the same, exact version. This will corrupt your
existing Oracle database installation!
Recently Viewed
Gateway products are available for download from Oracle Technology Network - OTN -
Master Note for Oracle
http://www.oracle.com/technology/software/products/database/index.html or Oracle Software Delivery Cloud - Gateway Products
http://edelivery.oracle.com/ [1083703.1]
How to Configure DG4ODBC
on 64bit Unix OS (Linux,
After the installation the following items must be configured: Solaris, AIX, HP-UX Itanium)
to Connect to Non-Oracle
Databases Post Install
1) listener
[561033.1]
2) tnsnames
E-Business Suite Concurrent
3) init<SID>.ora of the hs subsystem Processing Analyzer ( CP
4) environment Analyzer ) [VIDEO]
5) Oracle database [1411723.1]
R12 E-Business Suite
1. The listener needs a new SID entry like: Concurrent Processing Script
Cpadmin.sh Command Line
Utility Which Consolidates
Existing CP Tools Into A
(SID_NAME=dg4msql) Single Menu-Based Shell
Script [2319585.1]
(ORACLE_HOME=d:\oracle\oracle\product\11.2)
R12 E-Business Suite
(PROGRAM=dg4msql)
Concurrent Processing
Command Line Utility
Cpadmin.sh Fails With Error
''Unable To Find .dbc File''
After Application Of
Please correct the ORACLE_HOME entry according to your installation. Concurrent Processing RUP2
Patch 19287293
[2251781.1]
So a listener.ora file with a listener listening on port 1511 might look like:
Show More

SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME=dg4msql)
(ORACLE_HOME=d:\oracle\oracle\product\11.2)

https://support.oracle.com/epmos/faces/DocumentDisplay?_afrLoop=95001675591353&parent=EXTERNAL_SEARCH&sourceId=HOWTO&id=10863… 1/4
4/19/2021 Document 1086365.1
(PROGRAM=dg4msql)
)
)

LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = <hostname of the Oracle Gateway Server>) (PORT =
1511))
)
)
)

The listener must be stopped and started after changing the listener.ora file!

1. The tnsnames.ora needs an entry for the DG4MSQL alias:

dg4msql.de.oracle.com =
(DESCRIPTION=
(ADDRESS=(PROTOCOL=tcp)(HOST=<hostname of the Oracle Gateway Server>)(PORT=1511))
(CONNECT_DATA=(SID=dg4msql))
(HS=OK)
)

The domain of the tns alias can differ from the one used above (de.oracle.com) depending on the parameter in the
sqlnet.ora:

NAMES.DEFAULT_DOMAIN = de.oracle.com

But the important entry is the (HS=OK) key word. (HS=) is also a valid entry, but DBCA and NetCA will only recognize
(HS=OK) entries and remove any (HS=) entries.
The tnsnames.ora file must reside in the ORACLE_HOME where the Oracle database software is installed and not in the
gateway ORACLE_HOME.

After adding the tnsnames alias and restarting the listener, a connectivity check is tnsping <alias>. In this particular case:

tnsping dg4msql

should come back with a successful message.


2. init.ora of the gateway:
There are some restrictions how to name the SID (described in the Net Administrators Guide in detail).
At this place only a short note: don't use dots in the SID and keep it short!

The SID is also relevant for the initialization file of the gateway. The name of the file is init<SID>.ora. In this example it
is called initdg4msql.ora.
The file is located at $ORACLE_HOME/dg4msql/admin.
It should contain at least the connect details:

#
HS_FDS_CONNECT_INFO=<SQL Server>:<port>//<database>
# alternate connect format is hostname/serverinstance/databasename

Short explanation of the parameter HS_FDS_CONNECT_INFO:


It can be configured to use a SQL Server port# or to work with instances:
HS_FDS_CONNECT_INFO=<SQL Server>:<port>//<database>
HS_FDS_CONNECT_INFO=<SQL Server>/<instance>/<database>

<SQL Server> is the hostname where the SQL Server resides


<port> is the port number of the SQL Server (default is 1433)
<instance> is the name of a dedicated instance to which you want to connect; leave it blank if your SQL Server setup
does not use SQL Server instances (when using a named instance, please make sure the "SQL Browser Service" is started
on the Microsoft SQL Server machine)
<database> is the name of the database DG4MSQL should connect to; for example Northwind

Example:

https://support.oracle.com/epmos/faces/DocumentDisplay?_afrLoop=95001675591353&parent=EXTERNAL_SEARCH&sourceId=HOWTO&id=10863… 2/4
4/19/2021 Document 1086365.1
To connect to a Northwind database on a SQL Server (hostname: w2k3) with an IP Address using the default instance
you can use:

HS_FDS_CONNECT_INFO=<SQL_Server_HOSTNAME>:1433//Northwind

or

HS_FDS_CONNECT_INFO=<SQL_Server_IP>:1433//Northwind

To connect to a SQL Server 2k5 named instance msql2k5 on this machine listening on port 4025 either use:

HS_FDS_CONNECT_INFO=<SQL_Server_HOSTNAME>:4025//Northwind
or
HS_FDS_CONNECT_INFO=<SQL_Server_IP>:4025//Northwind
or
HS_FDS_CONNECT_INFO=<SQL_Server_HOSTNAME>/MSQL2k5/Northwind
or
HS_FDS_CONNECT_INFO=<SQL_Server_IP>/MSQL2k5/Northwind

SIDE NOTE:
To find the name of a SQL server instance, check out the registry key on the SQL Server:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\Instance Names
When using HS_FDS_CONNECT_INFO=<SQL Server>/<instance>/<database> and connections of the gateway fail
although using port and host connections are working, then make sure on the SQL Server machine the "SQL Server
Browser" service which provides SQL Server connection information to client computers is started.
When connections using the named instance connect method continue to fail (even with the "SQL Browser Service" being
started option of using the port number is a suitable workaround.
You can find the port number by accessing SQL Server's Server Network Utility program, choosing the instance you want
to connect to, highlighting tcp/ip under Enabled Protocols, and by clicking the Properties button. A window should open
with the port number the instance is listening on.

In addition please make sure to use a colon to separate the hostname and the port number; else the error
ORA-28510: heterogeneous database link initialization failed
ORA-28508: invalid value <SQL_Server_HOSTNAME>:1433//Northwind for Heterogeneous Services
initialization parameter HS_FDS_CONNECT_INFO
ORA-02063: preceding 2 lines from DG4MSQL
is raised in certain releases.
3. Configuring the Oracle database
The only thing that must be done here is to create a database link:
connect with the username/password that has sufficient rights to create a
database link (i.e. system).
The syntax is:

create [public] database link <name>


connect to <LOGIN> identified by <PASSWORD> using '<tnsalias>';

In other words, to connect to the MS SQL Server configured in the last steps, the syntax must be:

CREATE DATABASE LINK sqlserver


CONNECT TO "<SQL_Server_LOGIN>" IDENTIFIED BY "<SQL_Server_PASSWORD>" USING 'dg4msql';

The db link name is sqlserver. Username and password must be in double quotes, because the username and password
are case sensitive in SQL Server. 'dg4msql' points to the alias in the tnsnames.ora file that calls the HS subsystem.
The tnsnames.ora file must reside in the ORACLE_HOME where the Oracle database software is installed and not in the
gateway ORACLE_HOME.

If everything is configured well, a select of a SQL Server table should be successful:

select * from "systables"@sqlserver;


...

Side note: The systables table name at the MS SQL Server is in small letters. As the MS SQL Server is case sensitive this
table name must be surrounded by double quotes. "@sqlserver" points to the name of the database link to the MS SQL
Server.

REFERENCES

NOTE:1083703.1 - Master Note for Oracle Gateway Products

https://support.oracle.com/epmos/faces/DocumentDisplay?_afrLoop=95001675591353&parent=EXTERNAL_SEARCH&sourceId=HOWTO&id=10863… 3/4
4/19/2021 Document 1086365.1
Didn't find what you are looking for? Ask in Community...

Related
Products

Oracle Database Products > Oracle Database Suite > Gateways > Oracle Database Gateway for SQL Server

Keywords
64BIT; CONFIGURE; DG4MSQL; GATEWAY; HS_FDS_CONNECT_INFO; SQL SERVER; SQLSERVER; WINDOWS
Errors
ORA-2063; ORA-28508; ORA-28510; SQL2

Back to Top
Copyright (c) 2021, Oracle. All rights reserved. Legal Notices and Terms of Use Privacy Statement

https://support.oracle.com/epmos/faces/DocumentDisplay?_afrLoop=95001675591353&parent=EXTERNAL_SEARCH&sourceId=HOWTO&id=10863… 4/4

You might also like