Document Type | Technical Information
Category | Interface/Integration
Applicable Product Version | Tibero 7.2.4
Document Number | TIITI047
Overview
This is not the generally recommended configuration and should be used as a reference guide for restricted environments.
Method
TtoO DBLINK Checklist
ORACLE Client Library
For Gateway for Oracle, the Oracle client library is used internally to connect to Oracle.
(You can use the library included in the Oracle server binary or the Instant Client library.)The Oracle client library must be present in the environment where the Gateway is installed.
If the Oracle client library cannot connect properly to the Oracle server, the DBLink will also not be able to connect.
This document assumes a configuration where the Oracle Client is not installed on the Tibero server, and the Oracle engine of the Oracle server acts as the Oracle Client.
Gateway for Oracle Configuration Methods
1) Local Method
If you use the DBLink without starting the Gateway in advance, the Gateway process will start when the DBLink is called.
The Local method can only be configured when the Tibero server and Gateway for Oracle are on the same server.
For this reason, the test in this document is expected to be valid only for the Listener method, and future tests will be conducted only for the Listener method.
2) Listener Method
This method operates the Gateway in a listening state by starting it in advance, and can be set up in most environments.
3) Comparison of Advantages and Disadvantages of Local and Listener Methods
| Method | Advantages | Disadvantages | Features |
|---|---|---|---|
Local |
|
|
|
Listener |
|
|
|
DBLINK Installation and Configuration
1) Set TBGW_HOME environment variable - Set TBGW_HOME in the oracle server's .bash_profile [/home/ora11/.bash_profile settings] .. ##gateway for TtoO## export TBGW_HOME=$ORACLE_HOME/gateway .. 2) Create Gateway directory - Set TBGW_HOME in the oracle server's .bash_profile psdblcbp:/sdiskc/oracle_jsb/oracle/19c> mkdir gateway psdblcbp:/sdiskc/oracle_jsb/oracle/19c> mkdir gateway/oracle psdblcbp:/sdiskc/oracle_jsb/oracle/19c> mkdir gateway/oracle/config psdblcbp:/sdiskc/oracle_jsb/oracle/19c> mkdir gateway/oracle/log $TBGW_HOME subdirectory structure โโโoracle โโโ config โโโ log 3) Add gateway binary file /sdiske/ps1/tr/sobang/tibero7/client/bin/gw4orcl 4) Grant execute permission to gateway binary file - Grant execute permission to the gateway binary file inside $TB_HOME. [Set execute permission on the gateway binary of the Oracle server] chmod u+x $TBGW_HOME/gw4orcl 5) Set tbgw.cfg - Create tbgw.cfg, the Gateway configuration file. - Specify parameter values to set values related to the gateway. cat $TBGW_HOME/oracle/config/tbgw.cfg LISTENER_PORT=9996 LOG_DIR=/sdiskc/oracle_jsb/oracle/19c/gateway/oracle/log LOG_LVL=2 MAX_LOG_SIZE=1000 MAX_LOG_CNT=5 FETCH_SIZE=32000
1) Add settings to $TB_HOME/client/config/tbdsn.tbr
- The information may differ depending on the installation environment; the author's environment settings [IP:PORT:DBNAME] are as below.
t7=(
(INSTANCE=(HOST=localhost)
(PORT=58629)
(DB_NAME=t7)
)
)
ora_lisnter=(
(GATEWAY=(LISTENER=
(HOST=192.168.1.188)
(PORT=9996))
(TARGET=oraclesb)
(TX_MODE=GLOBAL)
)
)
2) Execute Gateway binary
- After completing Gateway installation and environment settings, execute the Gateway binary.
- Check if the Gateway process has started normally.
- Logs are created based on the LOG_DIR parameter set in tbgw.cfg.
- In case of failure, you can analyze the cause based on this log directory.
[ps1@psdblcbp:/sdiske/ps1/tr/sobang/tibero7/client/config]$ ps -ef | grep gw4orcl
ps1 10878 25885 0 16:52 pts/0 00:00:00 grep --color=auto gw4orcl
oraclesb 39564 1 0 14:12 ? 00:00:00 ./gw4orcl
$ ls -al $TBGW_HOME/oracle/log
psdblcbp:/sdiskc/oracle_jsb> ls -al $TBGW_HOME/oracle/log
total 16
drwxr-xr-x. 2 oraclesb dba 174 Nov 18 14:55 .
drwxr-xr-x. 4 oraclesb dba 31 Nov 18 14:01 ..
-rw-r--r--. 1 oraclesb dba 358 Nov 18 14:28 gw4orcl_2_20251118141246_39564.log
-rw-r--r--. 1 oraclesb dba 358 Nov 18 14:43 gw4orcl_3_20251118141246_39564.log
-rw-r--r--. 1 oraclesb dba 358 Nov 18 14:53 gw4orcl_4_20251118141246_39564.log
-rw-r--r--. 1 oraclesb dba 350 Nov 18 14:55 gw4orcl_5_20251118141246_39564.log
DBLINK Creation and Usage
1) Connect to tbsql and create a DB Link Object - Connect to tbsql and create an Oracle Database Link. - You can create a DB Link object using the syntax below. (Note: To create a DB Link, you need CREATE DATABASE LINK or CREATE PUBLIC DATABASE LINK privileges.) SQL> create database link [DB LINK name ] connect to [user ID] identified by [password] using [ALIAS to connect to]; ex) SQL> create public database link oralink connect to 'tuser' identified by 'tuser' using 'ora_lisnter'; /* There is a user named tuser in Oracle Database Link ORALINK created. 2) Check and connect to DB Link - You can check whether the DBLink was created through views such as DBA_DB_LINKS, and connect to Altibase using the created DBLink. SQL> select * from dba_db_links; OWNER DB_LINK USERNAME HOST CREATED ---------- ---------- ---------- -------------------- -------------------- PUBLIC ORALINK tuser ora_lisnter 2025/11/18 1 row selected. select * from dual@oralink SQL> / DUMMY ----- X 1 row selected.
Data Query and DML TEST Using DB LINK
1) Query Oracle table from Tibero
SQL> select * from tuser.test@oralink;
COL1 COL2
---------- --------------------------------------------------------------------------------------------------------------------------------------
2 tibero
1 row selected.
2) Perform INSERT using DBLink from Tibero
SQL> insert into test@oralink values (2, 'tibero');
1 row inserted.
SQL> commit;
Commit completed.
SQL> select * from tuser.test@oralink;
COL1 COL2
---------- --------------------------------------------------------------------------------------------------------------------------------------
2 tibero
2 tibero
2 rows selected.
Necessity of Gateway Process Management
Since the Gateway is installed on the Oracle server, the Gateway process is created on the Oracle server.
After restarting the Oracle server, you must restart the Gateway process for DBLink to work properly.
Due to these operational and management issues, the DBLink creation method presented in this document is not recommended.
Necessity of Gateway Log Management
Since the Gateway is installed on the Oracle server, the Gateway logs are also recorded on the Oracle server.
If logs continue to accumulate, separate log management is required.
Due to this management burden, the DBLink creation method presented in this document is not recommended.
psdblcbp:/sdiskc/oracle_jsb/oracle/19c/gateway/oracle/log> ls -rlt total 16 -rw-r--r--. 1 oraclesb dba 358 Nov 18 14:28 gw4orcl_2_20251118141246_39564.log -rw-r--r--. 1 oraclesb dba 358 Nov 18 14:43 gw4orcl_3_20251118141246_39564.log -rw-r--r--. 1 oraclesb dba 358 Nov 18 14:53 gw4orcl_4_20251118141246_39564.log -rw-r--r--. 1 oraclesb dba 350 Nov 18 14:55 gw4orcl_5_20251118141246_39564.log