How to import a .dmp file (Oracle) into MySql DB? - mysql

The .dmp is a dump of a table built in Oracle 10g (Express Edition) and one of the fields is of CLOB type.
I was trying to simply export the table to xml/csv files then import it to the MySql, but the export simply ignored the CLOB field... (I was using sqldeveloper for that).
I noticed this post explaining how to extract the CLOB to text file but it seems to miss the handling of the other fields or at least the primary key fields. can it be adopted to create a csv of the complete table? (I am not familiar with plsql at all)
As the brute force approach, I can use my python interface to simply query for all the records and spool it to a flat file but I'm afraid it will take a LOOOONG time (query for all records replace all native commas with the ascii... )
Thanks guys!

if you can get the mysql server and the oracle server on the same network, you might want to look at the mysql administrator tools, which includes the migration toolkit. you can connect to the oracle server with the migration toolkit and it will automatically create tables and move data for you.

Here is a documentation explaining the migration process: http://www.mysql.com/why-mysql/white-papers/mysql_wp_oracle2mysql.php
and you can use Data Wizard for MySQL . Trial version is fully usable for 30 days.

After about 2 hours of installing and uninstalling the MySql on the same machine (mylaptop) in order to use the migration tool kit as suggested by longneck, I decided to simply implement the dump and here it is for the likes of me that have minimal admin experience and get hard time to make both DBs work together (errors 1130, 1045 and more).
Surprisingly, it is not as slow as I expected: OraDump
Any comments and improvements are welcomed.

Related

Is there any open-source or freeware to convert entire Visual Foxpro Database into mysql?

I have tried some online converters but they are only converting like 50 records from one table. Is there any tool or a proper way to migrate Visual Foxpro Data into mysql data?
There are a couple of utilities on the Leafe.com site that might help.
VFPData2MariaScript Use this script to create a set of INSERT records that detects the structure of your VFP tables. This works well with the utility of STRU2MYSQL_2.PRG which scripts a CREATE TABLE file. This may work for PostgreSQL as well as MariaDB and MySQL. Note that if your table is really large, you may run into execution limits, or file size limits. There is another utility that opens up a connection from VFP and upsizes the data. This utility just creates a script of INSERT statements that you run through phpMyAdmin or the like. Author: Kevin Cully

convert Access to mysql commands

One of our customer has an Access database in his own server and I need to import it to a linux server with mysql in my own server.
In other words, I need to convert Access to mysql commands (inserts basically).
I've tried the DBWScript which works fine although it does not allow to export only one table. It exports all tables. What I'm doing now is exporting all the tables to a sql file and then I filter it taking only the inserts I really need.
I'd like to know if anybody knows a software like DBWScript that can be run in console-mode and permits to export only one table from a database, because that table has a lot of rows (up to 100.000) and it has no sense to export all the other tables if I am not going to use them. That increases the conversion time a lot.
I finally used a software called "Bullzip MS Access to MySQL" and it works like a charm!
This is the author's website: http://www.bullzip.com/products/a2m/info.php
It allows yo to select the desired table and desired columns in different tables, apart from creating a batch script to automate the process.
You can try Data Import tool in dbForge Studio for SQL Server.
Open Data Import wizard, select MS Access format, specify other options and save template file. Then use this template file (*.dit) in command line mode.
You can try using tips to converting MS Access to MySQL

How to export data from odbc?

