Oracle connects to multiple MySQL instances through dblink

Source: Internet
Author: User
Tags driver manager

Environment: Oracle 11.2.0.1.0 RHEL5.3 64bit mysql Server version: 5.5.9

1: Download [ODBC Driver Manager] unionODBC2.2.14, decompress the package, and put it in the/u01/app/tools/unionodbc directory.

[Oracle @ wonder tools] $ ls/u01/app/tools/unionodbc/
Bin include lib

2: Download mysql-connector-odbc-3.51.30-linux-rhel5-x86-64bit.tar.gz and decompress it to my5.
 
[Oracle @ szmlserver12_32 tools] $ ls/u01/app/tools/
My5 odbc. ini unionodbc

3: Configure ODBC data source for MySQLConnector/ODBC driver

[Oracle @ wonder tools] $ cat/u01/app/tools/odbc. ini
[Mydbc3]

Driver =/u01/app/tools/my5/lib/libmydbc3.so
SERVER = 22.4.22.16
PORT = 3306
USER = soft
PASSWORD = Ugfd3589
DATABASE = estore
OPTION = 3
SOCKET =

4. Set Environment Variables

[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

Red is the new part

5: the connection is successfully tested.

[Oracle @ wonder tools] $ isql mydbc3-v
+ --------------------------------------- +
| Connected! |
|
| SQL-statement |
| Help [tablename] |
| Quit |
|
+ --------------------------------------- +
SQL>

6: Configure 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 = mydbc3)
(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)
)
)

  • 1
  • 2
  • Next Page

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.