Oracle Database transparent gateway setup


Oracle Database transparent gateway setup

Below are the steps to configure Oracle DB transparent gateway

oratab entry

[oracle@oralsrv admin]$ cat /etc/oratab|grep tgw
tgw:/u00/app/oracle/product/12201/tghome:N
[oracle@oralsrv admin]$

Template

pwd=/u00/app/oracle/product/12201/tghome
[oracle@oralsrv tghome]$ cat ./inventory/Templates/tg4db2/admin/inittg4db2.ora
# This is a customized agent init file that contains the HS parameters
# that are needed for the Database Gateway for DB2

#
# HS init parameters
#
HS_FDS_CONNECT_INFO=[%s_hostname%]:%s_portnumber%/%s_dbname%,%s_dbtype%
HS_FDS_TRACE_LEVEL=OFF
HS_FDS_RECOVERY_ACCOUNT=RECOVER
HS_FDS_RECOVERY_PWD=RECOVER
HS_TRANSACTION_MODEL=COMMIT_CONFIRM
HS_FDS_TRANSACTION_ISOLATION=READ_COMMITTED
HS_FDS_SUPPORT_STATISTICS=TRUE
HS_FDS_RESULTSET_SUPPORT=FALSE
HS_FDS_PACKAGE_COLLID=ORACLEGTW
HS_IDLE_TIMEOUT=0
[oracle@oralsrv tghome]$

inittg4db2.ora

/u00/app/oracle/product/12201/tghome/tg4db2/admin/inittg4db2.ora

pwd=/u00/app/oracle/product/12201/tghome
[oracle@oralsrv tghome]$ cat ./tg4db2/admin/inittg4db2.ora
# This is a customized agent init file that contains the HS parameters
# that are needed for the Database Gateway for DB2

#
# HS init parameters
#
HS_FDS_CONNECT_INFO=[APP.ajara.com]:667/D103,XYZ
HS_FDS_TRACE_LEVEL=OFF
HS_FDS_RECOVERY_ACCOUNT=RACC
HS_FDS_RECOVERY_PWD=ABCD123
HS_TRANSACTION_MODEL=COMMIT_CONFIRM
HS_FDS_TRANSACTION_ISOLATION=READ_COMMITTED
HS_FDS_SUPPORT_STATISTICS=TRUE
HS_FDS_RESULTSET_SUPPORT=FALSE
HS_IDLE_TIMEOUT=0
HS_OPEN_CURSORS=200
HS_FDS_PACKAGE_COLLID=NULLID
[oracle@oralsrv tghome]$

 

tnsnames.ora

[oracle@oralsrv admin]$ cat tnsnames.ora.sample
# This is a sample tnsnames.ora that contains the NET8 parameters that are
# needed to connect to an HS Agent

tg4db2 =
(DESCRIPTION=
(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521))
(CONNECT_DATA=(SID=tg4db2))
(HS=OK)
)
[oracle@oralsrv admin]$

[oracle@oralsrv tghome]$ pwd
/u00/app/oracle/product/12201/tghome
[oracle@oralsrv tghome]$ cat ./network/admin/tnsnames.ora
# This is a sample tnsnames.ora that contains the NET8 parameters that are
# needed to connect to an HS Agent

tg4db2 =
(DESCRIPTION=
(ADDRESS=(PROTOCOL=tcp)(HOST=oralsrv.ajara.tech)(PORT=1857))
(CONNECT_DATA=(SID=tg4db2))
(HS=OK)
)
[oracle@oralsrv tghome]$

Listener name:

[oracle@oralsrv admin]$ ps -ef|grep tns|grep LISTENER_tg4db2
oracle 87081 1 0 14:36 ? 00:00:00 /u00/app/oracle/product/12201/tghome/bin/tnslsnr LISTENER_tg4db2 -inherit
[oracle@oralsrv admin]$

[oracle@oralsrv admin]$ cat listener.ora
# This is a sample listener.ora that contains the NET8 parameters that are
# needed to connect to an HS Agent

LISTENER_tg4db2 =
(ADDRESS_LIST=
(ADDRESS=(PROTOCOL=tcp)(HOST=oralsrv.ajara.tech)(PORT=1857))
)

SID_LIST_LISTENER_tg4db2=
(SID_LIST=
(SID_DESC=
(SID_NAME=tg4db2)
(ORACLE_HOME=/u00/app/oracle/product/12201/tghome)
(PROGRAM=tg4db2)
)
)

#CONNECT_TIMEOUT_LISTENER = 0
[oracle@oralsrv admin]$

sqlnet.ora

[oracle@oralsrv admin]$ cat sqlnet.ora
# sqlnet.ora Network Configuration File: /u00/app/oracle/product/12201/tghome/network/admin/sqlnet.ora
# Generated by Oracle configuration tools.

NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)

[oracle@oralsrv admin]$

 

Listener status

[oracle@oralsrv admin]$ lsnrctl status LISTENER_tg4db2

LSNRCTL for Linux: Version 12.2.0.1.0 – Production on 06-APR-2023 14:39:57

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=oralsrv.ajara.tech)(PORT=1857))
STATUS of the LISTENER
————————
Alias LISTENER_tg4db2
Version TNSLSNR for Linux: Version 12.2.0.1.0 – Production
Start Date 06-APR-2023 14:36:03
Uptime 0 days 0 hr. 3 min. 53 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u00/app/oracle/product/12201/tghome/network/admin/listener.ora
Listener Log File /u00/app/oracle/diag/tnslsnr/oralsrv/listener_tg4db2/alert/log.xml
Listening Endpoints Summary…
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oralsrv.ajara.tech)(PORT=1857)))
Services Summary…
Service “tg4db2” has 1 instance(s).
Instance “tg4db2”, status UNKNOWN, has 1 handler(s) for this service…
The command completed successfully
[oracle@oralsrv admin]$

 

See Also: