===========Oracle Database Gateways=======
To access non Oracle DB systems we need to use Oracle Heterogeneous Services.Oracle Database Gateways Provide Heterogeneous data access.
Oracle Database Gateways provide the ability to transparently access data residing
in a non Oracle systems from an Oracle Environment
Steps 1: Download and install Oracle database gateway.
Oracle Database 19c Download for Microsoft Windows x64 (64-bit)
Step 2: Create new Listener_ODBC installed softwareCreate ODBC data source.
---name mytestodbc
Configure initdg4odbc.ora file in oracle gateway home.
---gateway home : C:\app\tg\Ekramul\product\19.0.0\tghome_1\hs\admin
copy initdg4odbc.ora and past with a new name
HS_FDS_CONNECT_INFO = mytestodbc
HS_FDS_TRACE_LEVEL = OFF
Configure listener.ora in oracle gateway home.
---add below lines
SID_LIST_LISTENER_ODBC =
(SID_LIST =
(SID_DESC =
(SID_NAME = mytestodbc)
(ORACLE_HOME = C:\app\tg\Ekramul\product\19.0.0\tghome_1)
(PROGRAM = dg4odbc)
)
)
---oracle 19c database tns file
---add below lines
mytestodbc =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = DESKTOP-53PA6MR)(PORT = 1525))
(CONNECT_DATA =(SID=mytestodbc))
(HS=OK)
)
now restart services
lsnrctl reload or from services
now check from cmd by tnsping
My 19c database tns name is : orcl
My 19c gateway database tns name is : mytestodbc
tnsping mytestodbc
export environment
set oracle_home=E:\app\19c
set oracle_sid=orcl
Step 3: Create a database link to connect with the MSSQL server ODBC source
sqlplus / as sysdba
create database link mylink01 connect to "sa" identified by "sa" using 'mytestodbc';
select * from test_tbl@mylink01;