Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Database \ Linux platform Oracle MySQL connection     - AngularJS - Custom instructions (Programming)

- Necessity in Java packages (Programming)

- Java objects are taking up much space (Programming)

- Five useful commands to manage file types and system time in linux (Linux)

- Ubuntu 14.04 / 14.10 how to install FFmpeg 2.5.1 (Linux)

- Installing PHP Memcache extension under Linux (Server)

- Difference in MySQL VARCHAR and CHAR data format (Database)

- Ubuntu comes with gedit editor to add Markdown preview widget (Linux)

- Linux system security Comments (Linux)

- MongoDB collection data migration to MySQL database (Database)

- Linux file system data file deletion problem space is not freed (Database)

- Log analysis is done with Grafana Elasticsearch (Server)

- Linux file compression and file system packaged with instructions (Linux)

- The Java development environment to build under Ubuntu 14.04 (Linux)

- Ubuntu 14.10 / 14.04 / 12.04 installation GNOME Pie 0.5.6 (Linux)

- Gnu Linux - Ubuntu System Clean-term consolidation (Linux)

- Ubuntu Series Installation Docker (Linux)

- Recover Ubuntu 14.04 wakes up from standby in case mouse keyboard appears dead (Linux)

- How to merge two pictures in Cacti (Linux)

- Oracle 11g contraction table space error ORA-03297: file contains used data beyondrequested RESIZE value (Database)

 
         
  Linux platform Oracle MySQL connection
     
  Add Date : 2017-08-31      
         
         
         
  Methods Windows platform Oracle MySQL connection has given you before, and now most of the Oracle and MySQL are Linux platform above, just recently this demand, shoving the whole process of recording up to build and share.

MySQL via ODBC connection schematics

Driver Manager: Communications, the main function responsible for managing applications and drivers between include: parsing DSN (data source name, ODBC data source name in the ODBC.INI configuration file), loading and unloading drivers, ODBC call processing, will it passed to the driver.

Connector / ODBC (MyODBC driver): Implementing the functionality provided by ODBC API, which is responsible for handling ODBC function calls, SQL requests will be submitted to the MySQL server, and returns the results to the application.

ODBC.INI is ODBC configuration file, driver record information and database information needed to connect to the server. Driver Manager will use it to determine which driver to load (using the data source name DSN). The driver will be read according to the specified DSN connection parameters.

Under Linux mysql ODBC configuration requires the following steps:

a) Install Driver Manager, as in this case using unixODBC Driver Manager

b) Install the MySQL driver, in this case using the Connector / ODBC

c) Configure ODBC.INI

Operating System: CentOS release 6.5 (Final)

Target database: ORACLE 11.2.0.3

Source database: mysql5.23

First, ODBC configuration

1.1, install unixODBC, the above script in the target database: yum install unixODBC

1.2, install mysql-connector-odbc, download link: http: //pan.baidu.com/s/1bnuiWCR Password: rf98

After extracting modify the file name in the / usr / local /

[Root @ test local] # pwd

/ Usr / local

[Root @ OTO-DBR-T02 local] # ll

total 56

drwxr-xr-x. 5 root root 4096 Oct 22 11:15 mysql-connector-odbc

1.3 odbc.ini configuration file

[Myodbc] # need to remember the name

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

Description = Connector / ODBC 5.1 Driver DSN

SERVER = 192.168.199.244

PORT = 3306

USER = root

PASSWORD = root

DATABASE = test

OPTION = 0

TRACE = OFF

1.4 Test Connection

[Root @ test local] # isql myodbc -v

+ --------------------------------------- +

| Connected! |

| |

| Sql-statement |

| Help [tablename] |

| Quit |

| |

+ --------------------------------------- +

SQL>

Congratulations, the pop-up window instructions may be connected to the mysql.

Second, the monitor configuration

2.1 into the ORACLE_HOME / hs / admin

[Oracle @ test admin] $ vi initmyodbc.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 = myodbc

HS_FDS_TRACE_LEVEL = ON

HS_FDS_SHAREABLE_NAME = /usr/lib64/libodbc.so

#

# ODBC specific environment variables

#

set ODBCINI = /etc/odbc.ini

#

# Environment variables required for the non-Oracle system

