从 Oracle 迁移到 MySQL 的工具
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1651331/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Tools for Migrating from Oracle to MySQL
提问by Rachel
I want to migrate schema from Oracle to MySQl, so are there any free tools that would be useful for this task?
我想将架构从 Oracle 迁移到 MySQl,那么是否有任何免费工具可用于此任务?
I have "Create table" statements in Oracle SQL Script, but it contains unique constraints and a foreign key. MySQL has MyISAM storage engine, and so foreign key is not supported.
我在 Oracle SQL 脚本中有“创建表”语句,但它包含唯一约束和外键。MySQL 有 MyISAM 存储引擎,因此不支持外键。
How to solve this issue?
如何解决这个问题?
Sample Oracle create statements:
示例 Oracle create 语句:
CREATE TABLE channels
(
obt_id NUMBER(19) PRIMARY KEY,
discriminator VARCHAR2(64) NOT NULL
CONSTRAINT check_channel_discriminator CHECK (discriminator IN ('CHANNEL','SALES_CHANNEL')),
chan_id VARCHAR2(255),
description VARCHAR2(255),
name VARCHAR2(255) NOT NULL,
obt_version VARCHAR2(255),
fk2_channel NUMBER(19)
CONSTRAINT fk_channel_channel REFERENCES channels(obt_id)
);
CREATE TABLE object_types
(
obt_id NUMBER(19) PRIMARY KEY,
enum_value VARCHAR2(64) NOT NULL,
external_name VARCHAR2(64) NOT NULL,
description VARCHAR2(255),
business_validation NUMBER(1) DEFAULT 0,
start_date_time DATE DEFAULT to_date('01011900','DDMMYYYY'),
end_date_time DATE DEFAULT to_date('01014712','DDMMYYYY'),
mut_date_time DATE DEFAULT SYSDATE,
mut_user VARCHAR2(32) DEFAULT USER,
CONSTRAINT object_types UNIQUE (external_name,start_date_time,end_date_time)
);
采纳答案by northpole
I have not heard of a single tool that can assist in what you are asking for. This does not mean one does not exist, however, it is probably easier and less error prone to take your existing Oracle scripts and manually create the appropriate MySQL scripts. On every project I have been on the DBAs were responsible for data migration of this type and they always did it manually.
我还没有听说过任何一种工具可以帮助满足您的要求。这并不意味着一个不存在,但是,使用现有的 Oracle 脚本并手动创建适当的 MySQL 脚本可能更容易且不易出错。在我参与的每个项目中,DBA 都负责这种类型的数据迁移,而且他们总是手动完成。
Edit:
编辑:
That being said I did a quick google search and there are a few programs that claim to do this (at a cost). For example:
话虽如此,我做了一个快速的谷歌搜索,有一些程序声称这样做(有代价)。例如:
I would obviously caution against using a third party tool and make sure you back up everything before starting.
我显然会警告不要使用第三方工具,并确保在开始之前备份所有内容。
回答by txyoji
The mysql gui tool kit includes a migration tool. http://dev.mysql.com/downloads/gui-tools/5.0.html
mysql gui 工具包包含一个迁移工具。 http://dev.mysql.com/downloads/gui-tools/5.0.html
You'll need to have the jdbc driver for Oracle installed on the machine where your running the tool kit.
您需要在运行工具包的机器上安装 Oracle 的 jdbc 驱动程序。