从Informix迁移模式和SP到MySQL [英] Migrating schema and SP from informix to mysql

查看:171
本文介绍了从Informix迁移模式和SP到MySQL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们需要在MySQL中重做一个已经在Informix上完成的数据库,是否有一种方法不仅可以迁移模式,还可以迁移存储过程?

We need to redo a database in MySQL that has been already done on Informix, is there a way to migrate not only the schema, but the stored procedures as well?

谢谢.

我们有一个客户,我们为其构建了一个使用Informix数据库的Web应用程序.现在,客户希望能够在多个封闭的网络(例如20个)上实现相同的软件.使用Informix进行此操作非常昂贵(20个许可证X_X).

We have a client whom we built a web application that uses an Informix database. Now the client wants to be able to implement the same software but on multiple closed networks (like 20). Doing this using Informix would be very expensive (20 licences X_X).

所以最好的方法是在MySQL之类的数据库上重做数据库.

So the best approach is to redo the database on something like MySQL.

该应用程序是使用Flex,.Net(使用ODBC)和Informix完成的.

The application was done using Flex, .Net (using ODBC) and Informix.

推荐答案

我做了类似的事情,但是我将Informix数据库迁移到了PostgreSQL.首先,我dbexport了整个数据库,所以整个数据和架构信息都是文本形式的.然后,我编写了一些Python程序,这些程序可以转换模式,例如,必须将Informix DATETIME YEAR TO SECOND转换为timestamp with time zone.

I have done a similar thing, but I migrated Informix database to PostgreSQL. At first I dbexported the whole database, so the whole data and schema info was in text. Then I wrote some Python programs that translated schema, for example Informix DATETIME YEAR TO SECOND must be converted to timestamp with time zone.

当所有CREATE TABLE/INDEX等都起作用时,我将.unl文件转换为PostgreSQL COPY命令.您应该搜索如何在MySQL中进行批量加载,或将这些文件转换为INSERT命令.

When all CREATE TABLE/INDEX etc worked then I translated .unl files to PostgreSQL COPY commands. You should search how to do bulk load in MySQL, or convert those files to INSERT commands.

之后,我开始转换存储过程.尽管PostgreSQL PL/pgSQL和Informix SPL有很大的不同,但是这部分是最难的,我只能自动转换函数原型".函数主体必须手动转换.

After that I started converting stored procedures. While PostgreSQL PL/pgSQL and Informix SPL are very different this part was the hardest and I was able to automatically convert only function "prototypes". Functions body had to be converted manually.

如果完成此操作,则必须检查您的应用程序是否可以在新的SQL实现中正常运行.

If you completed this you will have to check if your application work well with a new SQL implementation.

这篇关于从Informix迁移模式和SP到MySQL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