Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create a database link in MySQL to connect to Oracle?

I need to create a database link in MySQL to connect to an Oracle database to use a table present in the Oracle database.

I am not able to find any code or method of creating a database link in MySQL. How could I do this?

like image 624
Ayush Bilala Avatar asked Sep 30 '13 11:09

Ayush Bilala


People also ask

Can we create Dblink in MySQL?

Connect to your database server and execute the CREATE DATABASE LINK statement, as follows: CREATE DATABASE LINK dblink CONNECT TO "username" IDENTIFIED BY "password" USING 'tns_name_entry'; dblink is the complete database link name.

How do I create a shared database link in Oracle?

To create a shared database link, use the keyword SHARED in the CREATE DATABASE LINK statement: CREATE SHARED DATABASE LINK dblink_name [CONNECT TO username IDENTIFIED BY password]|[CONNECT TO CURRENT_USER] AUTHENTICATED BY schema_name IDENTIFIED BY password [USING 'service_name'];

How do I grant a database link in Oracle?

Prerequisites. To create a private database link, you must have the CREATE DATABASE LINK system privilege. To create a public database link, you must have the CREATE PUBLIC DATABASE LINK system privilege. Also, you must have the CREATE SESSION system privilege on the remote Oracle database.


1 Answers

You can access the Oracle (or other DBMS) information directly from within MySQL using the MySQL Federated tables via the Perl DBIx::MyServer proxy. This method has been around since about 2007: a good step-by-step write-up of the set-up and usage is available here: http://ftp.nchu.edu.tw/MySQL/tech-resources/articles/dbixmyserver.html The write-up demonstrates not only the usage of 'select' statements from directly within MySQL to postgres and sqlite native tables, but also inserts back into those tables, using queries executed directly from within the MySQL environment. The Perl module is available here: http://search.cpan.org/~philips/DBIx-MyServer-0.42/lib/DBIx/MyServer.pm Good luck!

like image 111
nosotros.pensamos Avatar answered Oct 01 '22 03:10

nosotros.pensamos