Re: Migrating data form ORacle to MySQL
Posted by: Michael G. Zinner
Date: October 19, 2005 09:47AM

In this case you have to modify the Java code but it should be straight forward.

I recommend to make these changes in Eclipse. The tool ships with an Eclipse project in [install dir]\java.

Please open the files [install dir]\java\com\mysql\grt\modules\MigrationOracle.java. In line 85 take a look at.

/**
* migrates the name of an identifier
*
* @param name
* the source name of the identifier
* @return the migrated identifier name
*/
protected String migrateIdentifier(String name) {
return name.toLowerCase();
}

But this will influence all identifiers. As you can see, for Oracle we convert them to lower case per default.

So look below at

protected com.mysql.grt.db.mysql.Table migrateTableToMysql(
com.mysql.grt.db.migration.Migration migObj, Table sourceTable,
GrtStringHashMap migrationParams, GrtObject parent) {

// call migration method from the super class
com.mysql.grt.db.mysql.Table targetTable;
targetTable = super.migrateTableToMysql(migObj, sourceTable,
migrationParams, parent);

// do oracle specific things

// return new created, migrated object
return targetTable;
}

You can add your special name mapping at the line

// do oracle specific things

e.g. to get everything in uppercases you can do

targetTable.setName(sourceTable.getName().toUpperCase());

or more complex things.

Then compile the .java file and restart the Migration Toolkit. To debug your code you can start the Migration Toolkit with the -debug option. Then you can attach Eclipse to the running tool and debug your code.

Mike

Michael Zinner, Team Lead, Developer Tools
MySQL AB, www.mysql.com

Are you MySQL certified? www.mysql.com/certification

Options: ReplyQuote


Subject
Written By
Posted
Re: Migrating data form ORacle to MySQL
October 19, 2005 09:47AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.