Tibero to Mysql DBLINK搭建手册

2022-04-07 00:00:00 专区 订阅 付费 原文 放入

Windows环境
*建议tibero6 FS07以后的版本



1. 解压 %TB_HOME%\client\bin\tbJavaGW.zip



2. tbJavaGW\lib下放入mysql jdbc驱动包 , tbJavaGW下放入prunsrv.exe执行文件



3. jgw.cfg配置

# Target database
DATABASE=MYSQL

DATASOURCE_CLASS_NAME=com.mysql.jdbc.jdbc2.optional.MysqlDataSource


# Listener port
LISTENER_PORT=19093

# Initial thread pool size
INIT_POOL_SIZE=10

# Max thread pool size
MAX_POOL_SIZE=10

# Max cursor cache size per thread
MAX_CURSOR_CACHE_SIZE=100

# Gateway Encoding-"ASCII", "EUC-KR", "MSWIN949", "UTF-8", "UTF-16", "SHIFT-JIS"
ENCODING=UTF-8



4. jgw_service.bat配置

:: setting CLASSPATH
set JAVA_GATEWAY="%JGW_LIB_PATH%\tbgateway.jar"
set COMMONS_DAEMON="%JGW_LIB_PATH%\commons-daemon-1.0.6.jar"
set COMMONS_COLLECTIONS="%JGW_LIB_PATH%\commons-collections.jar"
set COMMONS_POOL="%JGW_LIB_PATH%\commons-pool.jar"
set LOG4J="%JGW_LIB_PATH%\log4j-1.2.15.jar"
set MSSQL_JDBC="%JGW_LIB_PATH%\sqljdbc.jar";"%JGW_LIB_PATH%\sqljdbc4.jar"
set SYBASE_JDBC="%JGW_LIB_PATH%\jconn3.jar"
set GREENPLUM_JDBC="%JGW_LIB_PATH%\postgresql-8.4-701.jdbc3.jar"
set MYSQL_JDBC="%JGW_LIB_PATH%\mysql-connector-java-5.1.34-bin.jar"
set JGW_CLASSPATH=%JAVA_GATEWAY%;%COMMONS_DAEMON%;%COMMONS_COLLECTIONS%;%COMMONS_POOL%;%LOG4J%;%MSSQL_JDBC%;%SYBASE_JDBC%;%GREENPLUM_JDBC%;%MYSQL_JDBC%

:: setting SERVICE values
set JGW_SRVC_NAME="TBGateway"
set JGW_SRVC_DISP_NAME="TmaxDataJavaGateway"
set JGW_SRVC_DESC="Service of JAVA Gateway for TmaxData."

:: setting PROCRUN variables
set PR_EXEC="%JGW_HOME_PATH%\prunsrv.exe"
set PR_STDOUT="%JGW_LOG_PATH%\jgw_service.out"
set PR_STDERR="%JGW_LOG_PATH%\jgw_service.err"
set PR_START_CLASS="com.tmax.tibero.gateway.main.GatewayMain"
set PR_START_METHOD="start"
set PR_START_PARAMS="CONFIG=.\jgw.cfg"
set PR_STOP_CLASS="com.tmax.tibero.gateway.main.GatewayMain"
set PR_STOP_METHOD="stop"
set PR_JVM_OPTIONS="-Dlog4j.configuration=file:jgwlog.properties"
set PR_LOG_LEVEL=ALL
set PR_LOG_PATH="%JGW_LOG_PATH%"



5. 注册gate服务

打开cmd, 执行 jgw_service.bat install



6. 启动gateway服务



7. 修改tbdsn.tbr文件后重启tibero

mysql_link_remote=(
(GATEWAY=(LISTENER=(HOST=localhost)
(PORT=19093))
(TARGET=1.2.3.4:3306:herb)
(TX_MODE=LOCAL))
)



8. 进入tbsql 创建dblink

create public database link mysql connect to 'cuiwenhao' identified by 'cuiwenhao' using 'mysql_link_remote';


————————————————
版权声明:本文为CSDN博主「TmaxChinaCloud」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/qq_18131933/article/details/110392797

相关文章