Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to configure Oracle DBlink connection MySQL Library

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article focuses on "how to configure Oracle DBlink to connect to the MySQL library", interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "how to configure Oracle DBlink connection MySQL library"!

A background description

A customer needs to obtain the business data in the Oracle database through the network connection on the MySQL database. To meet this requirement, configure the dblink that Oracle connects to the MySQL library.

Configure Oracle DBlink2.1 to confirm [Oracle] and [DG4ODBC] digits

SQL > select * from v$version where rownum put-r "C:\ Users\ xh\ Desktop\ mysql-connector-odbc-5.1.12-linux-glibc2.5-x86-64bit.tar.gz"

# mkdir-p / soft

# tar zxvf / soft/mysql-connector-odbc-5.1.12-linux-glibc2.5-x86-64bit.tar.gz

# mv / soft/mysql-connector-odbc-5.1.12-linux-glibc2.5-x86-64bitbind * / usr/local/mysql-connector-odbc/

2.4 configure ODBC data source

# vi / etc/odbc.ini

[myodbc5]

Driver = / usr/local/mysql-connector-odbc/lib/libmyodbc5.so

Description = Connector/ODBC 5.1 Driver DSN

SERVER = 192.168.210.125

PORT = 3306

USER = backup

PASSWORD = mysql

DATABASE = zj20_sunft

OPTION = 0

TRACE = OFF

Create soft links for libodbcinst.so.2.0.0 and libodbc.so.2.0.0 files

# cd / usr/lib64/

# ln-s libodbcinst.so.2.0.0 libodbcinst.so.1

# ln-s libodbc.so.2.0.0 libodbc.so.1

Verify the ODBC-to-MySQL Server connection

# isql myodbc5-v

+-- +

| | Connected! |

| | |

| | sql-statement |

| | help [tablename] |

| | quit |

| | |

+-+

SQL >

2.5 configure listener.ora

Edit the listening configuration file, create a LISTENER2, and statically register the instance myodbc5

LISTENER2 =

(DESCRIPTION_LIST =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP) (HOST = rac2) (PORT = 1522))

)

)

SID_LIST_LISTENER2=

(SID_LIST=

(SID_DESC=

(SID_NAME=myodbc5)

(ORACLE_HOME=/oracle/app/product/11.2.0/db_1)

(PROGRAM=dg4odbc)

(ENV= "LD_LIBRARY_PATH=/usr/lib64:/oracle/app/product/11.2.0/db_1/lib")

)

)

Start the monitoring LISTENER2 and check the monitoring status

$lsnrctl start LISTENER2

$lsnrctl status LISTENER2

2.6 configure tnsnames.ora

$vi tnsnames.ora

Myodbc5 =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP) (HOST = rac2) (PORT = 1522))

(CONNECT_DATA =

(SID = myodbc5)

)

(HS = OK)

)

Verify the myodbc5 connection string configuration

$tnsping myodbc5

TNS Ping Utility for Linux: Version 11.2.0.4.0-Production on 03-SEP-2018 18:54:56

Copyright (c) 1997, 2013, Oracle. All rights reserved.

Used parameter files:

Used TNSNAMES adapter to resolve the alias

Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP) (HOST = rac2) (PORT = 1522)) (CONNECT_DATA = (SID = myodbc5)) (HS = OK)

OK (10 msec)

2.7Configuring the gateway parameter file initmyodbc5.ora

$cd $ORACLE_HOME/hs/admin

$vi initmyodbc5.ora

HS_FDS_CONNECT_INFO=myodbc5

# Data source name in odbc.ini

HS_FDS_TRACE_LEVEL=ON

HS_FDS_SHAREABLE_NAME=/usr/lib64/libodbc.so

HS_FDS_SUPPORT_STATISTICS=FALSE

HS_LANGUAGE=AMERICAN_AMERICA.WE8ISO8859P15

#

# ODBC env variables

Set ODBCINI=/etc/odbc.ini

2.8Create Oracle DBlink

SQL > create public database link myodbc5 connect to "backup" identified by "mysql" using 'myodbc5'

2.9Verification Oracle DBlink

SQL > select count (*) from "test" @ myodbc5

COUNT (*)

-

1835008

2.10 MOS reference documentation

Configure Oracle to MySQL DBlink:

Detailed Overview of Connecting Oracle to MySQL Using DG4ODBC Database Link (document ID 1320645.1)

Odbc Connection From Oracle To SQL*Server Fails With Errors Ora-28546 and Ora-2063 When Using Connection via Database Link. (document ID 1389492.1)

At this point, I believe you have a deeper understanding of "how to configure Oracle DBlink connection MySQL library". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report