Oracle 透明閘道器連線MySQL
Oracle透明閘道器連線MySQL
聯結器下載:
1.配置unixODBC
/etc/odbc.ini
[mysql]
Driver =/usr/lib/libmyodbc5w.so
Server =192.168.1.50
User =mysql
Password=mysql
Port =3306
database=edmond
Charset =GBK
使用isql測試
2.配置HS
編輯$ORACLE_HOME/hs/admin/initmysql.ora
其中mysql是sid
HS_FDS_CONNECT_INFO = mysql
HS_FDS_TRACE_LEVEL = debug
HS_FDS_SHAREABLE_NAME = libodbc.so
HS_LANGUAGE=AMERICAN_AMERICA.ZHS16GBK
set ODBCINI=/etc/odbc.ini
語言這行不能缺少,否則報錯。
3.配置tns
mysql =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.50)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = mysql)
)
(HS = OK)
)
4.配置監聽器
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = mysql)
(ORACLE_HOME = /home/lihuilin/dev/app/lihuilin/product/11.2.0/dbhome_1)
(SID_NAME = mysql)
(PROGRAM = dg4odbc)
(ENVS="LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib")
)
)
LISTENER =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
(ADDRESS = (PROTOCOL = TCP)(HOST = lihuilin.home)(PORT = 1521))
)
ADR_BASE_LISTENER = /home/lihuilin/dev/app/lihuilin
5.建立db link
在MySQL建立測試表
create table t(a varchar(20) primary key) engine=innodb,charset =gbk;
insert into t values('透明');
commit;
檢視結果:
如果前臺報錯如下所示
ERROR at line 1:
ORA-28500: connection from ORACLE to a non-Oracle system returned this message:
[
$ORACLE_HOME/hs/log的後臺日誌報錯如下:
hgopoer, line 233: got native error 0 and sqlstate I; message follows...
[
Exiting hgopoer, rc=0 at 2014/03/04-21:40:18
hgocont, line 2752: calling SqlDriverConnect got sqlstate I
Exiting hgocont, rc=28500 at 2014/03/04-21:40:18 with error ptr FILE:hgocont.c LINE:2772 FUNCTION:hgocont() ID:Something other than invalid authorization
Exiting hgolgon, rc=28500 at 2014/03/04-21:40:18 with error ptr FILE:hgolgon.c LINE:781 FUNCTION:hgolgon() ID:Calling hgocont
Entered hgoexit at 2014/03/04-21:40:18
有兩個可能
1.HS_LANGUAGE沒有配置
2.HS_LANGUAGE和MySQL的字符集不匹配
參考:
http://blog.itpub.net/21601207/viewspace-709366
聯結器下載:
1.配置unixODBC
/etc/odbc.ini
[mysql]
Driver =/usr/lib/libmyodbc5w.so
Server =192.168.1.50
User =mysql
Password=mysql
Port =3306
database=edmond
Charset =GBK
使用isql測試
2.配置HS
編輯$ORACLE_HOME/hs/admin/initmysql.ora
其中mysql是sid
HS_FDS_CONNECT_INFO = mysql
HS_FDS_TRACE_LEVEL = debug
HS_FDS_SHAREABLE_NAME = libodbc.so
HS_LANGUAGE=AMERICAN_AMERICA.ZHS16GBK
set ODBCINI=/etc/odbc.ini
語言這行不能缺少,否則報錯。
3.配置tns
mysql =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.50)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = mysql)
)
(HS = OK)
)
4.配置監聽器
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = mysql)
(ORACLE_HOME = /home/lihuilin/dev/app/lihuilin/product/11.2.0/dbhome_1)
(SID_NAME = mysql)
(PROGRAM = dg4odbc)
(ENVS="LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib")
)
)
LISTENER =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
(ADDRESS = (PROTOCOL = TCP)(HOST = lihuilin.home)(PORT = 1521))
)
ADR_BASE_LISTENER = /home/lihuilin/dev/app/lihuilin
5.建立db link
在MySQL建立測試表
create table t(a varchar(20) primary key) engine=innodb,charset =gbk;
insert into t values('透明');
commit;
檢視結果:
如果前臺報錯如下所示
ERROR at line 1:
ORA-28500: connection from ORACLE to a non-Oracle system returned this message:
[
$ORACLE_HOME/hs/log的後臺日誌報錯如下:
hgopoer, line 233: got native error 0 and sqlstate I; message follows...
[
Exiting hgopoer, rc=0 at 2014/03/04-21:40:18
hgocont, line 2752: calling SqlDriverConnect got sqlstate I
Exiting hgocont, rc=28500 at 2014/03/04-21:40:18 with error ptr FILE:hgocont.c LINE:2772 FUNCTION:hgocont() ID:Something other than invalid authorization
Exiting hgolgon, rc=28500 at 2014/03/04-21:40:18 with error ptr FILE:hgolgon.c LINE:781 FUNCTION:hgolgon() ID:Calling hgocont
Entered hgoexit at 2014/03/04-21:40:18
有兩個可能
1.HS_LANGUAGE沒有配置
2.HS_LANGUAGE和MySQL的字符集不匹配
參考:
http://blog.itpub.net/21601207/viewspace-709366
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29254281/viewspace-1101147/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Oracle 透過透明閘道器 訪問 mysqlOracleMySql
- Oracle 通過透明閘道器訪問mysqlOracleMySql
- Oracle透明閘道器訪問MySQL資料庫OracleMySql資料庫
- Oracle 11.2.0.4 透過透明閘道器訪問mysql 8.0.16OracleMySql
- ORACLE通過透明閘道器建dblink連線Postgresql的幾個問題OracleSQL
- Oracle透明閘道器訪問SQLServer資料庫OracleSQLServer資料庫
- 安全閘道器 透明加解密解密
- 10g透明閘道器訪問sqlserverSQLServer
- 【磐維資料庫】Oracle(透明閘道器)訪問磐維資料庫(PanWeiDB)資料庫Oracle
- [Oracle-> MySQL] Oracle通過dblink連線MySQL--Oracle 19c連線到MySQL 5.7OracleMySql
- Modbus轉Profinet閘道器連線LED大屏與PLC通訊
- Ceph物件閘道器,多區域閘道器物件
- Janusec應用安全閘道器(WAF閘道器)
- 長連線閘道器技術專題(九):去哪兒網酒店高效能業務閘道器技術實踐
- 配置Oracle DBlink連線MySQL庫OracleMySql
- 什麼是閘道器?閘道器的作用是什麼,閘道器的作用詳解
- gateway 閘道器Gateway
- 閘道器GatewayGateway
- 變頻器透過Modbus轉Profinet閘道器連線電機與PLC通訊
- 如何配置 CAN 轉 PN 閘道器實現與 can 裝置的連線
- CAN轉PN閘道器模組連線鐳射切割機的配置方法
- Profibus DP主站轉Modbus閘道器連線伺服與電機通訊
- 300PLC連線Modbus轉Profibus閘道器與閥島modbusRTU通訊
- PLC透過Modbus轉Profinet閘道器連線壓力計的配置方法
- 長連線閘道器技術專題(八):B站基於微服務的API閘道器從0到1的演進之路微服務API
- API閘道器,企業級閘道器可擴充套件API套件
- 《springcloud 二》微服務動態閘道器,閘道器叢集SpringGCCloud微服務
- Ocelot閘道器(二)
- Ocelot閘道器(三)
- kong閘道器部署
- API 閘道器 KongAPI
- 微服務閘道器微服務
- Zuul路由閘道器Zuul路由
- 長連線閘道器技術專題(六):石墨文件單機50萬WebSocket長連線架構實踐Web架構
- api閘道器設計API
- Gateway(閘道器)的概述Gateway
- Spring Cloud Zuul 閘道器SpringCloudZuul
- 微服務閘道器- Nginx微服務Nginx
- SpringCloud(四)GateWay閘道器SpringGCCloudGateway