Oracle通过dblink连接到多台MySQL
环境:oracle 11.2.0.1.0 RHEL5.3 64bit mysql Server version: 5.5.9
首页 → 数据库技术
背景:
阅读新闻
Oracle通过dblink连接到多台MySQL
[日期:2012-11-24] 来源:Linux社区 作者:wonder_2012 [字体:]
环境:Oracle 11.2.0.1.0 RHEL5.3 64bit mysql Server version: 5.5.9
1:下载[ODBC Driver Manager] unionODBC2.2.14,解压后放入/u01/app/tools/unionodbc 目录下
[oracle@wonder tools]$ ls /u01/app/tools/unionodbc/
bin include lib
2:下载mysql-connector-odbc-3.51.30-linux-rhel5-x86-64bit.tar.gz解压重命名到my5
[oracle@szmlserver12_32 tools]$ ls /u01/app/tools/
my5 odbc.ini unionodbc
3:配置 ODBC data source for MySQLConnector/ODBC driver
[oracle@wonder tools]$ cat /u01/app/tools/odbc.ini
[myodbc3]
Driver = /u01/app/tools/my5/lib/libmyodbc3.so
SERVER = 22.4.22.16
PORT = 3306
USER = soft
PASSWORD = Ugfd3589
DATABASE = estore
OPTION = 3
SOCKET =
4:设置环境变量
[oracle@wonder tools]$ cat ~/.bash_profile
PATH=$PATH:$HOME/bin
export PATH
export ORACLE_BASE=/u01/app
export ORACLE_HOME=/u01/app/oracle
export ORACLE_SID=hidb
export LANG=en
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/u01/app/tools/unionodbc/lib
export ODBCINI=/u01/app/tools/odbc.ini
export PATH=$ORACLE_HOME/bin:$PATH:/u01/app/tools/unionodbc/bin
红色为新增部分
5:测试连接成功
[oracle@wonder tools]$ isql myodbc3 -v
+---------------------------------------+
| Connected! |
| |
| sql-statement |
| help [tablename] |
| quit |
| |
+---------------------------------------+
SQL>
6:配置listener.ora
[grid@wonder ~]$ cat /u01/app/11.2.0/grid/network/admin/listener.ora
# listener.ora Network Configuration File: /u01/app/11.2.0/grid/network/admin/listener.ora
# Generated by Oracle configuration tools.
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = wonder.easou.com)(PORT = 1521))
)
)
ADR_BASE_LISTENER = /u01/app/11.2.0
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER=ON # line added by Agent
SUBSCRIBE_FOR_NODE_DOWN_EVENT_LISTENER=OFF
SID_LIST_LISTENER=
(SID_LIST=
(SID_DESC=
(SID_NAME= myodbc3)
(ORACLE_HOME= /u01/app/oracle)
(PROGRAM = dg4odbc)
(ENVS=LD_LIBRARY_PATH=/u01/app/oracle/bin:/u01/app/tools/unionodbc/lib:/u01/app/tools/my5/lib)
)
)
SQL2005读取所有表字段的备注
PHP连接Oracle数据库
相关资讯 Oracle基础教程 Oracle dblink
图片资讯
本文评论 查看全部评论 (0)
评论声明
最新资讯
本周热门
Linux公社简介 - 广告服务 - 网站地图 - 帮助信息 - 联系我们
本站(LinuxIDC)所刊载文章不代表同意其说法或描述,,仅为提供更多信息,也不构成任何建议。
Copyright © 2006-2011 Linux公社 All rights reserved 浙ICP备06018118号
上一篇: php页面添加背景音乐 控制停止/播放