Today, we received a new service request that our customer wants to connect from Oracle to Azure SQL Managed Instance or Azure SQL Database using Oracle Database Gateway for ODBC using a Windows Operating system.
Following, I would like to share with you the steps that we've done:
1) Oracle Database Gateway for ODBC
SID_LIST_LISTENER_ODBC =
(SID_LIST =
(SID_DESC=
(SID_NAME=dg4odbc)
(ORACLE_HOME=C:\app\tg\username\product\19.0.0\tghome_2)
(PROGRAM=dg4odbc)
)
)
# listener.ora Network Configuration File: C:\app\tg\username\product\19.0.0\tghome_2\NETWORK\ADMIN\listener.ora
# Generated by Oracle configuration tools.
LISTENER_ODBC =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1528))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1528))
)
)
SID_LIST_LISTENER_ODBC =
(SID_LIST =
(SID_DESC=
(SID_NAME=dg4odbc)
(ORACLE_HOME=C:\app\tg\username\product\19.0.0\tghome_2)
(PROGRAM=dg4odbc)
)
)
2) I modified the tnsnames.ora adding the following text:
dg4odbc =
(DESCRIPTION=
(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1528))
(CONNECT_DATA=(SID=dg4odbc))
(HS=OK)
)
3) I re-started the listener.
4) I modified the file placed on <oracle_home_folder>\admin subfolder on your Oracle Home Installation with the following parameters:
# 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 = dg4odbc
HS_FDS_TRACE_LEVEL = OFF
#
# Environment variables required for the non-Oracle system
#
#set <envvar>=<value>
5) The parameter of the previous file HS_FDS_CONNECT_INFO contains the name of the Data Source Name that we are going to use to connect. So, in this situation, using ODBC Data Source Administrator (64-Bit) I defined the following data source parameters:
create database link my4 connect to "myuserName" identified by "MyPassword!" using 'dg4odbc';
select * from customers@my4;
As I mentioned before this configuration process works, also, connecting to Azure SQL Database.
Enjoy!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.