一、DM-dimp 逻辑导入概述
1.1 DM-dimp 工具简介
DM-dimp 是达梦数据库 (DM Database) 提供的官方逻辑导入工具,与逻辑导出工具 dexp 配套使用。DM-dimp 逻辑导入的核心职责是将 dexp 导出的二进制文件 (通常为 .dmp 格式) 解析并恢复到目标达梦数据库实例中,实现跨环境的数据迁移与数据恢复。
DM-dimp 工具具有以下核心特征:
1.2 DM-dimp 逻辑导入应用场景
DM-dimp 逻辑导入在实际运维工作中覆盖以下典型场景:
1.3 DM-dimp 与 dexp 的协作关系
DM-dimp 与 dexp 构成达梦数据库逻辑备份恢复的完整闭环。dexp 负责从源数据库导出数据为 dmp 文件,DM-dimp 负责将 dmp 文件导入到目标数据库。两者在文件格式、对象类型、级别划分上保持完全一致,确保导出数据能够被准确还原。
#publish-mermaid-1786508095831-0{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#publish-mermaid-1786508095831-0 .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#publish-mermaid-1786508095831-0 .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#publish-mermaid-1786508095831-0 .error-icon{fill:#552222;}#publish-mermaid-1786508095831-0 .error-text{fill:#552222;stroke:#552222;}#publish-mermaid-1786508095831-0 .edge-thickness-normal{stroke-width:1px;}#publish-mermaid-1786508095831-0 .edge-thickness-thick{stroke-width:3.5px;}#publish-mermaid-1786508095831-0 .edge-pattern-solid{stroke-dasharray:0;}#publish-mermaid-1786508095831-0 .edge-thickness-invisible{stroke-width:0;fill:none;}#publish-mermaid-1786508095831-0 .edge-pattern-dashed{stroke-dasharray:3;}#publish-mermaid-1786508095831-0 .edge-pattern-dotted{stroke-dasharray:2;}#publish-mermaid-1786508095831-0 .marker{fill:#333333;stroke:#333333;}#publish-mermaid-1786508095831-0 .marker.cross{stroke:#333333;}#publish-mermaid-1786508095831-0 svg{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;}#publish-mermaid-1786508095831-0 p{margin:0;}#publish-mermaid-1786508095831-0 .label{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;color:#333;}#publish-mermaid-1786508095831-0 .cluster-label text{fill:#333;}#publish-mermaid-1786508095831-0 .cluster-label span{color:#333;}#publish-mermaid-1786508095831-0 .cluster-label span p{background-color:transparent;}#publish-mermaid-1786508095831-0 .label text,#publish-mermaid-1786508095831-0 span{fill:#333;color:#333;}#publish-mermaid-1786508095831-0 .node rect,#publish-mermaid-1786508095831-0 .node circle,#publish-mermaid-1786508095831-0 .node ellipse,#publish-mermaid-1786508095831-0 .node polygon,#publish-mermaid-1786508095831-0 .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#publish-mermaid-1786508095831-0 .rough-node .label text,#publish-mermaid-1786508095831-0 .node .label text,#publish-mermaid-1786508095831-0 .image-shape .label,#publish-mermaid-1786508095831-0 .icon-shape .label{text-anchor:middle;}#publish-mermaid-1786508095831-0 .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#publish-mermaid-1786508095831-0 .rough-node .label,#publish-mermaid-1786508095831-0 .node .label,#publish-mermaid-1786508095831-0 .image-shape .label,#publish-mermaid-1786508095831-0 .icon-shape .label{text-align:center;}#publish-mermaid-1786508095831-0 .node.clickable{cursor:pointer;}#publish-mermaid-1786508095831-0 .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#publish-mermaid-1786508095831-0 .arrowheadPath{fill:#333333;}#publish-mermaid-1786508095831-0 .edgePath .path{stroke:#333333;stroke-width:1px;}#publish-mermaid-1786508095831-0 .flowchart-link{stroke:#333333;fill:none;}#publish-mermaid-1786508095831-0 .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#publish-mermaid-1786508095831-0 .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#publish-mermaid-1786508095831-0 .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#publish-mermaid-1786508095831-0 .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#publish-mermaid-1786508095831-0 .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#publish-mermaid-1786508095831-0 .cluster text{fill:#333;}#publish-mermaid-1786508095831-0 .cluster span{color:#333;}#publish-mermaid-1786508095831-0 div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#publish-mermaid-1786508095831-0 .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#publish-mermaid-1786508095831-0 rect.text{fill:none;stroke-width:0;}#publish-mermaid-1786508095831-0 .icon-shape,#publish-mermaid-1786508095831-0 .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#publish-mermaid-1786508095831-0 .icon-shape p,#publish-mermaid-1786508095831-0 .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#publish-mermaid-1786508095831-0 .icon-shape .label rect,#publish-mermaid-1786508095831-0 .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#publish-mermaid-1786508095831-0 .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#publish-mermaid-1786508095831-0 .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#publish-mermaid-1786508095831-0 .node .neo-node{stroke:#9370DB;}#publish-mermaid-1786508095831-0 [data-look=\”neo\”].node rect,#publish-mermaid-1786508095831-0 [data-look=\”neo\”].cluster rect,#publish-mermaid-1786508095831-0 [data-look=\”neo\”].node polygon{stroke:#9370DB;filter:drop-shadow(1px 2px 2px rgba(185, 185, 185, 1));}#publish-mermaid-1786508095831-0 [data-look=\”neo\”].swimlane.cluster rect{filter:none;}#publish-mermaid-1786508095831-0 [data-look=\”neo\”].node path{stroke:#9370DB;stroke-width:1px;}#publish-mermaid-1786508095831-0 [data-look=\”neo\”].node .outer-path{filter:drop-shadow(1px 2px 2px rgba(185, 185, 185, 1));}#publish-mermaid-1786508095831-0 [data-look=\”neo\”].node .neo-line path{stroke:#9370DB;filter:none;}#publish-mermaid-1786508095831-0 [data-look=\”neo\”].node circle{stroke:#9370DB;filter:drop-shadow(1px 2px 2px rgba(185, 185, 185, 1));}#publish-mermaid-1786508095831-0 [data-look=\”neo\”].node circle .state-start{fill:#000000;}#publish-mermaid-1786508095831-0 [data-look=\”neo\”].icon-shape .icon{fill:#9370DB;filter:drop-shadow(1px 2px 2px rgba(185, 185, 185, 1));}#publish-mermaid-1786508095831-0 [data-look=\”neo\”].icon-shape .icon-neo path{stroke:#9370DB;filter:drop-shadow(1px 2px 2px rgba(185, 185, 185, 1));}#publish-mermaid-1786508095831-0 :root{–mermaid-font-family:\”trebuchet ms\”,verdana,arial,sans-serif;}dexp 逻辑导出文件传输DM-dimp 逻辑导入数据验证
源 DM 数据库
dmp 文件
目标服务器
目标 DM 数据库
导入完成
二、DM-dimp 逻辑导入使用准备
2.1 环境检查与前提条件
在执行 DM-dimp 逻辑导入之前,需要完成以下环境检查工作:
2.2 参数说明与常用选项
DM-dimp 逻辑导入工具提供丰富的参数选项,以下为常用参数的详细说明:
| 参数名称 | 参数说明 | 示例值 |
|———|———|——-|
| USERID | 数据库连接信息,格式为 用户名/密码@主机:端口 | SYSDBA/SYSDBA@127.0.0.1:5236 |
| FILE | 导入文件名称,多个文件用逗号分隔 | dexp_full.dmp |
| LOG | 日志文件名称 | dimp_full.log |
| DIRECTORY | 导入文件所在目录路径 | /dm8/backup |
| FULL | 是否全库导入,Y 表示是,N 表示否 | Y |
| OWNER | 按用户导入,指定用户名列表 | USER1,USER2 |
| SCHEMAS | 按模式导入,指定模式名列表 | SCH1,SCH2 |
| TABLES | 按表导入,指定表名列表 | SCH1.TAB1,SCH1.TAB2 |
| IGNORE | 导入出错时是否忽略继续,Y 或 N | Y |
| ROWS | 是否导入数据行,Y 或 N | Y |
| INDEXES | 是否导入索引,Y 或 N | Y |
| CONSTRAINTS | 是否导入约束,Y 或 N | Y |
| TRIGGERS | 是否导入触发器,Y 或 N | Y |
| GRANTS | 是否导入权限,Y 或 N | Y |
| STATISTICS | 是否导入统计信息,Y 或 N | Y |
| TABLE_EXISTS_ACTION | 表已存在时的处理方式 (SKIP/APPEND/TRUNCATE/REPLACE) | REPLACE |
| PARALLEL | 并行度,加速导入 | 4 |
| FEEDBACK | 进度反馈间隔,单位为行数 | 10000 |
重要提示: FULL、OWNER、SCHEMAS、TABLES 四个级别参数互斥,同一命令中只能指定其中一个。
2.3 导入文件准备
在执行 DM-dimp 逻辑导入前,需确保 dmp 文件已就位:
三、DM-dimp 逻辑导入操作步骤
3.1 启动 DM-dimp 工具
DM-dimp 工具位于达梦数据库安装目录的 bin 子目录下。按照以下步骤启动工具:
3.2 执行导入命令
以下以模式级导入为例,演示 DM-dimp 逻辑导入的完整执行过程:
./dimp USERID=SYSDBA/SYSDBA@127.0.0.1:5236 \\
FILE=/dm8/backup/dexp_schemas.dmp \\
LOG=/dm8/backup/dimp_schemas.log \\
DIRECTORY=/dm8/backup \\
SCHEMAS=TEST_SCHEMA \\
ROWS=Y \\
INDEXES=Y \\
CONSTRAINTS=Y \\
TABLE_EXISTS_ACTION=REPLACE \\
PARALLEL=4 \\
FEEDBACK=10000
- USERID 指定以 SYSDBA 用户连接本机 5236 端口的数据库实例。
- FILE 指定导入文件为 dexp_schemas.dmp。
- LOG 指定日志输出文件为 dimp_schemas.log。
- SCHEMAS 指定导入模式为 TEST_SCHEMA。
- TABLE_EXISTS_ACTION 设为 REPLACE,表示目标表已存在时先删除再创建。
- PARALLEL 设为 4,启用 4 线程并行导入。
#publish-mermaid-1786508095888-1{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#publish-mermaid-1786508095888-1 .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#publish-mermaid-1786508095888-1 .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#publish-mermaid-1786508095888-1 .error-icon{fill:#552222;}#publish-mermaid-1786508095888-1 .error-text{fill:#552222;stroke:#552222;}#publish-mermaid-1786508095888-1 .edge-thickness-normal{stroke-width:1px;}#publish-mermaid-1786508095888-1 .edge-thickness-thick{stroke-width:3.5px;}#publish-mermaid-1786508095888-1 .edge-pattern-solid{stroke-dasharray:0;}#publish-mermaid-1786508095888-1 .edge-thickness-invisible{stroke-width:0;fill:none;}#publish-mermaid-1786508095888-1 .edge-pattern-dashed{stroke-dasharray:3;}#publish-mermaid-1786508095888-1 .edge-pattern-dotted{stroke-dasharray:2;}#publish-mermaid-1786508095888-1 .marker{fill:#333333;stroke:#333333;}#publish-mermaid-1786508095888-1 .marker.cross{stroke:#333333;}#publish-mermaid-1786508095888-1 svg{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;}#publish-mermaid-1786508095888-1 p{margin:0;}#publish-mermaid-1786508095888-1 .label{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;color:#333;}#publish-mermaid-1786508095888-1 .cluster-label text{fill:#333;}#publish-mermaid-1786508095888-1 .cluster-label span{color:#333;}#publish-mermaid-1786508095888-1 .cluster-label span p{background-color:transparent;}#publish-mermaid-1786508095888-1 .label text,#publish-mermaid-1786508095888-1 span{fill:#333;color:#333;}#publish-mermaid-1786508095888-1 .node rect,#publish-mermaid-1786508095888-1 .node circle,#publish-mermaid-1786508095888-1 .node ellipse,#publish-mermaid-1786508095888-1 .node polygon,#publish-mermaid-1786508095888-1 .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#publish-mermaid-1786508095888-1 .rough-node .label text,#publish-mermaid-1786508095888-1 .node .label text,#publish-mermaid-1786508095888-1 .image-shape .label,#publish-mermaid-1786508095888-1 .icon-shape .label{text-anchor:middle;}#publish-mermaid-1786508095888-1 .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#publish-mermaid-1786508095888-1 .rough-node .label,#publish-mermaid-1786508095888-1 .node .label,#publish-mermaid-1786508095888-1 .image-shape .label,#publish-mermaid-1786508095888-1 .icon-shape .label{text-align:center;}#publish-mermaid-1786508095888-1 .node.clickable{cursor:pointer;}#publish-mermaid-1786508095888-1 .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#publish-mermaid-1786508095888-1 .arrowheadPath{fill:#333333;}#publish-mermaid-1786508095888-1 .edgePath .path{stroke:#333333;stroke-width:1px;}#publish-mermaid-1786508095888-1 .flowchart-link{stroke:#333333;fill:none;}#publish-mermaid-1786508095888-1 .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#publish-mermaid-1786508095888-1 .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#publish-mermaid-1786508095888-1 .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#publish-mermaid-1786508095888-1 .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#publish-mermaid-1786508095888-1 .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#publish-mermaid-1786508095888-1 .cluster text{fill:#333;}#publish-mermaid-1786508095888-1 .cluster span{color:#333;}#publish-mermaid-1786508095888-1 div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#publish-mermaid-1786508095888-1 .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#publish-mermaid-1786508095888-1 rect.text{fill:none;stroke-width:0;}#publish-mermaid-1786508095888-1 .icon-shape,#publish-mermaid-1786508095888-1 .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#publish-mermaid-1786508095888-1 .icon-shape p,#publish-mermaid-1786508095888-1 .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#publish-mermaid-1786508095888-1 .icon-shape .label rect,#publish-mermaid-1786508095888-1 .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#publish-mermaid-1786508095888-1 .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#publish-mermaid-1786508095888-1 .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#publish-mermaid-1786508095888-1 .node .neo-node{stroke:#9370DB;}#publish-mermaid-1786508095888-1 [data-look=\”neo\”].node rect,#publish-mermaid-1786508095888-1 [data-look=\”neo\”].cluster rect,#publish-mermaid-1786508095888-1 [data-look=\”neo\”].node polygon{stroke:#9370DB;filter:drop-shadow(1px 2px 2px rgba(185, 185, 185, 1));}#publish-mermaid-1786508095888-1 [data-look=\”neo\”].swimlane.cluster rect{filter:none;}#publish-mermaid-1786508095888-1 [data-look=\”neo\”].node path{stroke:#9370DB;stroke-width:1px;}#publish-mermaid-1786508095888-1 [data-look=\”neo\”].node .outer-path{filter:drop-shadow(1px 2px 2px rgba(185, 185, 185, 1));}#publish-mermaid-1786508095888-1 [data-look=\”neo\”].node .neo-line path{stroke:#9370DB;filter:none;}#publish-mermaid-1786508095888-1 [data-look=\”neo\”].node circle{stroke:#9370DB;filter:drop-shadow(1px 2px 2px rgba(185, 185, 185, 1));}#publish-mermaid-1786508095888-1 [data-look=\”neo\”].node circle .state-start{fill:#000000;}#publish-mermaid-1786508095888-1 [data-look=\”neo\”].icon-shape .icon{fill:#9370DB;filter:drop-shadow(1px 2px 2px rgba(185, 185, 185, 1));}#publish-mermaid-1786508095888-1 [data-look=\”neo\”].icon-shape .icon-neo path{stroke:#9370DB;filter:drop-shadow(1px 2px 2px rgba(185, 185, 185, 1));}#publish-mermaid-1786508095888-1 :root{–mermaid-font-family:\”trebuchet ms\”,verdana,arial,sans-serif;}否是否是
启动 DM-dimp 工具
解析命令行参数
连接目标数据库
连接是否成功
输出错误信息并退出
读取 dmp 文件头部信息
文件格式是否兼容
报错并退出
按级别解析对象元数据
创建或替换数据库对象
导入数据行
重建索引与约束
导入触发器与权限
导入统计信息
生成导入日志
导入完成
- 对象创建成功或失败的提示信息。
- 数据行导入的进度反馈计数。
- 索引重建与约束启用的状态记录。
- 最终的导入统计摘要信息。
3.3 导入结果验证
DM-dimp 逻辑导入执行完毕后,需要从多个维度验证导入结果:
— 查询模式下的表对象数量
SELECT COUNT(*) FROM ALL_TABLES WHERE OWNER = 'TEST_SCHEMA';
— 查询无效对象
SELECT OBJECT_NAME, OBJECT_TYPE, STATUS
FROM ALL_OBJECTS
WHERE OWNER = 'TEST_SCHEMA' AND STATUS != 'VALID';
四、DM-dimp 逻辑导入进阶应用
4.1 模式级导入
模式级导入是 DM-dimp 逻辑导入最常用的级别之一,适用于按业务模块进行数据迁移的场景。
./dimp USERID=SYSDBA/SYSDBA@127.0.0.1:5236 \\
FILE=/dm8/backup/dexp_sch.dmp \\
LOG=/dm8/backup/dimp_sch.log \\
DIRECTORY=/dm8/backup \\
SCHEMAS=HR_SALES,HR_FINANCE
./dimp USERID=SYSDBA/SYSDBA@127.0.0.1:5236 \\
FILE=/dm8/backup/dexp_sch.dmp \\
LOG=/dm8/backup/dimp_sch.log \\
DIRECTORY=/dm8/backup \\
SCHEMAS=HR_SALES \\
REMAP_SCHEMA=HR_SALES:HR_SALES_NEW
./dimp USERID=SYSDBA/SYSDBA@127.0.0.1:5236 \\
FILE=/dm8/backup/dexp_sch.dmp \\
LOG=/dm8/backup/dimp_sch.log \\
DIRECTORY=/dm8/backup \\
SCHEMAS=HR_SALES \\
EXCLUDE=INDEXES
4.2 表级导入
表级导入适用于精细化的数据迁移需求,只导入指定的表及其数据。
./dimp USERID=SYSDBA/SYSDBA@127.0.0.1:5236 \\
FILE=/dm8/backup/dexp_tab.dmp \\
LOG=/dm8/backup/dimp_tab.log \\
DIRECTORY=/dm8/backup \\
TABLES=HR_SALES.EMPLOYEES,HR_SALES.DEPARTMENTS
./dimp USERID=SYSDBA/SYSDBA@127.0.0.1:5236 \\
FILE=/dm8/backup/dexp_tab.dmp \\
LOG=/dm8/backup/dimp_tab.log \\
DIRECTORY=/dm8/backup \\
TABLES=HR_SALES.EMPLOYEES \\
ROWS=N
./dimp USERID=SYSDBA/SYSDBA@127.0.0.1:5236 \\
FILE=/dm8/backup/dexp_tab.dmp \\
LOG=/dm8/backup/dimp_tab.log \\
DIRECTORY=/dm8/backup \\
TABLES=HR_SALES.EMPLOYEES \\
TABLE_EXISTS_ACTION=APPEND \\
IGNORE=Y
4.3 用户级导入与全库导入
用户级导入
用户级导入以数据库用户为单位,导入该用户下的所有对象和数据。
./dimp USERID=SYSDBA/SYSDBA@127.0.0.1:5236 \\
FILE=/dm8/backup/dexp_user.dmp \\
LOG=/dm8/backup/dimp_user.log \\
DIRECTORY=/dm8/backup \\
OWNER=HR_USER
./dimp USERID=SYSDBA/SYSDBA@127.0.0.1:5236 \\
FILE=/dm8/backup/dexp_user.dmp \\
LOG=/dm8/backup/dimp_user.log \\
DIRECTORY=/dm8/backup \\
OWNER=HR_USER,FIN_USER
全库导入
全库导入将 dmp 文件中的所有数据库对象导入到目标库,适用于整库迁移或灾备恢复场景。
./dimp USERID=SYSDBA/SYSDBA@127.0.0.1:5236 \\
FILE=/dm8/backup/dexp_full.dmp \\
LOG=/dm8/backup/dimp_full.log \\
DIRECTORY=/dm8/backup \\
FULL=Y \\
PARALLEL=8
- 全库导入要求执行用户具有 DBA 权限。
- 导入前需确认目标库中系统对象状态,避免与导入的系统对象产生冲突。
- 全库导入耗时长,建议在业务低峰期执行。
五、DM-dimp 逻辑导入常见问题与优化
5.1 常见错误处理
在 DM-dimp 逻辑导入过程中,可能遇到以下常见问题及处理方法:
- 现象: 日志中出现 "表空间不足" 或 "无法扩展" 错误。
- 处理: 为对应表空间增加数据文件或扩展现有数据文件大小。
- 现象: 导入时报 "对象已存在" 错误。
- 处理: 设置 TABLE_EXISTS_ACTION 参数为 REPLACE 或 TRUNCATE,或设置 IGNORE=Y 跳过错误。
- 现象: 导入后中文数据显示乱码。
- 处理: 检查源库与目标库字符集,必要时修改目标库字符集或使用字符集转换工具。
- 现象: 导入时报 "权限不足" 错误。
- 处理: 为执行导入的用户授予相应权限,或使用具有 DBA 权限的用户执行导入。
- 现象: 导入大表时报内存不足错误。
- 处理: 调整 dm.ini 中的 MEMORY_POOL、SORT_BUF_SIZE 等参数,或降低 PARALLEL 并行度。
5.2 性能优化建议
为提升 DM-dimp 逻辑导入的效率,可采取以下优化措施:
#publish-mermaid-1786508096004-2{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#publish-mermaid-1786508096004-2 .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#publish-mermaid-1786508096004-2 .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#publish-mermaid-1786508096004-2 .error-icon{fill:#552222;}#publish-mermaid-1786508096004-2 .error-text{fill:#552222;stroke:#552222;}#publish-mermaid-1786508096004-2 .edge-thickness-normal{stroke-width:1px;}#publish-mermaid-1786508096004-2 .edge-thickness-thick{stroke-width:3.5px;}#publish-mermaid-1786508096004-2 .edge-pattern-solid{stroke-dasharray:0;}#publish-mermaid-1786508096004-2 .edge-thickness-invisible{stroke-width:0;fill:none;}#publish-mermaid-1786508096004-2 .edge-pattern-dashed{stroke-dasharray:3;}#publish-mermaid-1786508096004-2 .edge-pattern-dotted{stroke-dasharray:2;}#publish-mermaid-1786508096004-2 .marker{fill:#333333;stroke:#333333;}#publish-mermaid-1786508096004-2 .marker.cross{stroke:#333333;}#publish-mermaid-1786508096004-2 svg{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;}#publish-mermaid-1786508096004-2 p{margin:0;}#publish-mermaid-1786508096004-2 .label{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;color:#333;}#publish-mermaid-1786508096004-2 .cluster-label text{fill:#333;}#publish-mermaid-1786508096004-2 .cluster-label span{color:#333;}#publish-mermaid-1786508096004-2 .cluster-label span p{background-color:transparent;}#publish-mermaid-1786508096004-2 .label text,#publish-mermaid-1786508096004-2 span{fill:#333;color:#333;}#publish-mermaid-1786508096004-2 .node rect,#publish-mermaid-1786508096004-2 .node circle,#publish-mermaid-1786508096004-2 .node ellipse,#publish-mermaid-1786508096004-2 .node polygon,#publish-mermaid-1786508096004-2 .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#publish-mermaid-1786508096004-2 .rough-node .label text,#publish-mermaid-1786508096004-2 .node .label text,#publish-mermaid-1786508096004-2 .image-shape .label,#publish-mermaid-1786508096004-2 .icon-shape .label{text-anchor:middle;}#publish-mermaid-1786508096004-2 .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#publish-mermaid-1786508096004-2 .rough-node .label,#publish-mermaid-1786508096004-2 .node .label,#publish-mermaid-1786508096004-2 .image-shape .label,#publish-mermaid-1786508096004-2 .icon-shape .label{text-align:center;}#publish-mermaid-1786508096004-2 .node.clickable{cursor:pointer;}#publish-mermaid-1786508096004-2 .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#publish-mermaid-1786508096004-2 .arrowheadPath{fill:#333333;}#publish-mermaid-1786508096004-2 .edgePath .path{stroke:#333333;stroke-width:1px;}#publish-mermaid-1786508096004-2 .flowchart-link{stroke:#333333;fill:none;}#publish-mermaid-1786508096004-2 .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#publish-mermaid-1786508096004-2 .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#publish-mermaid-1786508096004-2 .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#publish-mermaid-1786508096004-2 .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#publish-mermaid-1786508096004-2 .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#publish-mermaid-1786508096004-2 .cluster text{fill:#333;}#publish-mermaid-1786508096004-2 .cluster span{color:#333;}#publish-mermaid-1786508096004-2 div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#publish-mermaid-1786508096004-2 .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#publish-mermaid-1786508096004-2 rect.text{fill:none;stroke-width:0;}#publish-mermaid-1786508096004-2 .icon-shape,#publish-mermaid-1786508096004-2 .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#publish-mermaid-1786508096004-2 .icon-shape p,#publish-mermaid-1786508096004-2 .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#publish-mermaid-1786508096004-2 .icon-shape .label rect,#publish-mermaid-1786508096004-2 .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#publish-mermaid-1786508096004-2 .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#publish-mermaid-1786508096004-2 .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#publish-mermaid-1786508096004-2 .node .neo-node{stroke:#9370DB;}#publish-mermaid-1786508096004-2 [data-look=\”neo\”].node rect,#publish-mermaid-1786508096004-2 [data-look=\”neo\”].cluster rect,#publish-mermaid-1786508096004-2 [data-look=\”neo\”].node polygon{stroke:#9370DB;filter:drop-shadow(1px 2px 2px rgba(185, 185, 185, 1));}#publish-mermaid-1786508096004-2 [data-look=\”neo\”].swimlane.cluster rect{filter:none;}#publish-mermaid-1786508096004-2 [data-look=\”neo\”].node path{stroke:#9370DB;stroke-width:1px;}#publish-mermaid-1786508096004-2 [data-look=\”neo\”].node .outer-path{filter:drop-shadow(1px 2px 2px rgba(185, 185, 185, 1));}#publish-mermaid-1786508096004-2 [data-look=\”neo\”].node .neo-line path{stroke:#9370DB;filter:none;}#publish-mermaid-1786508096004-2 [data-look=\”neo\”].node circle{stroke:#9370DB;filter:drop-shadow(1px 2px 2px rgba(185, 185, 185, 1));}#publish-mermaid-1786508096004-2 [data-look=\”neo\”].node circle .state-start{fill:#000000;}#publish-mermaid-1786508096004-2 [data-look=\”neo\”].icon-shape .icon{fill:#9370DB;filter:drop-shadow(1px 2px 2px rgba(185, 185, 185, 1));}#publish-mermaid-1786508096004-2 [data-look=\”neo\”].icon-shape .icon-neo path{stroke:#9370DB;filter:drop-shadow(1px 2px 2px rgba(185, 185, 185, 1));}#publish-mermaid-1786508096004-2 :root{–mermaid-font-family:\”trebuchet ms\”,verdana,arial,sans-serif;}
DM-dimp 性能优化
并行度优化
对象导入控制
内存参数调优
提交频率控制
分批导入策略
PARALLEL 设为 4-8
按需关闭索引/约束/触发器
增大 SORT_BUF_SIZE
合理设置 COMMIT 参数
按模式或表分批执行
5.3 最佳实践总结
结合实际运维经验,DM-dimp 逻辑导入的最佳实践总结如下:
网硕互联帮助中心


评论前必须登录!
注册