I'm a newbie for odbc. Right now I'm connecting odbc successfully to mysql. Is there any way to easily export datatable to the local? (For me, access is not an option. And I have tried odbc explorer which is good but there's only free trial version. Also I have tried Mysql workbench, which is too dangerous since it can easily wipe out all data in the source.)
Hope to have some suggestions from you guys, cheers.
Most databases I know have some import/export utilites. Such tools exports both schema (tables descriptions, triggers, user functions etc) and data. Of course they are made to work with the same database engine or to move data to newer version of database engine. Mysql have such tools too: look at mysqldump
From ODBC you can obtain some information about schema: table names, column names, column types, primary key etc, and that information should be enough to make simple utility to export data to local files, for example into .csv files. Simply read info about tables using SQLTables(), then for each table do SELECT * FROM table and write result into .csv file.

Migration from MySQL to Postgresql with auto-increments - how?

I'm considering a MySQL to Postgresql migration for my web application, but I'm having a really hard time converting my existing MySQL database to Postgresql.
I tried :
mysldump with --compatible=postgresql
migration wizard from EnterpriseDB
Postgresql Data Wizard from EMS
DBConvert from DMSoft
and NONE of the above programs do a good job converting my database!
I saw some Perl and Python scripts for converting mysql to postgresql, but I can't figure out how to use them....(I installed ActivePerl and don't understand what I'm supposed to do next to run that script!)
I use Auto Increment fields (as a primary key) all the time, and these are just ignored... I understand that Postgresql does auto-increments in another way (with sequences), but it can't be THAT hard for MIGRATION software to implement that, or is it?
Did anybody have better luck converting a MySQL database with auto-increments as primary keys?
I know this is probably not the answer you are looking for, but: I don't believe in "automated" migration tools.
Take your existing SQL Scripts that create your database schema, do a search and replace for the necessary data types (autonumber maps to serial which does all the sequence handling automagically for you), remove all the "engine=" stuff and then run the new script against Postgres.
Dump the old database into flat files and import them into the target.
I have done this several times with sample databases that were intended for MySQL and it really doesn't take that long.
Probably just as long as trying all the different "automated" tools.
Why not use an ETL Tool? you dont have to worry about dumps or stuff like that.
I have migrated to PostgresSQL and MySQL and have had no problems with the auto increment fields.
You just need to know the connection credentials and thats it. I personally use Pentaho ( it's open source ).
Download Pentaho ETL from http://kettle.pentaho.org/
Unzip and run Pentaho (using .bat file spoon.bat)
Create a new Job:
Create DB connection for source data base (PostgreSQL) - using menu: Tools→Wizard→Create DataBase Connection (F3) Create DB connection for destination data base (Mysql) - using technique described above.
Run the Wizard: Tools → Wizard → Copy Tables (Ctrl-F10).
Select source (left dialog panel), and destination (left dialog panel). Click Finish.
The Job will be generated - Run the job.
If you need any help let me know.
Even when you familiar with all "PostgreSQL gotchas", doing every step by hand may take a lot of time, especially when your db is "big".
Try some other scripts/tools.
I know this is an old question but I just ran into the same problem migrating from MySQL to Postgres. After trying several migration tools out the very best one I could find, which will migrate your database structure as cleanly as possible, was Pgloader https://github.com/dimitri/pgloader/ it will take care of changing the Auto Increment to Postgres sequences no problem and it's super fast.

How I do to "migrate" the structure from aspnetdb.mdf to a mysql database

I'm creating a new Asp.Net MVC 3 application. Visual Studio does a lot of the job of create the database and initial layout. Very nice! I will upload that initial files to my server, but I want that it runs using the MySql database on the server.
There's some quick/easy way to do it? I'm not worried about the data, just the structure of the tables, and the connection/configuration changes.
Thank you very much!
You can export any MS-SQL database as a Script (Sql Server manager).
Fix it up to make it compatible.
But you will also need a Membership provider, look around if there exist any for MySql, otherwise you'll have to create one (movie).
There are a number of tools listed in "Migrating from Microsoft SQL Server and Access to MySQL".
Or (assuming that you're using column types that exist on both platforms) you can write a script to convert a schema dump from SqlServer into MySQL (or do the conversion by hand in a text editor). Even better yet, you can write a program program to read the INFORMATION_SCHEMA table from SqlServer and produce the necessary CREATE TABLE... statements in mysql. Lots of options.