#set =

2.2 listener.ora configuration file

Enter $ ORACLE_HOME / network / admin

[Oracle @ test admin] $ vi listener.ora

# Listener.ora Network Configuration File: /oracle/oracle11/network/admin/listener.ora

# Generated by Oracle configuration tools.

LISTENER =

(DESCRIPTION_LIST =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP) (HOST = test) (PORT = 1521))

)

)

ADR_BASE_LISTENER = / oracle

SID_LIST_LISTENER =

(SID_LIST =

(SID_DESC =

(SID_NAME = CLRExtProc)

(ORACLE_HOME = / oracle / oracle11) #ORACLE_HOME

(PRESPAWN_MAX = 20)

)

(SID_DESC =

(SID_NAME = myodbc) # corresponding to the above file name

(ORACLE_HOME = / oracle / oracle11) #ORACLE_HOME

(PROGRAM = dg4odbc) # 11g is dg4odbc, 10g is not the same

)

)

~

After the restart the listener look myodbc service has been launched

[Oracle @ test oracle11] $ lsnrctl status

LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 22-OCT-2015 15:22:12

Copyright (c) 1991, 2009, Oracle. All rights reserved.

Connecting to (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP) (HOST = test) (PORT = 1521)))

STATUS of the LISTENER

------------------------

Alias LISTENER

Version TNSLSNR for Linux: Version 11.2.0.1.0 - Production

Start Date 22-OCT-2015 15:08:57

Uptime 0 days 0 hr. 13 min. 15 sec

Trace Level off

Security ON: Local OS Authentication

SNMP OFF

Listener Parameter File /oracle/oracle11/network/admin/listener.ora

Listener Log File /oracle/diag/tnslsnr/test/listener/alert/log.xml

Listening Endpoints Summary ...

(DESCRIPTION = (ADDRESS = (PROTOCOL = tcp) (HOST = test) (PORT = 1521)))

Services Summary ...

Service "CLRExtProc" has 1 instance (s).

Instance "CLRExtProc", status UNKNOWN, has 1 handler (s) for this service ...

Service "myodbc" has 1 instance (s).

Instance "myodbc", status UNKNOWN, has 1 handler (s) for this service ...

The command completed successfully

2.3 configuration file tnsnames.ora

myodbc =

(DESCRIPTION =

(ADDRESS_LIST =

(ADDRESS = (PROTOCOL = TCP) (HOST = localhost) (PORT = 1521))

)

(CONNECT_DATA =

(SERVICE_NAME = myodbc) # monitor corresponds with the above

)

(HS = OK)

)

2.4 Create dblink

create database link myodbc connect to "root" identified by "root" using 'myodbc';

2.5 Check the dblink

SQL> select * from dual @ myodbc;

D

-

X

Description has been completed in connection MySQL configuration ORACLE linux platform;

Another: After configuring the database itself might step 2.2 listening service disappeared, this time can be performed to allow the system to re-register

alter system set local_listener = '(address = (protocol = tcp) (port = 1521) (host = hostname))' scope = both;
     
         
         
         
  More:      
 
- Linux find command usage summary (Linux)
- How to configure chroot environment in Ubuntu 14.04 (Linux)
- Protect your files, modify the Linux value Umask (Linux)
- Ubuntu 14.04 install the NVIDIA driver + CUDA + MATLAB (Linux)
- jobs command example (Linux)
- 10 Best Swift Tutorial examples (Programming)
- PXE installation of Linux servers (Server)
- OpenGL shadow map (Programming)
- SQL Server 2008 database synchronization Notes (Database)
- Elasticsearch Kibana installation notes (Linux)
- Large site architecture study notes (Server)
- Linux network monitoring strategy (Linux)
- Compile and install Memcached can not find GCC (Programming)
- MySQL function: group_concat () function (Database)
- How to become a better Node.js developers in 2016 (Programming)
- MySQL remote connection settings (Database)
- Yii2 Advanced Version Copy New Project Problem Solved (Programming)
- Mac OS X system setup Google Go language development environment configuration tool Sublime Text 2 (Linux)
- iOS persistence of data archiving NSKeyedArchiver (Programming)
- PL / SQL in forall simple test (Database)
     
           
     
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.