Oracle建立dblink MySQL
ODBC connector:
mysql-connector-odbc-5.1.13-1.rhel5
ODBC驅動:
unixODBC-2.2.11-7.1
unixODBC-devel-2.2.11-7.1
OS版本:
Red Hat Enterprise Linux Server release 5.4 (Tikanga)
Oracle DB server中配置:
[root@scmauto opt]# rpm -ivh unixODBC-2.2.11-7.1.i386.rpm
warning: unixODBC-2.2.11-7.1.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing... ########################################### [100%]
1:unixODBC ########################################### [100%]
[root@scmauto opt]# rpm -qa|grep unixODBC
unixODBC-2.2.11-7.1
[root@scmauto opt]# rpm -ivh unixODBC-2.2.11-7.1.x86_64.rpm
warning: unixODBC-2.2.11-7.1.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing... ########################################### [100%]
1:unixODBC ########################################### [100%]
[root@scmauto opt]# rpm -ivh unixODBC-devel-2.2.11-7.1.i386.rpm
warning: unixODBC-devel-2.2.11-7.1.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing... ########################################### [100%]
1:unixODBC-devel ########################################### [100%]
[root@scmauto opt]# rpm -ivh unixODBC-devel-2.2.11-7.1.x86_64.rpm
warning: unixODBC-devel-2.2.11-7.1.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing... ########################################### [100%]
1:unixODBC-devel ########################################### [100%]
[root@scmauto Server]# yum install mysql-connector-odbc
[root@scmauto Server]# vi /etc/odbc.ini
[my1613]
Driver=/usr/lib64/libmyodbc5.so
Server=10.202.16.13
User=root
Password=Oracle123
Port=3306
database=test1
charset=utf8
[root@scmauto Server]# isql my1613
+---------------------------------------+
| Connected! |
| |
| sql-statement |
| help [tablename] |
| quit |
| |
+---------------------------------------+
scmauto<*scmauto*/u01/product/oracle/hs/admin>$more initmy1613.ora
# This is a sample agent init file that contains the HS parameters that are
# needed for the Database Gateway for ODBC
#
# HS init parameters
#
HS_FDS_CONNECT_INFO = my1613
HS_FDS_TRACE_LEVEL = debug
HS_FDS_SHAREABLE_NAME = /usr/lib64/libmyodbc5.so
HS_LANGUAGE=AMERICAN_AMERICA.UTF8
#HS_LANGUAGE=AMERICAN_AMERICA.WE8ISO8859P1
#HS_LANGUAGE=AMERICAN_AMERICA.AL32UTF8
HS_FDS_SQLLEN_INTERPRETATION=32
HS_IDLE_TIMEOUT = 1440
#HS_NLS_NCHAR=AL32UTF8
HS_NLS_NCHAR=UCS2
#
# ODBC specific environment variables
#
set ODBCINI=/etc/odbc.ini
scmauto<*scmauto*/u01/product/oracle/network/admin>$vi tnsnames.ora
my1613 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.202.10.150)(PORT = 1526))
(CONNECT_DATA = (SERVICE_NAME = my1613))
(HS = OK)
)
scmauto<*scmauto*/u01/product/oracle/network/admin>$vi listener.ora
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = my1613)
(ORACLE_HOME = /u01/product/oracle)
(PROGRAM = dg4odbc)
(ENVS="LD_LIBRARY_PATH=/usr/lib:/usr/lib64:/u01/product/oracle/lib")
)
)
[root@scmauto unixODBC-2.3.4]# ./configure --prefix=/usr/local/unixODBC-2.3.4 --includedir=/usr/include --libdir=/usr/lib --bindir=/usr/bin --sysconfdir=/etc
[root@scmauto unixODBC-2.3.4]# make && make install
[root@scmauto unixODBC-2.3.4]# odbcinst -j
unixODBC 2.3.4
DRIVERS............: /usr/local/etc/odbcinst.ini
SYSTEM DATA SOURCES: /usr/local/etc/odbc.ini
FILE DATA SOURCES..: /usr/local/etc/ODBCDataSources
USER DATA SOURCES..: /root/.odbc.ini
SQLULEN Size.......: 8
SQLLEN Size........: 8
SQLSETPOSIROW Size.: 8
CREATE PUBLIC DATABASE LINK MY1613
CONNECT TO "root"
IDENTIFIED BY "Oracle123"
USING 'my1613';
Oracle中執行:
select * from "emp1"@MY1613
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/25583515/viewspace-2146470/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Oracle->Mysql dblink 建立詳細過程OracleMySql
- 【PL/SQL】oracle建立dblinkSQLOracle
- SQL Server建立dblink至MySQLServerMySql
- 建立oracle dblink 的兩種方式Oracle
- 配置Oracle DBlink連線MySQL庫OracleMySql
- ORACLE 建立DBLINK 自動加域名解決方案Oracle
- linux oracle 建立informix dblink 錯誤解決LinuxOracleORM
- oracle DBLink oracleOracle
- ORACLE DBLINKOracle
- Oracle private dblink和pubic dblinkOracle
- [Oracle-> MySQL] Oracle通過dblink連線MySQL--Oracle 19c連線到MySQL 5.7OracleMySql
- dblink概述及建立示例
- Oracle19c dblink連結mysql8.0OracleMySql
- mysql dblink 連結mysql庫MySql
- oracle DBLink sqlserverOracleSQLServer
- oracle之DBLINKOracle
- federated MySQL的DBLinkMySql
- SQL Server :DBLINK建立及使用SQLServer
- oracle 8.1.7.4建立dblink出現ora-03113錯誤Oracle
- Oracle dblink詳解Oracle
- Oracle dblink介紹Oracle
- oracle dblink問題Oracle
- 建立dblink的兩個指令碼。指令碼
- 記一次oracle透過dblink連線mysql實施OracleMySql
- Oracle dblink詳解(轉)Oracle
- oralce資料庫建立dblink連結資料庫
- 水煮oracle34----oracle dblink詳解Oracle
- Oracle 不知使用者的密碼時,如何獲取dblink建立語句Oracle密碼
- MySQL下的DBlink--FEDERATED引擎MySql
- Oracle dblink監聽問題Oracle
- oracle DBlink建立和維護以及ORA-02085 解決辦法Oracle
- MySQL federated引擎試驗(DBLINK的作用)MySql
- oracle database link (dblink) 工作原理OracleDatabase
- Oracle SQL performance with database links - dblinkOracleSQLORMDatabase
- oracle dblink用法總結和expdp和impdp利用dblink倒入匯出到本地Oracle
- Oracle10g中通過透明閘道器、DBLink訪問MySQL資料OracleMySql
- Oracle建立dblink報錯:ORA-01017、ORA-02063解決Oracle
- RAC建立DBlink並使用impdp抽取源庫資料