473,395 Members | 1,797 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Databasetransfer between oracle 8 database and MySQL database

Is it somebody out there who has made a migration from an Oracle server to an MySQL server??

The scenario is as simply:
I've got a Oracle 8 server with a database with content that I want to transfer to
a MySQL database. No special data, constraints etc that MySQL not will handle.

My solution is to reverse engineer the database from ERStudio and then produce a SQL script that
will insert the data into the MySQL engine.

But I can't do this, because the customer want me to do a PL/SQL script that does this, even if he
never have worked with Oracle.. So the question is.. Do someone know a simplier way to do this
or do I have to teach myself PL/SQL and make a script that produces a
MySQL sql script ?

Regards,

Patrick
Jul 20 '05 #1
1 2530
Patrick wrote:
I've got a Oracle 8 server with a database with content that
I want to transfer to > a MySQL database. No special data,
constraints etc that MySQL not will handle.
My solution is to reverse engineer the database from ERStudio
and then produce a SQL script that will insert the data into
the MySQL engine.
But I can't do this, because the customer want me to do a
PL/SQL script that does this, even if he never have worked
with Oracle.. So the question is.. Do someone know a simplier
way to do this or do I have to teach myself PL/SQL and make a
script that produces a MySQL sql script ?


Default import/export methods in Oracle and MySQL are the first choice
for this kind of job. This shouldn't normally be a problem in your
scenario.

If your customer insists on a perl solution, then 99% chances you will
want the DBI module. It supports a wide range of databases of which
Oracle and MySQL (http://dbi.perl.org).

Here are some perl examples that should get you started:

# query to Oracle that ties result to variables
use DBI;
$dbh = DBI->connect("dbi:Oracle:Oracle_DBName",
"Oracle_user","Oracle_pass");
$sth = $dbh->prepare("SELECT id, name, title, phone FROM employees");
$sth->execute();
($id, $name, $title, $phone);
$sth->bind_columns( undef, \$id, \$name, \$title, \$phone );
while( $sth->fetch() )
{ print "$name, $title, $phone\n"; }
$sth->finish();
$dbh->disconnect();

# query to MySQL that ties result to variables
use DBI;
$db = DBI->connect("dbi:mysql:MySQL_DBName:localhost",
"MySQL_user", "MySQL_pass");
$query = $db->prepare("SELECT id, name, title, phone FROM employees");
$query->execute;
$numrows = $query->rows;
while (@array = $query->fetchrow_array)
{
($id, $name, $title, $phone) = @array;
print "$name, $title, $phone\n";
}
$query->finish;
$db->disconnect;

# just execute query in Oracle
use DBI;
$dbh = DBI->connect("dbi:Oracle:Oracle_DBName",
"Oracle_user","Oracle_pass");
$dbh->do("INSERT INTO employees VALUES ('1','Jeff','Mr','12345')");
$dbh->disconnect();

# just execute query in MySQL
use DBI;
$db = DBI->connect("dbi:mysql:MySQL_DBName:localhost",
"MySQL_user", "MySQL_pass");
$query = $db->prepare("INSERT INTO employees VALUES
('1','Jeff','Mr','12345') ");
$query->execute;
$query->finish;
$db->disconnect;

--------------
Hope this helps

Bart Van der Donck
P.S. Commerciële oplossing ook beschikbaar :-) zie dotinternet.be
Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Mark Wilson CPU | last post by:
A colleague has written a prototype program in PHP, using a MySQL database. It's a relatively simple app, with a restricted set of mysql commands used (see below). The MySQL DB is being replaced...
0
by: JWM | last post by:
I am trying to implement Oracle connection pooling for the following code, which was written by someone else. Here is my main question -- this java file creates code that is executed every hour,...
0
by: Harald Falkenberg | last post by:
Hi, I'm new to mysql. Coming from the oracle database a couple of questions came up. Perhaps somebody, who has also experience in oracle, can set me on the tracks. Questions: 1. is mysql...
133
by: jonathan | last post by:
hey all, I realize that this question might pop up from time to time, but I haven't seen it a while and things might of changed, so - Right now (July 2004) how does mysql stand up in...
2
by: James Alexander Starritt | last post by:
I also posted similarly in mailing.database.mysql I have created a rather large (60 table database) website dealio in PHP that works with MS SQL Server, Oracle, MySQL and presumably any other...
4
by: Jan Olsen | last post by:
We're planning an SQL-based solution, possibly mySQL for Windows or Linux. But some in the organization might favor Oracle. Are there any particular pitfalls of using mySQL instead of Oracle? ...
0
by: Jack | last post by:
Training Classes for Oracle10g, 9i, 8i Certification training in Oracle10g and 9i: DBA, Developer, Discoverer. training conducted at your location worldwide. Courseware licensing also available....
0
by: Winder | last post by:
Training Classes for Oracle10g, 9i, 8i Certification training in Oracle10g and 9i: DBA, Developer, Discoverer. training conducted at your location worldwide. Courseware licensing also available....
4
by: --CELKO-- | last post by:
I need to convert a bunch of DB2 triggers to Oracle. Is there any kind of tools for this?
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.