一、简介
MTK全称(Database Migration Toolkit),可进行Oracle/DB2/MySQL/openGauss/SqlServer/Informix等数据库异构迁移,支持Oracle/MySQL/DB2->openGauss的存储过程,函数,触发器,包迁移。MTK支持多种数据类型,并可在迁移时对性能进行调整,还支持结构和数据的分离。
本次采用恩墨公司MTK迁移工具,进行Oracle 11g到openGauss 5.0数据迁移测试。本次迁移采用MTK最新版 2.9.2(2023年7月30日)。MTK安装比较灵活,其可以安装在源端和目标端甚至可单独部署在一台可远程访问源端及目标端的单独服务器上。MTK迁移Oracle数据库时,需在部署MTK的服务器上安装Oracle客户端 Oracle Instant Client。
二、环境概述
本次进行Oracle 11g到openGauss 5.0.0 迁移测试,如进行生产迁移,还需考虑更多步骤细节,详情请查看恩墨MTK官方文档[https://docs.mogdb.io/zh/mtk/v2.0/overview]。
本次进行Oracle 11g到openGauss 5.0.0 迁移测试,如进行生产迁移,还需考虑更多步骤细节,详情请查看恩墨MTK官方文档[https://docs.mogdb.io/zh/mtk/v2.0/overview]。
操作系统版本 | 内核版本 | 数据库类型 |
工具版本 |
字 符集 |
数据 库端口 |
|
---|---|---|---|---|---|---|
源端 | CentOS release 6.10 (Final) | 2.6.32-754.el6.x86_64 | 单机 | Oracle 11.2.0.4 | AMERICAN_AMERICA.AL32UTF8 | 1521 |
目标端 | CentOS Linux release 7.9.2009 (Core) | 3.10.0-1160.83.1.el7.x86_64 | 集群 | openGauss 5.0.0 | UTF8 | 26000 |
MTK服务器 | CentOS Linux release 7.9.2009 (Core) | 3.10.0-1160.83.1.el7.x86_64 | 单机 | 2.9.2 |
三、安装部署
3.1 安装Oracle客户端
MTK迁移Oracle数据库,需要在部署MTK的服务器上安装Oracle 11g客户端,本次选择采用rpm包来安装客户端。
登录https://www.oracle.com/database/technologies/instant-client/linux-x86-64-downloads.html选择下载Version 11.2.0.4.0版本客户端。
-- 1) 安装oracle-client rpm包
-- MTK服务器下载如下四个 oracle-client rpm包
[root@opensource-db soft]# ll
total 61400
-rw-r--r-- 1 root root 59865008 Jul 28 16:46 oracle-instantclient11.2-basic-11.2.0.4.0-1.x86_64.rpm
-rw-r--r-- 1 root root 610222 Jul 28 16:47 oracle-instantclient11.2-devel-11.2.0.4.0-1.x86_64.rpm
-rw-r--r-- 1 root root 1564169 Jul 28 16:47 oracle-instantclient11.2-jdbc-11.2.0.4.0-1.x86_64.rpm
-rw-r--r-- 1 root root 828333 Jul 28 16:48 oracle-instantclient11.2-sqlplus-11.2.0.4.0-1.x86_64.rpm
-- root 用户安装rpm包
[root@opensource-db soft]# rpm -ivh oracle*.rpm
-- oracle-instantclient11.2*.rpm 包安装目录在 /usr/lib/oracle 目录下
[root@opensource-db ~]# cd /usr/lib
[root@opensource-db lib]# tree oracle/
oracle/
└── 11.2
└── client64
├── bin
│ ├── adrci
│ ├── genezi
│ └── sqlplus
├── lib
│ ├── glogin.sql
│ ├── libclntsh.so -> libclntsh.so.11.1
│ ├── libclntsh.so.11.1
│ ├── libheteroxa11.so
│ ├── libnnz11.so
│ ├── libocci.so -> libocci.so.11.1
│ ├── libocci.so.11.1
│ ├── libociei.so
│ ├── libocijdbc11.so
│ ├── libsqlplusic.so
│ ├── libsqlplus.so
│ ├── ojdbc5.jar
│ ├── ojdbc6.jar
│ ├── orai18n.jar
│ ├── orai18n-mapping.jar
│ ├── ottclasses.zip
│ └── xstreams.jar
└── network
└── admin
└── tnsnames.ora
6 directories, 21 files
-- 2) 配置环境变量
-- omm 用户
[omm@opensource-db ~]$ cat >>/home/omm/.bash_profile Config Value > MTK Default Value
--preRun preRun check.
-r, --reportFile string Set mtk report file or dir. If it is a file, use the file directory.
Default value is ./report
report directory format [./report/reportYYYYMMDDHHMISS] ./report/report20210101121314
--schemas string the Migrate schema,Separated by commas.(schema1,schema2,db1)
--tableSkip stringArray Define table split. Can be specified multiple times.
format schema.tableName --tableSkip MTK.TABLE01 --tableSkip MTK.TABLE02
--tables string the Migrate tables,Separated by commas.(tab1,schema1.tab1)
-- -s 代表源端所支持的数据库类型
-- -t 代表目标端所支持的数据库类型
-- 通过以上内容可以看到mtk支持源端Oracle数据库和目标端openGauss数据库的迁移
-- 使用如下命令初始化项目
[omm@opensource-db mtk_2.9.2_linux_amd64]$ ./mtk init-project -s oracle -t opengauss -n ora2gaussdb
[omm@opensource-db mtk_2.9.2_linux_amd64]$ tree -f ora2gaussdb/
ora2gaussdb
├── ora2gaussdb/config
│ └── ora2gaussdb/config/mtk.json
├── ora2gaussdb/data
├── ora2gaussdb/report
└── ora2gaussdb/schema
4 directories, 1 file
3.5 编辑并检查配置文件
3.5.1 编辑配置文件
-- 可参照初始化后所提供的mtk.json模版来编辑配置文件
[omm@opensource-db ~]$ cd /home/omm/mtk_2.9.2_linux_amd64/ora2gaussdb/config
[omm@opensource-db config]$ ll
total 4
-rw------- 1 omm omm 1854 Jul 31 11:30 mtk.json
-- 编辑mtk.json配置文件
[omm@opensource-db mtk_2.9.2_linux_amd64]$ vim ora2mg/config/mtk.json
-- 编辑后的文件如下
{
"source": {
"type": "oracle", -- 源端数据类型
"connect": {
"version": "11.2.0.4", -- 源端数据库版本
"host": "10.110.8.204", -- 源端数据库地址
"user": "system", -- 源端用户,需要有相应权限
"port": 1521, -- 源端监听端口
"password": "xxxx", -- 源端用户密码
"dbName": "silk", -- 源端数据库名称
"dsn": "",
"charset": "UTF8", -- 源端字符集
"clientCharset": ""
},
"parameter": {
"charAppendEmptyString": false
}
},
"target": {
"type": "opengauss", -- 目标端数据库类型
"connect": {
"version": "5.0.0", -- 目标端数据库版本
"host": "10.110.7.39", -- 目标端数据库地址
"user": "opuser", -- 目标端用户
"port": 26000, -- 目标段监听端口
"password": "Opuser123", -- 目标端用户密码
"dbName": "gaussdb", -- 目标端数据库名称
"dsn": "",
"charset": "UTF8", -- 目标端数据库字符集
"datCompatibility": "A",
"clientCharset": "UTF8"
},
"parameter": {
"parallelInsert": 4, -- 数据插入的并行度
"dropSchema": false,
"dropExistingObject": false,
"truncTable": false,
"colKeyWords": {
"STREAM": 1,
"TID": 1
},
"objKeyWords": {
"STREAM": 1,
"TID": 1
},
"caseSensitive": 0,
"quoteMark": false,
"path": "ora2gaussdb/data", -- 存放迁移过程中源端及目标端的相关信息
"schemaPath": "ora2gaussdb/schema", -- 存放迁移过程中的一些视图、存储过程、包等信息
"dataPath": "ora2gaussdb/data",
"errDataPath": "",
"fileType": "sql",
"fileSize": "10240MiB",
"csvHeader": false,
"csvNullValue": "",
"csvFieldDelimiter": ",",
"csvOptionallyEnclosed": """,
"excludeSysTable": [],
"remapSchema": {
"XXXXX": "XXXXX"
},
"remapTable": {},
"remapTablespace": {},
"enableSyncTabTbsPro": false,
"enableSyncCompTabPro": false,
"timeFormat": "HH:MI:SS",
"dateFormat": "YYYY-MM-DD",
"dateTimeFormat": "YYYY-MM-DD HH24:MI:SS",
"timeStampFormat": "YYYY-MM-DD HH24:MI:SSXFFFFFF",
"timeStampZoneFormat": "YYYY-MM-DD HH24:MI:SSXFFFFFF TZR",
"noSupportPartTabToNormalTab": true,
"ignoreDB2PartInclusive": false,
"igNotSupportIntervalPart": false,
"igErrorData": false,
"enableBatchCommit": false,
"ignoreTabPartition": false,
"autoAddMaxvaluePart": false,
"autoAddMySQLAutoIncr": false,
"autoAddMySQLAutoIncrTabList": [
"TABLE_1",
"SCHEMA1.TABLE_1"
],
"ignoreNotSupportDefault": false,
"replaceZeroDate": "",
"virtualColToNormalCol": false,
"virtualColConv": {
"LEFT(HOST,POSSTR(HOST,':')-1)": "SPLIT_PART(HOST,':',1)",
"TRUNC_TIMESTAMP(SNAPTIME,'HH')+ (MINUTE(SNAPTIME)/10*10 +10) MINUTES": "date_trunc('hour',snaptime) + (date_part('minute',snaptime) / 10 +1)::int * interval '10 min'"
},
"convertPackageMethod": "package",
"convertOracleIntegerToNumeric": false,
"enableOgBlobClob": false,
"enableConvertSrid": false,
"defaultSrid": "4326",
"seqLastNumAddNum": 0,
"skipColumnType": {
"COL_TYPE_1": 1,
"COL_TYPE_2": 2
},
"skipColumnName": {
"SCHEMA1.TAB_01.COL1": 1,
"SCHEMA1.TAB_01.COL2": 2
},
"templateSeqName": "{{.TabName}}_{{.ColName}}_SEQ",
"charAppendEmptyString": false,
"tableOptions": {},
"indexOptions": {}
}
},
"object": {
"tables": [],
"schemas": [
"XXXXX"
],
"excludeTable": {
"SCHEMA1": [
"TABLE_SKIP1",
"TABLE_DUTY_LOG*",
"^TABLE_DUTY_LOG*",
"^TABLE_DUTY_LOG.*$"
],
"SCHEMA2": [
"TABLE_SKIP1"
]
},
"tableSplit": {
"SCHEMA1": {
"TAB_1": [
"ID < 10000",
"ID =10000",
"ID >= 90000"
]
},
"SCHEMA2": {
"TAB_1": [
"ID < 10000",
"ID =10000",
"ID >= 90000"
]
}
}
},
"limit": {
"parallel": 4,
"fetchSize": 1000,
"batchSize": 1000,
"bufferSize": 8,
"cpBufferSize": 8,
"oracleSelectParallel": 2,
"channelCacheNum": 100000,
"limit": 0
},
"dataOnly": false,
"schemaOnly": false,
"disableTableDataComp": false,
"disableCollStatistics": false,
"reportFile": "ora2gaussdb/report", -- 迁移生成报告的目录
"debug": false,
"disableIgnoreCase": false,
"disableSelectPart": false,
"disableFKCons": false,
"disableSyncIdxAfterData": false
}
-- mtk.json配置文件具体内容可参照官方文档 https://docs.mogdb.io/zh/mtk/v2.0/mtk-config
以下是mtk部分配置参数及含义描述:
名称 | 定义类型 | 含义描述 |
---|---|---|
source | Option | 源数据库配置信息. |
target | Option | 目标数据库配置信息. |
limit | Limit | 迁移并发配置. |
object | Object | 迁移对象配置. |
dataOnly | bool | 是否只迁移数据. |
schemaOnly | bool | 是否只迁移数据结构. |
disableTableDataComp | bool | 当数据迁移完成后,MTK会统计两边的行数进行对比. |
disableCollStatistics | bool | 当数据迁移完成后,MTK会收集目标端统计信息. |
reportFile | string | 迁移报告目录. |
debug | bool | 是否开启日志debug模式. |
preRun | bool | 预运行. |
test | bool | 试迁移. |
disableIgnoreCase | bool | 关闭在源库查询忽略大小写功能. |
disableSelectPart | bool | 关闭分区查询功能. |
disableFKCons | bool | 禁用外键同步. |
disableSyncIdxAfterData | bool | 在一次性迁移模式下禁用在同步完单个表数据后立即创建这个表的索引. 改为全部完全部迁移表数据后,在进行同步索引 |
disablePrintMigDataProgress | bool | 关闭打印迁移表数据进度功能.打印进度影响迁移性能 |
3.5.2 检查配置文件
-- 通过预运行检查配置文件有无错误
[omm@opensource-db mtk_2.9.2_linux_amd64]$ ./mtk check-config -c ora2gaussdb/config/mtk.json --preRun
use config : ora2gaussdb/config/mtk.json
There is no error in the configuration file
# 出现如上信息提示配置文件配置正确
# 注意,如果只迁移schema,在配置object时,不能将table和schema同时写,否则检查时会报如下错误:
[omm@opensource-db mtk_2.9.2_linux_amd64]$ ./mtk check-config -c ora2gaussdb/config/mtk.json --preRun
use config : ora2gaussdb/config/mtk.json
Error : schema and tables cannot exist together
schema and tables cannot exist together
四、执行迁移
4.1 迁移命令
迁移可以选择只迁移schema、迁移整个库,或者迁移数据库某些表对象。
-- 通常有如下迁移方式
-- 整库迁移
mtk -c ora2gaussdb/config/mtk.json
-- 只迁移schema
mtk -c ora2gaussdb/config/mtk.json --schemaOnly
-- 只迁移数据
mtk -c ora2gaussdb/config/mtk.json --file --dataOnly
-- 还可以根据需要对部分对象进行迁移
-- 可参加官方文档:https://docs.mogdb.io/zh/mtk/v2.0/mtk-usage (分步迁移)
-- 执行迁移后,还可以通过如下方式生成相应迁移报告
-- 导出整库迁移报告
mtk -c ora2gaussdb/config/mtk.json --file
-- 导出仅含schema的信息报告
mtk -c ora2gaussdb/config/mtk.json --file --schemaOnly
-- 导出仅含数据的信息报告
mtk -c ora2gaussdb/config/mtk.json --file --dataOnly
4.1 迁移schema
[omm@opensource-db ~]$ cd mtk_2.9.2_linux_amd64/
[omm@opensource-db mtk_2.9.2_linux_amd64]$ ./mtk -c ora2gaussdb/config/mtk.json --schemaOnly
-- 迁移过程部分信息如下
CREATE TRIGGER REP_BUSI_FOLLOW_UP_INFO BEFORE INSERT OR UPDATE ON XXXXX.BUSI_FOLLOW_UP_INFO FOR EACH ROW EXECUTE PROCEDURE XXXXX.TRIG_FCT_REP_BUSI_FOLLOW_UP_INFO();
error code: 42601 msg:syntax error at or near "IS"" function=doTask line=558 file="mtk/pkg/mtk/mtk_task.go" taskID=1685880346911969280
......
time="2023-07-31 13:09:49.511669" level=info msg="CreateTrigger XXXXX.T_BUSI_INFO_RECORD" function=doTask line=538 file="mtk/pkg/mtk/mtk_task.go" taskID=1685880346911969280
time="2023-07-31 13:09:54.864476" level=info msg="AlterSequence XXXXX.S_Z_GRILLS_DEALER_INFO" function=doTask line=538 file="mtk/pkg/mtk/mtk_task.go" taskID=1685880346911969280
time="2023-07-31 13:09:54.868065" level=info msg="Processing AlterSequence finish" function=doTask line=450 file="mtk/pkg/mtk/mtk.go" taskID=1685880346911969280
time="2023-07-31 13:09:54.873779" level=info msg="Finish end" function=Stop line=250 file="mtk/pkg/mtk/mtk.go" taskID=1685880346911969280
......
4.2 执行结果
迁移执行后,会在末尾生成执行结果,如下所示
*********************************
Database Migration Toolkit Report
*********************************
--------------
Report Summary
--------------
| Name | Value |
|--------------------------------|---------------------|
| Source Database Type | oracle |
| Source Database Version | 11.2.0.4.0 |
| Source Database Charset | AL32UTF8 |
| Source Database DatCompat | |
| Target Database Type | opengauss |
| Target Database Version | 5.0.0 |
| Target Database Charset | UTF8 |
| Target Database DatCompat | A |
| StartTime | 2023-07-31 13:09:31 |
| EndTime | 2023-07-31 13:09:54 |
| Time | 22 s |
| Status | finish |
| MTK Version | v2.9.2_26deaa81 |
-----------------------
ObjectName Type Summary
-----------------------
+------------------+-------------------+-------------------+--------+-----------+-------------+-------------+-------------+--------------------|-------------+
| Type | StartTime | EndTime | Status | Total Num | Success Num | Warring Num | Failed Num |Failed(Invalid) Num | Time |
+------------------+-------------------+-------------------+--------+-----------+-------------+-------------+-------------+--------------------|-------------+
|Schema |2023-07-31 13:09:31|2023-07-31 13:09:31|finish |1 |1 |0 |0 |0 |14 ms |
|Sequence |2023-07-31 13:09:31|2023-07-31 13:09:32|finish |477 |477 |0 |0 |0 |276 ms |
|ObjectType |2023-07-31 13:09:32|2023-07-31 13:09:32|finish |0 |0 |0 |0 |0 |72 ms |
|Queue |2023-07-31 13:09:32|2023-07-31 13:09:32|finish |0 |0 |0 |0 |0 |30 ms |
|Table |2023-07-31 13:09:32|2023-07-31 13:09:43|finish |558 |67 |491 |0 |0 |11 s 424 ms |
|Index |2023-07-31 13:09:43|2023-07-31 13:09:44|finish |1059 |1056 |1 |2 |0 |693 ms |
|Constraint |2023-07-31 13:09:44|2023-07-31 13:09:44|finish |485 |482 |2 |1 |0 |511 ms |
|DBLink |2023-07-31 13:09:44|2023-07-31 13:09:44|finish |9 |0 |0 |9 |0 |5 ms |
|Synonym |2023-07-31 13:09:44|2023-07-31 13:09:44|finish |10 |9 |0 |1 |0 |38 ms |
|View |2023-07-31 13:09:44|2023-07-31 13:09:44|finish |0 |0 |0 |0 |0 |38 ms |
|MaterializedView |2023-07-31 13:09:44|2023-07-31 13:09:45|finish |18 |0 |0 |18 |0 |225 ms |
|Function |2023-07-31 13:09:45|2023-07-31 13:09:46|finish |3 |1 |0 |2 |0 |1 s 725 ms |
|Procedure |2023-07-31 13:09:46|2023-07-31 13:09:48|finish |20 |3 |0 |14 |3 |1 s 337 ms |
|Package |2023-07-31 13:09:48|2023-07-31 13:09:48|finish |0 |0 |0 |0 |0 |21 ms |
|Trigger |2023-07-31 13:09:48|2023-07-31 13:09:54|finish |900 |875 |0 |25 |0 |6 s 436 ms |
|AlterSequence |2023-07-31 13:09:54|2023-07-31 13:09:54|finish |477 |477 |0 |0 |0 |134 ms |
+------------------+-------------------+-------------------+--------+-----------+-------------+-------------+-------------+--------------------|-------------+
[2023-07-31 13:09:54.877143] INFO reportDir : ora2gaussdb/report/report_20230731130954 function=PrintReport line=364 file=mtk/cmd/mtk/cmd/mtk.go
[2023-07-31 13:09:55.154613] INFO the text report : ora2gaussdb/report/report_20230731130954.txt function=HTMLReportToFIle line=135 file=mtk/pkg/report/report.go
[2023-07-31 13:09:55.990968] INFO the warring report : ora2gaussdb/report/report_20230731130954.warring file=mtk/pkg/report/report.go function=HTMLReportToFIle line=142
[2023-07-31 13:09:56.06896] INFO the error report : ora2gaussdb/report/report_20230731130954.err function=HTMLReportToFIle line=149 file=mtk/pkg/report/report.go
[2023-07-31 13:09:56.092667] INFO the excel report : ora2gaussdb/report/report_20230731130954.xlsx function=HTMLReportToFIle line=156 file=mtk/pkg/report/report.go
4.3 查看报告
-- 迁移结束后,会生成如下一些执行结果
-- report 各文件及目录含义
ora2mg/report/report_20230731130954/index.html html报告
ora2mg/report/report_20230731130954.txt 文本报告
ora2mg/report/report_20230731130954.warring 只包含警告信息的文本报告
ora2mg/report/report_20230731130954.err 只包含错误信息的文本报告
ora2mg/report/report_20230731130954.xlsx 包含导出过程的xlsx文件信息报告
ora2mg/report/report_20230731130842.log 导出过程日志记录
将report 目录report_xxx目录打包下载到本地电脑,然后解压后打开index.html文件,可查看导出的相关报告信息。
4.4 迁移数据
-- 采用如下方式迁移数据
[omm@opensource-db mtk_2.9.2_linux_amd64]$ ./mtk -c ora2gaussdb/config/mtk.json --file --dataOnly
-- 部分执行结果如下
time="2023-07-31 16:40:20.053455" level=info msg="Processing TableData XXXX.USER_xxxx_xxx_RECORD Reader Finish" function=func1 line=650 file="mtk/pkg/mtk/mtk_table_data.go" taskID=1685932911041187840
time="2023-07-31 16:40:20.055646" level=info msg="Processing TableData XXXX.USER_xxx_VERIFY_RECORD Writer Finish" function=func1 line=676 file="mtk/pkg/mtk/mtk_table_data.go" taskID=1685932911041187840
....
*********************************
Database Migration Toolkit Report
*********************************
--------------
Report Summary
--------------
| Name | Value |
|--------------------------------|---------------------|
| Source Database Type | oracle |
| Source Database Version | 11.2.0.4.0 |
| Source Database Charset | AL32UTF8 |
| Source Database DatCompat | |
| Target Database Type | file |
| Target Database Version | 5.0.0 |
| Target Database Charset | UTF8 |
| Target Database DatCompat | A |
| StartTime | 2023-07-31 16:38:24 |
| EndTime | 2023-07-31 16:40:42 |
| Time | 2 m 18 s |
| Status | finish |
| MTK Version | v2.9.2_26deaa81 |
-----------------------
Table Data Summary
-----------------------
+----------------------------------------+----------------------------------------+-------------------+-------------------+------+--------+----------+----------+----------+----------+
| SrcName | TgtName | StartTime | EndTime | Time| Status | Select | Insert |Ignore | Size |
+----------------------------------------+----------------------------------------+-------------------+-------------------+------+--------+----------+----------+----------+----------+
|XXXX.MLOG$xxxxx |XXXX.MLOG$xxxxx |2023-07-31 16:39:38|2023-07-31 16:39:38|3 ms |succeed | 0| 0| 0| 0|
|XXXX.XXXX |XXXX.XXXX |2023-07-31 16:40:32|2023-07-31 16:40:32|3 ms |succeed | 0| 0| 0| 0|
......
|XXXX.SYS_TEMP_FBT |XXXX.SYS_TEMP_FBT |2023-07-31 16:38:40|2023-07-31 16:38:40|0 ms |warring | 0| 0| 0| 0|
|XXXX.RUPD$_WT_OSS_ADMIN |XXXX.RUPD$_WT_OSS_ADMIN |2023-07-31 16:38:40|2023-07-31 16:38:40|0 ms |warring | 0| 0| 0| 0|
|XXXX.RUPD$_WT_OSS_ADMIN_ROLE |XXXX.RUPD$_WT_OSS_ADMIN_ROLE |2023-07-31 16:38:40|2023-07-31 16:38:40|0 ms |warring | 0| 0| 0| 0|
+----------------------------------------+----------------------------------------+-------------------+-------------------+------+--------+----------+----------+--------+----------+
-----------------------
ObjectName Type Summary
-----------------------
+------------------+-------------------+-------------------+--------+-----------+-------------+-------------+-------------+--------------------|-------------+
| Type | StartTime | EndTime | Status | Total Num | Success Num | Warring Num | Failed Num |Failed(Invalid) Num | Time |
+------------------+-------------------+-------------------+--------+-----------+-------------+-------------+-------------+--------------------|-------------+
|TableData |2023-07-31 16:38:24|2023-07-31 16:40:42|finish |558 |548 |10 |0 |0 |2 m 17 s 921 ms|
|AlterSequence |2023-07-31 16:40:42|2023-07-31 16:40:42|finish |477 |477 |0 |0 |0 |189 ms |
+------------------+-------------------+-------------------+--------+-----------+-------------+-------------+-------------+--------------------|-------------+
五、验证测试
数据迁移仅仅是第一步,在迁移过程中也出现了一些问题,比如部分表未迁移成功,表字段类型、存储过程、函数不兼容,如何跨字符集迁移,迁移后的SQL语句执行结果及效率,这方面还需要花大量时间去解决。可通过一些比对工具,比如恩墨的 MVD 工具可用于异构数据迁移或同步完成之后,校验源库与目标库之间的差异。生产环境迁移,更要慎重,可能会涉及业务代码改造。