达梦数据库备份恢复操作指南
<h3 style="font-variant: normal; white-space: normal; font-size-adjust: none; font-language-override: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 20px; line-height: 30px; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; margin: 32px 0px 16px; color: rgb(15, 17, 21); background-color: rgb(255, 255, 255);"><strong><span style="font-size: 24px;">达梦数据库库级还原恢复</span></strong></h3><p style="margin-bottom: 16px; color: rgb(15, 17, 21); font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; white-space: normal; background-color: rgb(255, 255, 255); line-height: 1.75em; margin-top: 0px !important;">达梦数据库的库级恢复是生产环境最核心的灾备操作。当出现数据文件损坏、系统表空间故障或需要回滚到某个历史状态时,库级恢复是唯一能将数据库整体拉起的方案。</p><p style="margin: 16px 0px; color: rgb(15, 17, 21); font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; white-space: normal; background-color: rgb(255, 255, 255); line-height: 1.75em;">库级恢复的核心是 <span style="font-weight: 600;"><code style="box-sizing: border-box; font-variant: normal; font-weight: 400; font-stretch: 100%; line-height: 22px; font-optical-sizing: auto; font-size-adjust: none; font-kerning: auto; font-feature-settings: normal; font-variation-settings: normal; font-language-override: normal; font-family: Menlo, Monaco, Consolas, "Cascadia Mono", "Ubuntu Mono", "DejaVu Sans Mono", "Liberation Mono", "JetBrains Mono", "Fira Code", Cousine, "Roboto Mono", "Courier New", Courier, sans-serif, system-ui; background-color: rgb(235, 238, 242); border-radius: 6px; align-items: center; padding: 0px 5px; display: inline-flex; font-size: 0.875em !important;">dmrman</code>(脱机备份还原管理工具)</span>,必须三步走:<span style="font-weight: 600;">RESTORE(还原)→ RECOVER(恢复)→ UPDATE DB_MAGIC(更新魔数)</span>。</p><hr style="background: none 0% 0% / auto repeat scroll padding-box border-box rgba(0, 0, 0, 0.1); border-width: medium; border-style: none; border-color: currentcolor; border-image: initial; height: 1px; margin: 32px 0px; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; white-space: normal;"/><h3 style="font-style: normal; font-variant: normal; font-size-adjust: none; font-language-override: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 20px; line-height: 30px; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; margin: 32px 0px 16px; color: rgb(15, 17, 21); white-space: normal; background-color: rgb(255, 255, 255);"><strong>使用 dmrman 进行库级恢复(命令行标准操作)</strong></h3><p class="ds-markdown-paragraph" style="margin: 16px 0px; color: rgb(15, 17, 21); font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; white-space: normal; background-color: rgb(255, 255, 255);">这是生产环境最推荐的方式,通过命令行精准控制。</p><h4 style="font-style: normal; font-variant: normal; font-size-adjust: none; font-language-override: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 16px; line-height: 28px; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; margin: 16px 0px; color: rgb(15, 17, 21); white-space: normal; background-color: rgb(255, 255, 255);"><strong>1. 恢复前的准备</strong></h4><pre class="brush:bash;toolbar:false"># 1. 停止数据库服务(必须)
cd /dm8/bin
./DmServiceDMSERVER stop
# 2. 确认 DmAPService 服务已启动(物理备份恢复依赖此辅助进程)
./DmAPService start
./DmAPService status   # 确认状态为 active</pre><h4 style="font-style: normal; font-variant: normal; font-size-adjust: none; font-language-override: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 16px; line-height: 28px; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; margin: 16px 0px; color: rgb(15, 17, 21); white-space: normal; background-color: rgb(255, 255, 255);"><strong>2. 执行"三步曲"恢复</strong></h4><p class="ds-markdown-paragraph" style="margin: 16px 0px; color: rgb(15, 17, 21); font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; white-space: normal; background-color: rgb(255, 255, 255);">进入 <code style="box-sizing: border-box; font-variant: normal; font-stretch: 100%; line-height: 22px; font-optical-sizing: auto; font-size-adjust: none; font-kerning: auto; font-feature-settings: normal; font-variation-settings: normal; font-language-override: normal; font-family: Menlo, Monaco, Consolas, "Cascadia Mono", "Ubuntu Mono", "DejaVu Sans Mono", "Liberation Mono", "JetBrains Mono", "Fira Code", Cousine, "Roboto Mono", "Courier New", Courier, sans-serif, system-ui; background-color: rgb(235, 238, 242); border-radius: 6px; align-items: center; padding: 0px 5px; display: inline-flex; font-size: 0.875em !important;">dmrman</code> 交互界面,按顺序执行以下三条命令<a href="https://eco.dameng.com/community/article/cc681fe2a07050114dc2d82dc0712766" target="_blank" rel="noreferrer noopener" style="color: rgb(57, 100, 254); transition: box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1); border-width: 2px 3px; border-style: solid; border-color: rgba(255, 255, 255, 0); margin-left: -3px; margin-right: -3px; text-decoration: none; position: relative; cursor: default;"></a><a href="https://eco.dameng.com/community/question/eeef03af26ba2180c81dd4440aac1f54" target="_blank" rel="noreferrer noopener" style="color: rgb(57, 100, 254); transition: box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1); border-width: 2px 3px; border-style: solid; border-color: rgba(255, 255, 255, 0); margin-left: -3px; margin-right: -3px; text-decoration: none; position: relative; cursor: default;"></a>:</p><div class="ds-scroll-area ds-scroll-area--show-on-focus-within _1210dd7 c03cafe9" style="z-index: 0; --ds-scroll-area-gutters-disappear-delay: 1s; position: relative; overflow-x: auto; scrollbar-width: none; color: rgb(15, 17, 21); font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; white-space: normal; background-color: rgb(255, 255, 255);"><table width="752"><thead><tr class="firstRow"><th style="border-bottom: 1px solid rgba(0, 0, 0, 0.12); font: 500 15px / 25px quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; border-top-width: medium; border-top-style: none; border-top-color: currentcolor; padding: 10px 16px 10px 0px; text-align: left;">步骤</th><th style="border-bottom: 1px solid rgba(0, 0, 0, 0.12); font: 500 15px / 25px quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; border-top-width: medium; border-top-style: none; border-top-color: currentcolor; padding: 10px 16px; text-align: left;">命令</th><th style="border-bottom: 1px solid rgba(0, 0, 0, 0.12); font: 500 15px / 25px quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; border-top-width: medium; border-top-style: none; border-top-color: currentcolor; padding: 10px 16px; text-align: left;">作用说明</th></tr></thead><tbody><tr><td style="border-bottom: 1px solid rgba(0, 0, 0, 0.1); font-style: normal; font-variant: normal; font-size-adjust: none; font-language-override: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 15px; line-height: 25px; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; min-width: 100px; max-width: min(30vw, 320px); padding: 10px 16px 10px 0px;"><span style="font-weight: 600;">1. 还原</span></td><td style="border-bottom: 1px solid rgba(0, 0, 0, 0.1); font-style: normal; font-variant: normal; font-size-adjust: none; font-language-override: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 15px; line-height: 25px; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; min-width: 100px; max-width: min(30vw, 320px); padding: 10px 16px;"><code style="box-sizing: border-box; font-style: normal; font-variant: normal; font-size-adjust: none; font-language-override: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 13px; line-height: 22px; font-family: Menlo, Monaco, Consolas, "Cascadia Mono", "Ubuntu Mono", "DejaVu Sans Mono", "Liberation Mono", "JetBrains Mono", "Fira Code", Cousine, "Roboto Mono", "Courier New", Courier, sans-serif, system-ui; background-color: rgb(235, 238, 242); border-radius: 6px; align-items: center; padding: 0px 5px; display: inline-flex;">RESTORE DATABASE '/dm8/data/DAMENG/dm.ini' FROM BACKUPSET '/dm8/backup/full';</code></td><td style="border-bottom: 1px solid rgba(0, 0, 0, 0.1); font-style: normal; font-variant: normal; font-size-adjust: none; font-language-override: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 15px; line-height: 25px; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; min-width: 100px; max-width: min(30vw, 320px); padding: 10px 0px 10px 16px;">将备份集中的有效数据页重新写入目标数据文件,使数据文件回到备份时刻的状态<a href="https://blog.csdn.net/qq_45111959/article/details/147334660" target="_blank" rel="noreferrer noopener" style="color: rgb(57, 100, 254); transition: box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1); border-width: 2px 3px; border-style: solid; border-color: rgba(255, 255, 255, 0); margin-left: -3px; margin-right: -3px; text-decoration: none; position: relative; cursor: default;"></a>。</td></tr><tr><td style="border-bottom: 1px solid rgba(0, 0, 0, 0.1); font-style: normal; font-variant: normal; font-size-adjust: none; font-language-override: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 15px; line-height: 25px; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; min-width: 100px; max-width: min(30vw, 320px); padding: 10px 16px 10px 0px;"><span style="font-weight: 600;">2. 恢复</span></td><td style="border-bottom: 1px solid rgba(0, 0, 0, 0.1); font-style: normal; font-variant: normal; font-size-adjust: none; font-language-override: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 15px; line-height: 25px; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; min-width: 100px; max-width: min(30vw, 320px); padding: 10px 16px;"><code style="box-sizing: border-box; font-style: normal; font-variant: normal; font-size-adjust: none; font-language-override: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 13px; line-height: 22px; font-family: Menlo, Monaco, Consolas, "Cascadia Mono", "Ubuntu Mono", "DejaVu Sans Mono", "Liberation Mono", "JetBrains Mono", "Fira Code", Cousine, "Roboto Mono", "Courier New", Courier, sans-serif, system-ui; background-color: rgb(235, 238, 242); border-radius: 6px; align-items: center; padding: 0px 5px; display: inline-flex;">RECOVER DATABASE '/dm8/data/DAMENG/dm.ini' WITH ARCHIVEDIR '/dm8/arch';</code></td><td style="border-bottom: 1px solid rgba(0, 0, 0, 0.1); font-style: normal; font-variant: normal; font-size-adjust: none; font-language-override: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 15px; line-height: 25px; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; min-width: 100px; max-width: min(30vw, 320px); padding: 10px 0px 10px 16px;">重做归档日志,将数据库前滚到故障发生前的最后时刻(保证数据不丢)<a href="https://blog.csdn.net/qq_45111959/article/details/147334660" target="_blank" rel="noreferrer noopener" style="color: rgb(57, 100, 254); transition: box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1); border-width: 2px 3px; border-style: solid; border-color: rgba(255, 255, 255, 0); margin-left: -3px; margin-right: -3px; text-decoration: none; position: relative; cursor: default;"></a><a href="https://eco.dameng.com/community/article/f6ecc8f22e34c1c0a751af5fcf58e115" target="_blank" rel="noreferrer noopener" style="color: rgb(57, 100, 254); transition: box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1); border-width: 2px 3px; border-style: solid; border-color: rgba(255, 255, 255, 0); margin-left: -3px; margin-right: -3px; text-decoration: none; position: relative; cursor: default;"></a>。</td></tr><tr><td style="border-bottom: 1px solid rgba(0, 0, 0, 0.1); font-style: normal; font-variant: normal; font-size-adjust: none; font-language-override: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 15px; line-height: 25px; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; min-width: 100px; max-width: min(30vw, 320px); padding: 10px 16px 10px 0px;"><span style="font-weight: 600;">3. 更新魔数</span></td><td style="border-bottom: 1px solid rgba(0, 0, 0, 0.1); font-style: normal; font-variant: normal; font-size-adjust: none; font-language-override: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 15px; line-height: 25px; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; min-width: 100px; max-width: min(30vw, 320px); padding: 10px 16px;"><code style="box-sizing: border-box; font-style: normal; font-variant: normal; font-size-adjust: none; font-language-override: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 13px; line-height: 22px; font-family: Menlo, Monaco, Consolas, "Cascadia Mono", "Ubuntu Mono", "DejaVu Sans Mono", "Liberation Mono", "JetBrains Mono", "Fira Code", Cousine, "Roboto Mono", "Courier New", Courier, sans-serif, system-ui; background-color: rgb(235, 238, 242); border-radius: 6px; align-items: center; padding: 0px 5px; display: inline-flex;">RECOVER DATABASE '/dm8/data/DAMENG/dm.ini' UPDATE DB_MAGIC;</code></td><td style="border-bottom: 1px solid rgba(0, 0, 0, 0.1); font-style: normal; font-variant: normal; font-size-adjust: none; font-language-override: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 15px; line-height: 25px; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; min-width: 100px; max-width: min(30vw, 320px); padding: 10px 0px 10px 16px;">更新数据库唯一标识,解决“还原后的库与原集群混淆”的问题,<span style="font-weight: 600;">库级恢复必须执行此步</span><a href="https://eco.dameng.com/community/training/205d82526b5207229d393722fbae3b52" target="_blank" rel="noreferrer noopener" style="color: rgb(57, 100, 254); transition: box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1); border-width: 2px 3px; border-style: solid; border-color: rgba(255, 255, 255, 0); margin-left: -3px; margin-right: -3px; text-decoration: none; position: relative; cursor: default;"></a><a href="https://eco.dameng.com/community/article/f6ecc8f22e34c1c0a751af5fcf58e115" target="_blank" rel="noreferrer noopener" style="color: rgb(57, 100, 254); transition: box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1); border-width: 2px 3px; border-style: solid; border-color: rgba(255, 255, 255, 0); margin-left: -3px; margin-right: -3px; text-decoration: none; position: relative; cursor: default;"></a>。</td></tr></tbody></table></div><blockquote style="border-left: 2px solid rgb(173, 178, 184); margin: 16px 0px 0px; padding-left: 14px; color: rgb(15, 17, 21); font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; white-space: normal; background-color: rgb(255, 255, 255);"><p class="ds-markdown-paragraph" style="margin-bottom: 16px; margin-top: 0px !important;"><span style="font-weight: 600;">路径说明</span>:</p><ul style="margin: 16px 0px; padding-left: 18px;" class=" list-paddingleft-2"><li><p style="margin-bottom: 0px; line-height: 1.75em; margin-top: 0px !important;"><code style="box-sizing: border-box; font-variant: normal; font-stretch: 100%; line-height: 22px; font-optical-sizing: auto; font-size-adjust: none; font-kerning: auto; font-feature-settings: normal; font-variation-settings: normal; font-language-override: normal; font-family: Menlo, Monaco, Consolas, "Cascadia Mono", "Ubuntu Mono", "DejaVu Sans Mono", "Liberation Mono", "JetBrains Mono", "Fira Code", Cousine, "Roboto Mono", "Courier New", Courier, sans-serif, system-ui; background-color: rgb(235, 238, 242); border-radius: 6px; align-items: center; padding: 0px 5px; display: inline-flex; font-size: 0.875em !important;">/dm8/data/DAMENG/dm.ini</code>:你的数据库实例配置文件路径,根据实际修改。</p></li><li><p style="margin-bottom: 0px; line-height: 1.75em; margin-top: 0px !important;"><code style="box-sizing: border-box; font-variant: normal; font-stretch: 100%; line-height: 22px; font-optical-sizing: auto; font-size-adjust: none; font-kerning: auto; font-feature-settings: normal; font-variation-settings: normal; font-language-override: normal; font-family: Menlo, Monaco, Consolas, "Cascadia Mono", "Ubuntu Mono", "DejaVu Sans Mono", "Liberation Mono", "JetBrains Mono", "Fira Code", Cousine, "Roboto Mono", "Courier New", Courier, sans-serif, system-ui; background-color: rgb(235, 238, 242); border-radius: 6px; align-items: center; padding: 0px 5px; display: inline-flex; font-size: 0.875em !important;">/dm8/backup/full</code>:全量备份集的存放路径。</p></li><li><p style="margin-bottom: 0px; line-height: 1.75em; margin-top: 0px !important;"><code style="box-sizing: border-box; font-variant: normal; font-stretch: 100%; line-height: 22px; font-optical-sizing: auto; font-size-adjust: none; font-kerning: auto; font-feature-settings: normal; font-variation-settings: normal; font-language-override: normal; font-family: Menlo, Monaco, Consolas, "Cascadia Mono", "Ubuntu Mono", "DejaVu Sans Mono", "Liberation Mono", "JetBrains Mono", "Fira Code", Cousine, "Roboto Mono", "Courier New", Courier, sans-serif, system-ui; background-color: rgb(235, 238, 242); border-radius: 6px; align-items: center; padding: 0px 5px; display: inline-flex; font-size: 0.875em !important;">/dm8/arch</code>:归档日志存放路径。</p></li></ul></blockquote><h4 style="font-style: normal; font-variant: normal; font-size-adjust: none; font-language-override: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 16px; line-height: 28px; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; margin: 16px 0px; color: rgb(15, 17, 21); white-space: normal; background-color: rgb(255, 255, 255);"><strong>3. 启动数据库验证</strong></h4><pre class="brush:bash;toolbar:false">./DmServiceDMSERVER start</pre><hr/><h3 style="font-style: normal; font-variant: normal; font-size-adjust: none; font-language-override: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 20px; line-height: 30px; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; margin: 32px 0px 16px; color: rgb(15, 17, 21); white-space: normal; background-color: rgb(255, 255, 255);"><strong>使用 Console 工具进行库级恢复(图形化操作)</strong></h3><p style="margin: 16px 0px; color: rgb(15, 17, 21); font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; white-space: normal; background-color: rgb(255, 255, 255); line-height: 1.75em;">对于不熟悉命令行的DBA,达梦提供了 <code style="box-sizing: border-box; font-variant: normal; font-stretch: 100%; line-height: 22px; font-optical-sizing: auto; font-size-adjust: none; font-kerning: auto; font-feature-settings: normal; font-variation-settings: normal; font-language-override: normal; font-family: Menlo, Monaco, Consolas, "Cascadia Mono", "Ubuntu Mono", "DejaVu Sans Mono", "Liberation Mono", "JetBrains Mono", "Fira Code", Cousine, "Roboto Mono", "Courier New", Courier, sans-serif, system-ui; background-color: rgb(235, 238, 242); border-radius: 6px; align-items: center; padding: 0px 5px; display: inline-flex; font-size: 0.875em !important;">console</code> 图形化工具,操作直观,不易遗漏步骤。</p><ol start="1" style="margin: 16px 0px; padding-left: 18px; color: rgb(15, 17, 21); font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; white-space: normal; background-color: rgb(255, 255, 255);" class=" list-paddingleft-2"><li><p style="margin-bottom: 8px; line-height: 1.75em; margin-top: 0px !important;"><span style="font-weight: 600;">启动工具:cd /dm8/tool && ./console</span></p></li><li><p style="margin-bottom: 8px; line-height: 1.75em; margin-top: 0px !important;"><span style="font-weight: 600;">执行还原</span></p></li><ul style="margin: 4px 0px 0px; padding-left: 18px;" class=" list-paddingleft-2"><li><p style="margin-bottom: 0px; line-height: 1.75em; margin-top: 0px !important;">在左侧导航栏点击 <span style="font-weight: 600;">“还原”</span> -> <span style="font-weight: 600;">“还原”</span>。</p></li><li><p style="margin-bottom: 0px; line-height: 1.75em; margin-top: 0px !important;">在右侧窗口中,选择 <span style="font-weight: 600;">“还原类型”</span> 为 <span style="font-weight: 600;">“库”</span>。</p></li><li><p style="margin-bottom: 0px; line-height: 1.75em; margin-top: 0px !important;">点击 <span style="font-weight: 600;">“选择备份集”</span>,找到你的备份文件(如 <code style="box-sizing: border-box; font-variant: normal; font-stretch: 100%; line-height: 22px; font-optical-sizing: auto; font-size-adjust: none; font-kerning: auto; font-feature-settings: normal; font-variation-settings: normal; font-language-override: normal; font-family: Menlo, Monaco, Consolas, "Cascadia Mono", "Ubuntu Mono", "DejaVu Sans Mono", "Liberation Mono", "JetBrains Mono", "Fira Code", Cousine, "Roboto Mono", "Courier New", Courier, sans-serif, system-ui; background-color: rgb(235, 238, 242); border-radius: 6px; align-items: center; padding: 0px 5px; display: inline-flex; font-size: 0.875em !important;">/dm8/backup/full</code>)。</p></li><li><p style="margin-bottom: 0px; line-height: 1.75em; margin-top: 0px !important;">点击 <span style="font-weight: 600;">“还原”</span> 按钮。</p></li></ul><li><p style="margin-bottom: 8px; line-height: 1.75em; margin-top: 0px !important;"><span style="font-weight: 600;">执行恢复</span></p></li><ul style="margin: 4px 0px 0px; padding-left: 18px;" class=" list-paddingleft-2"><li><p style="margin-bottom: 0px; line-height: 1.75em; margin-top: 0px !important;">还原成功后,点击左侧 <span style="font-weight: 600;">“恢复”</span>。</p></li><li><p style="margin-bottom: 0px; line-height: 1.75em; margin-top: 0px !important;">系统会自动识别归档目录,确认后点击 <span style="font-weight: 600;">“确定”</span>。</p></li><li><p style="margin-bottom: 0px; line-height: 1.75em; margin-top: 0px !important;">这一步对应命令行中的 <code style="box-sizing: border-box; font-variant: normal; font-stretch: 100%; line-height: 22px; font-optical-sizing: auto; font-size-adjust: none; font-kerning: auto; font-feature-settings: normal; font-variation-settings: normal; font-language-override: normal; font-family: Menlo, Monaco, Consolas, "Cascadia Mono", "Ubuntu Mono", "DejaVu Sans Mono", "Liberation Mono", "JetBrains Mono", "Fira Code", Cousine, "Roboto Mono", "Courier New", Courier, sans-serif, system-ui; background-color: rgb(235, 238, 242); border-radius: 6px; align-items: center; padding: 0px 5px; display: inline-flex; font-size: 0.875em !important;">RECOVER</code> 操作。</p></li></ul><li><p style="margin-bottom: 8px; line-height: 1.75em; margin-top: 0px !important;"><span style="font-weight: 600;">更新魔数</span></p></li><ul style="margin: 4px 0px 0px; padding-left: 18px;" class=" list-paddingleft-2"><li><p style="margin-bottom: 0px; line-height: 1.75em; margin-top: 0px !important;">恢复成功后,点击左侧 <span style="font-weight: 600;">“更新Magic”</span>。</p></li><li><p style="margin-bottom: 0px; line-height: 1.75em; margin-top: 0px !important;">点击 <span style="font-weight: 600;">“确定”</span> 完成最后一步。</p></li></ul></ol><hr style="background: none 0% 0% / auto repeat scroll padding-box border-box rgba(0, 0, 0, 0.1); border-width: medium; border-style: none; border-color: currentcolor; border-image: initial; height: 1px; margin: 32px 0px; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; white-space: normal;"/><h3 style="font-style: normal; font-variant: normal; font-size-adjust: none; font-language-override: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 20px; line-height: 30px; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; margin: 32px 0px 16px; color: rgb(15, 17, 21); white-space: normal; background-color: rgb(255, 255, 255);"><strong>关键概念解析(为什么必须三步走)</strong></h3><p style="margin: 16px 0px; color: rgb(15, 17, 21); font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; white-space: normal; background-color: rgb(255, 255, 255); line-height: 1.75em;">在生产环境中理解这三步背后的原理,能帮你更好地应对突发状况:</p><ul style="margin: 16px 0px; padding-left: 18px; color: rgb(15, 17, 21); font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; white-space: normal; background-color: rgb(255, 255, 255);" class=" list-paddingleft-2"><li><p style="margin-bottom: 0px; line-height: 1.75em; margin-top: 0px !important;"><span style="font-weight: 600;">还原 vs 恢复</span>:<span style="font-weight: 600;">还原</span>只是拷贝数据文件,此时的数据库是“冷备份”状态(比如昨天凌晨2点的数据)。<span style="font-weight: 600;">恢复</span>是利用归档日志,把昨天2点到今天故障前的所有操作重做一遍,让数据回到最新状态<a href="https://blog.csdn.net/qq_45111959/article/details/147334660" target="_blank" rel="noreferrer noopener" style="color: rgb(57, 100, 254); transition: box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1); border-width: 2px 3px; border-style: solid; border-color: rgba(255, 255, 255, 0); margin-left: -3px; margin-right: -3px; text-decoration: none; position: relative; cursor: default;"></a>。</p></li><li><p style="margin-bottom: 0px; line-height: 1.75em; margin-top: 0px !important;"><span style="font-weight: 600;">魔数的作用</span>:<code style="box-sizing: border-box; font-variant: normal; font-stretch: 100%; line-height: 22px; font-optical-sizing: auto; font-size-adjust: none; font-kerning: auto; font-feature-settings: normal; font-variation-settings: normal; font-language-override: normal; font-family: Menlo, Monaco, Consolas, "Cascadia Mono", "Ubuntu Mono", "DejaVu Sans Mono", "Liberation Mono", "JetBrains Mono", "Fira Code", Cousine, "Roboto Mono", "Courier New", Courier, sans-serif, system-ui; background-color: rgb(235, 238, 242); border-radius: 6px; align-items: center; padding: 0px 5px; display: inline-flex; font-size: 0.875em !important;">DB_MAGIC</code> 是数据库的身份证。如果不更新魔数,数据库启动时会认为自己是“旧集群的副本”,可能拒绝启动或产生日志混乱<a href="https://eco.dameng.com/community/training/205d82526b5207229d393722fbae3b52" target="_blank" rel="noreferrer noopener" style="color: rgb(57, 100, 254); transition: box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1); border-width: 2px 3px; border-style: solid; border-color: rgba(255, 255, 255, 0); margin-left: -3px; margin-right: -3px; text-decoration: none; position: relative; cursor: default;"></a>。<span style="font-weight: 600;">这个步骤只在库级恢复时需要,表空间恢复不需要</span>。</p></li></ul><h3 style="font-style: normal; font-variant: normal; font-size-adjust: none; font-language-override: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 20px; line-height: 30px; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; margin: 32px 0px 16px; color: rgb(15, 17, 21); white-space: normal; background-color: rgb(255, 255, 255);"><strong>生产环境注意事项</strong></h3><ol start="1" style="margin: 16px 0px; padding-left: 18px; color: rgb(15, 17, 21); font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; white-space: normal; background-color: rgb(255, 255, 255);" class=" list-paddingleft-2"><li><p style="margin-bottom: 0px; line-height: 1.75em; margin-top: 0px !important;"><span style="font-weight: 600;">归档日志完整性</span>:<code style="box-sizing: border-box; font-variant: normal; font-stretch: 100%; line-height: 22px; font-optical-sizing: auto; font-size-adjust: none; font-kerning: auto; font-feature-settings: normal; font-variation-settings: normal; font-language-override: normal; font-family: Menlo, Monaco, Consolas, "Cascadia Mono", "Ubuntu Mono", "DejaVu Sans Mono", "Liberation Mono", "JetBrains Mono", "Fira Code", Cousine, "Roboto Mono", "Courier New", Courier, sans-serif, system-ui; background-color: rgb(235, 238, 242); border-radius: 6px; align-items: center; padding: 0px 5px; display: inline-flex; font-size: 0.875em !important;">RECOVER</code> 步骤严重依赖归档日志。如果归档日志缺失或不连续,恢复将停留在某个时刻且无法继续。<span style="font-weight: 600;">归档日志与数据文件应分开物理存储</span>。</p></li><li><p style="margin-bottom: 0px; line-height: 1.75em; margin-top: 0px !important;"><span style="font-weight: 600;">异机恢复</span>:如果需要将备份恢复到另一台服务器,确保目标服务器的操作系统位数、数据库版本与源库一致。</p></li><li><p style="margin-bottom: 0px; line-height: 1.75em; margin-top: 0px !important;"><span style="font-weight: 600;">备份有效性验证</span>:定期使用 <code style="box-sizing: border-box; font-variant: normal; font-stretch: 100%; line-height: 22px; font-optical-sizing: auto; font-size-adjust: none; font-kerning: auto; font-feature-settings: normal; font-variation-settings: normal; font-language-override: normal; font-family: Menlo, Monaco, Consolas, "Cascadia Mono", "Ubuntu Mono", "DejaVu Sans Mono", "Liberation Mono", "JetBrains Mono", "Fira Code", Cousine, "Roboto Mono", "Courier New", Courier, sans-serif, system-ui; background-color: rgb(235, 238, 242); border-radius: 6px; align-items: center; padding: 0px 5px; display: inline-flex; font-size: 0.875em !important;">dmrman</code> 的 <code style="box-sizing: border-box; font-variant: normal; font-stretch: 100%; line-height: 22px; font-optical-sizing: auto; font-size-adjust: none; font-kerning: auto; font-feature-settings: normal; font-variation-settings: normal; font-language-override: normal; font-family: Menlo, Monaco, Consolas, "Cascadia Mono", "Ubuntu Mono", "DejaVu Sans Mono", "Liberation Mono", "JetBrains Mono", "Fira Code", Cousine, "Roboto Mono", "Courier New", Courier, sans-serif, system-ui; background-color: rgb(235, 238, 242); border-radius: 6px; align-items: center; padding: 0px 5px; display: inline-flex; font-size: 0.875em !important;">CHECK BACKUPSET</code> 命令验证备份集是否损坏。</p></li></ol><hr/><h3 style="font-variant: normal; white-space: normal; font-size-adjust: none; font-language-override: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 20px; line-height: 30px; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; margin: 32px 0px 16px; color: rgb(15, 17, 21); background-color: rgb(255, 255, 255);"><strong><span style="font-size: 24px;">达梦数据库逻辑备份恢复</span></strong></h3><p style="margin-bottom: 16px; color: rgb(15, 17, 21); font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; white-space: normal; background-color: rgb(255, 255, 255); line-height: 1.75em; margin-top: 0px !important;">逻辑备份(<code style="box-sizing: border-box; font-variant: normal; font-stretch: 100%; line-height: 22px; font-optical-sizing: auto; font-size-adjust: none; font-kerning: auto; font-feature-settings: normal; font-variation-settings: normal; font-language-override: normal; font-family: Menlo, Monaco, Consolas, "Cascadia Mono", "Ubuntu Mono", "DejaVu Sans Mono", "Liberation Mono", "JetBrains Mono", "Fira Code", Cousine, "Roboto Mono", "Courier New", Courier, sans-serif, system-ui; background-color: rgb(235, 238, 242); border-radius: 6px; align-items: center; padding: 0px 5px; display: inline-flex; font-size: 0.875em !important;">dexp</code>导出)后,使用 <code style="box-sizing: border-box; font-variant: normal; font-stretch: 100%; line-height: 22px; font-optical-sizing: auto; font-size-adjust: none; font-kerning: auto; font-feature-settings: normal; font-variation-settings: normal; font-language-override: normal; font-family: Menlo, Monaco, Consolas, "Cascadia Mono", "Ubuntu Mono", "DejaVu Sans Mono", "Liberation Mono", "JetBrains Mono", "Fira Code", Cousine, "Roboto Mono", "Courier New", Courier, sans-serif, system-ui; background-color: rgb(235, 238, 242); border-radius: 6px; align-items: center; padding: 0px 5px; display: inline-flex; font-size: 0.875em !important;">dimp</code> 工具将数据恢复到达梦数据库。<code style="box-sizing: border-box; font-variant: normal; font-stretch: 100%; line-height: 22px; font-optical-sizing: auto; font-size-adjust: none; font-kerning: auto; font-feature-settings: normal; font-variation-settings: normal; font-language-override: normal; font-family: Menlo, Monaco, Consolas, "Cascadia Mono", "Ubuntu Mono", "DejaVu Sans Mono", "Liberation Mono", "JetBrains Mono", "Fira Code", Cousine, "Roboto Mono", "Courier New", Courier, sans-serif, system-ui; background-color: rgb(235, 238, 242); border-radius: 6px; align-items: center; padding: 0px 5px; display: inline-flex; font-size: 0.875em !important;">dimp</code> 是达梦的逻辑导入工具,与 <code style="box-sizing: border-box; font-variant: normal; font-stretch: 100%; line-height: 22px; font-optical-sizing: auto; font-size-adjust: none; font-kerning: auto; font-feature-settings: normal; font-variation-settings: normal; font-language-override: normal; font-family: Menlo, Monaco, Consolas, "Cascadia Mono", "Ubuntu Mono", "DejaVu Sans Mono", "Liberation Mono", "JetBrains Mono", "Fira Code", Cousine, "Roboto Mono", "Courier New", Courier, sans-serif, system-ui; background-color: rgb(235, 238, 242); border-radius: 6px; align-items: center; padding: 0px 5px; display: inline-flex; font-size: 0.875em !important;">dexp</code> 配套使用,支持将导出的 <code style="box-sizing: border-box; font-variant: normal; font-stretch: 100%; line-height: 22px; font-optical-sizing: auto; font-size-adjust: none; font-kerning: auto; font-feature-settings: normal; font-variation-settings: normal; font-language-override: normal; font-family: Menlo, Monaco, Consolas, "Cascadia Mono", "Ubuntu Mono", "DejaVu Sans Mono", "Liberation Mono", "JetBrains Mono", "Fira Code", Cousine, "Roboto Mono", "Courier New", Courier, sans-serif, system-ui; background-color: rgb(235, 238, 242); border-radius: 6px; align-items: center; padding: 0px 5px; display: inline-flex; font-size: 0.875em !important;">dmp</code> 文件导入到目标库中。[zkqw]</p><hr style="background: none 0% 0% / auto repeat scroll padding-box border-box rgba(0, 0, 0, 0.1); border-width: medium; border-style: none; border-color: currentcolor; border-image: initial; height: 1px; margin: 32px 0px; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; white-space: normal;"/><h2 style="font-style: normal; font-variant: normal; font-size-adjust: none; font-language-override: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 22px; line-height: 32px; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; margin: 32px 0px 16px; color: rgb(15, 17, 21); white-space: normal; background-color: rgb(255, 255, 255);"><strong>逻辑导入工具 <code style="box-sizing: border-box; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-variation-settings: inherit; font-language-override: inherit; font-family: Menlo, Monaco, Consolas, "Cascadia Mono", "Ubuntu Mono", "DejaVu Sans Mono", "Liberation Mono", "JetBrains Mono", "Fira Code", Cousine, "Roboto Mono", "Courier New", Courier, sans-serif, system-ui; background-color: rgb(235, 238, 242); border-radius: 6px; align-items: center; padding: 0px 5px; display: inline-flex; font-size: inherit;">dimp</code></strong></h2><h3 style="font-style: normal; font-variant: normal; font-size-adjust: none; font-language-override: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 20px; line-height: 30px; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; margin: 32px 0px 16px; color: rgb(15, 17, 21); white-space: normal; background-color: rgb(255, 255, 255);"><strong>1. 基本语法</strong></h3><pre class="brush:bash;toolbar:false">./dimp USERID=<用户名>/<密码>[@<IP>:<端口>] \
       DIRECTORY=<备份文件所在目录> \
       FILE=<导出的dmp文件名> \
       LOG=<导入日志文件名> \
       [导入级别参数] \
       [其他选项]</pre><h3 style="font-style: normal; font-variant: normal; font-size-adjust: none; font-language-override: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 20px; line-height: 30px; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; margin: 32px 0px 16px; color: rgb(15, 17, 21); white-space: normal; background-color: rgb(255, 255, 255);"><strong>2. 主要导入级别参数</strong></h3><div class="ds-scroll-area ds-scroll-area--show-on-focus-within _1210dd7 c03cafe9" style="z-index: 0; --ds-scroll-area-gutters-disappear-delay: 1s; position: relative; overflow-x: auto; scrollbar-width: none; color: rgb(15, 17, 21); font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; white-space: normal; background-color: rgb(255, 255, 255);"><table width="752"><thead><tr class="firstRow"><th style="border-bottom: 1px solid rgba(0, 0, 0, 0.12); font: 500 15px / 25px quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; border-top-width: medium; border-top-style: none; border-top-color: currentcolor; padding: 10px 16px 10px 0px; text-align: left;">参数</th><th style="border-bottom: 1px solid rgba(0, 0, 0, 0.12); font: 500 15px / 25px quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; border-top-width: medium; border-top-style: none; border-top-color: currentcolor; padding: 10px 16px; text-align: left;">说明</th><th style="border-bottom: 1px solid rgba(0, 0, 0, 0.12); font: 500 15px / 25px quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; border-top-width: medium; border-top-style: none; border-top-color: currentcolor; padding: 10px 16px; text-align: left;">适用场景</th></tr></thead><tbody><tr><td style="border-bottom: 1px solid rgba(0, 0, 0, 0.1); font-style: normal; font-variant: normal; font-size-adjust: none; font-language-override: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 15px; line-height: 25px; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; min-width: 100px; max-width: min(30vw, 320px); padding: 10px 16px 10px 0px;"><code style="box-sizing: border-box; font-style: normal; font-variant: normal; font-size-adjust: none; font-language-override: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 13px; line-height: 22px; font-family: Menlo, Monaco, Consolas, "Cascadia Mono", "Ubuntu Mono", "DejaVu Sans Mono", "Liberation Mono", "JetBrains Mono", "Fira Code", Cousine, "Roboto Mono", "Courier New", Courier, sans-serif, system-ui; background-color: rgb(235, 238, 242); border-radius: 6px; align-items: center; padding: 0px 5px; display: inline-flex;">FULL=Y</code></td><td style="border-bottom: 1px solid rgba(0, 0, 0, 0.1); font-style: normal; font-variant: normal; font-size-adjust: none; font-language-override: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 15px; line-height: 25px; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; min-width: 100px; max-width: min(30vw, 320px); padding: 10px 16px;">导入整个库(全库导入)</td><td style="border-bottom: 1px solid rgba(0, 0, 0, 0.1); font-style: normal; font-variant: normal; font-size-adjust: none; font-language-override: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 15px; line-height: 25px; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; min-width: 100px; max-width: min(30vw, 320px); padding: 10px 0px 10px 16px;">用于数据迁移、完整恢复</td></tr><tr><td style="border-bottom: 1px solid rgba(0, 0, 0, 0.1); font-style: normal; font-variant: normal; font-size-adjust: none; font-language-override: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 15px; line-height: 25px; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; min-width: 100px; max-width: min(30vw, 320px); padding: 10px 16px 10px 0px;"><code style="box-sizing: border-box; font-style: normal; font-variant: normal; font-size-adjust: none; font-language-override: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 13px; line-height: 22px; font-family: Menlo, Monaco, Consolas, "Cascadia Mono", "Ubuntu Mono", "DejaVu Sans Mono", "Liberation Mono", "JetBrains Mono", "Fira Code", Cousine, "Roboto Mono", "Courier New", Courier, sans-serif, system-ui; background-color: rgb(235, 238, 242); border-radius: 6px; align-items: center; padding: 0px 5px; display: inline-flex;">OWNER=<用户名></code></td><td style="border-bottom: 1px solid rgba(0, 0, 0, 0.1); font-style: normal; font-variant: normal; font-size-adjust: none; font-language-override: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 15px; line-height: 25px; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; min-width: 100px; max-width: min(30vw, 320px); padding: 10px 16px;">导入指定用户的所有对象</td><td style="border-bottom: 1px solid rgba(0, 0, 0, 0.1); font-style: normal; font-variant: normal; font-size-adjust: none; font-language-override: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 15px; line-height: 25px; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; min-width: 100px; max-width: min(30vw, 320px); padding: 10px 0px 10px 16px;">恢复某用户的数据</td></tr><tr><td style="border-bottom: 1px solid rgba(0, 0, 0, 0.1); font-style: normal; font-variant: normal; font-size-adjust: none; font-language-override: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 15px; line-height: 25px; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; min-width: 100px; max-width: min(30vw, 320px); padding: 10px 16px 10px 0px;"><code style="box-sizing: border-box; font-style: normal; font-variant: normal; font-size-adjust: none; font-language-override: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 13px; line-height: 22px; font-family: Menlo, Monaco, Consolas, "Cascadia Mono", "Ubuntu Mono", "DejaVu Sans Mono", "Liberation Mono", "JetBrains Mono", "Fira Code", Cousine, "Roboto Mono", "Courier New", Courier, sans-serif, system-ui; background-color: rgb(235, 238, 242); border-radius: 6px; align-items: center; padding: 0px 5px; display: inline-flex;">SCHEMAS=<模式名></code></td><td style="border-bottom: 1px solid rgba(0, 0, 0, 0.1); font-style: normal; font-variant: normal; font-size-adjust: none; font-language-override: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 15px; line-height: 25px; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; min-width: 100px; max-width: min(30vw, 320px); padding: 10px 16px;">导入指定模式的所有对象</td><td style="border-bottom: 1px solid rgba(0, 0, 0, 0.1); font-style: normal; font-variant: normal; font-size-adjust: none; font-language-override: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 15px; line-height: 25px; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; min-width: 100px; max-width: min(30vw, 320px); padding: 10px 0px 10px 16px;">恢复某模式的数据</td></tr><tr><td style="border-bottom: 1px solid rgba(0, 0, 0, 0.1); font-style: normal; font-variant: normal; font-size-adjust: none; font-language-override: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 15px; line-height: 25px; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; min-width: 100px; max-width: min(30vw, 320px); padding: 10px 16px 10px 0px;"><code style="box-sizing: border-box; font-style: normal; font-variant: normal; font-size-adjust: none; font-language-override: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 13px; line-height: 22px; font-family: Menlo, Monaco, Consolas, "Cascadia Mono", "Ubuntu Mono", "DejaVu Sans Mono", "Liberation Mono", "JetBrains Mono", "Fira Code", Cousine, "Roboto Mono", "Courier New", Courier, sans-serif, system-ui; background-color: rgb(235, 238, 242); border-radius: 6px; align-items: center; padding: 0px 5px; display: inline-flex;">TABLES=<表名></code></td><td style="border-bottom: 1px solid rgba(0, 0, 0, 0.1); font-style: normal; font-variant: normal; font-size-adjust: none; font-language-override: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 15px; line-height: 25px; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; min-width: 100px; max-width: min(30vw, 320px); padding: 10px 16px;">导入指定表(可多个,逗号分隔)</td><td style="border-bottom: 1px solid rgba(0, 0, 0, 0.1); font-style: normal; font-variant: normal; font-size-adjust: none; font-language-override: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 15px; line-height: 25px; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; min-width: 100px; max-width: min(30vw, 320px); padding: 10px 0px 10px 16px;">恢复单表或部分表</td></tr></tbody></table></div><h3 style="font-style: normal; font-variant: normal; font-size-adjust: none; font-language-override: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 20px; line-height: 30px; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; margin: 32px 0px 16px; color: rgb(15, 17, 21); white-space: normal; background-color: rgb(255, 255, 255);"><strong>3. 常用辅助参数</strong></h3><ul style="margin: 16px 0px; padding-left: 18px; color: rgb(15, 17, 21); font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; white-space: normal; background-color: rgb(255, 255, 255);" class=" list-paddingleft-2"><li><p style="margin-bottom: 8px; line-height: 1.75em; margin-top: 0px !important;"><code style="box-sizing: border-box; font-variant: normal; font-stretch: 100%; line-height: 22px; font-optical-sizing: auto; font-size-adjust: none; font-kerning: auto; font-feature-settings: normal; font-variation-settings: normal; font-language-override: normal; font-family: Menlo, Monaco, Consolas, "Cascadia Mono", "Ubuntu Mono", "DejaVu Sans Mono", "Liberation Mono", "JetBrains Mono", "Fira Code", Cousine, "Roboto Mono", "Courier New", Courier, sans-serif, system-ui; background-color: rgb(235, 238, 242); border-radius: 6px; align-items: center; padding: 0px 5px; display: inline-flex; font-size: 0.875em !important;">TABLE_EXISTS_ACTION=<动作></code>:表已存在时的处理方式。可选:</p></li><ul style="list-style-type: square;" class=" list-paddingleft-2"><li><p style="margin-bottom: 0px; line-height: 1.75em; margin-top: 0px !important;"><code style="box-sizing: border-box; font-variant: normal; font-stretch: 100%; line-height: 22px; font-optical-sizing: auto; font-size-adjust: none; font-kerning: auto; font-feature-settings: normal; font-variation-settings: normal; font-language-override: normal; font-family: Menlo, Monaco, Consolas, "Cascadia Mono", "Ubuntu Mono", "DejaVu Sans Mono", "Liberation Mono", "JetBrains Mono", "Fira Code", Cousine, "Roboto Mono", "Courier New", Courier, sans-serif, system-ui; background-color: rgb(235, 238, 242); border-radius: 6px; align-items: center; padding: 0px 5px; display: inline-flex; font-size: 0.875em !important;">SKIP</code>(默认):跳过该表,不导入数据。</p></li><li><p style="margin-bottom: 0px; line-height: 1.75em; margin-top: 0px !important;"><code style="box-sizing: border-box; font-variant: normal; font-stretch: 100%; line-height: 22px; font-optical-sizing: auto; font-size-adjust: none; font-kerning: auto; font-feature-settings: normal; font-variation-settings: normal; font-language-override: normal; font-family: Menlo, Monaco, Consolas, "Cascadia Mono", "Ubuntu Mono", "DejaVu Sans Mono", "Liberation Mono", "JetBrains Mono", "Fira Code", Cousine, "Roboto Mono", "Courier New", Courier, sans-serif, system-ui; background-color: rgb(235, 238, 242); border-radius: 6px; align-items: center; padding: 0px 5px; display: inline-flex; font-size: 0.875em !important;">TRUNCATE</code>:先清空表数据,再导入。</p></li><li><p style="margin-bottom: 0px; line-height: 1.75em; margin-top: 0px !important;"><code style="box-sizing: border-box; font-variant: normal; font-stretch: 100%; line-height: 22px; font-optical-sizing: auto; font-size-adjust: none; font-kerning: auto; font-feature-settings: normal; font-variation-settings: normal; font-language-override: normal; font-family: Menlo, Monaco, Consolas, "Cascadia Mono", "Ubuntu Mono", "DejaVu Sans Mono", "Liberation Mono", "JetBrains Mono", "Fira Code", Cousine, "Roboto Mono", "Courier New", Courier, sans-serif, system-ui; background-color: rgb(235, 238, 242); border-radius: 6px; align-items: center; padding: 0px 5px; display: inline-flex; font-size: 0.875em !important;">APPEND</code>:在现有数据后追加。</p></li><li><p style="margin-bottom: 0px; line-height: 1.75em; margin-top: 0px !important;"><code style="box-sizing: border-box; font-variant: normal; font-stretch: 100%; line-height: 22px; font-optical-sizing: auto; font-size-adjust: none; font-kerning: auto; font-feature-settings: normal; font-variation-settings: normal; font-language-override: normal; font-family: Menlo, Monaco, Consolas, "Cascadia Mono", "Ubuntu Mono", "DejaVu Sans Mono", "Liberation Mono", "JetBrains Mono", "Fira Code", Cousine, "Roboto Mono", "Courier New", Courier, sans-serif, system-ui; background-color: rgb(235, 238, 242); border-radius: 6px; align-items: center; padding: 0px 5px; display: inline-flex; font-size: 0.875em !important;">REPLACE</code>:删除并重建表(危险,会丢失结构)。</p></li></ul><li><p style="margin-bottom: 0px; line-height: 1.75em; margin-top: 0px !important;"><code style="box-sizing: border-box; font-variant: normal; font-stretch: 100%; line-height: 22px; font-optical-sizing: auto; font-size-adjust: none; font-kerning: auto; font-feature-settings: normal; font-variation-settings: normal; font-language-override: normal; font-family: Menlo, Monaco, Consolas, "Cascadia Mono", "Ubuntu Mono", "DejaVu Sans Mono", "Liberation Mono", "JetBrains Mono", "Fira Code", Cousine, "Roboto Mono", "Courier New", Courier, sans-serif, system-ui; background-color: rgb(235, 238, 242); border-radius: 6px; align-items: center; padding: 0px 5px; display: inline-flex; font-size: 0.875em !important;">IGNORE=Y</code>:忽略导入过程中遇到的错误(如对象已存在),继续执行。</p></li><li><p style="margin-bottom: 0px; line-height: 1.75em; margin-top: 0px !important;"><code style="box-sizing: border-box; font-variant: normal; font-stretch: 100%; line-height: 22px; font-optical-sizing: auto; font-size-adjust: none; font-kerning: auto; font-feature-settings: normal; font-variation-settings: normal; font-language-override: normal; font-family: Menlo, Monaco, Consolas, "Cascadia Mono", "Ubuntu Mono", "DejaVu Sans Mono", "Liberation Mono", "JetBrains Mono", "Fira Code", Cousine, "Roboto Mono", "Courier New", Courier, sans-serif, system-ui; background-color: rgb(235, 238, 242); border-radius: 6px; align-items: center; padding: 0px 5px; display: inline-flex; font-size: 0.875em !important;">PARALLEL=<并行数></code>:并行导入,提高效率(需备份文件支持并行)。</p></li><li><p style="margin-bottom: 0px; line-height: 1.75em; margin-top: 0px !important;"><code style="box-sizing: border-box; font-variant: normal; font-stretch: 100%; line-height: 22px; font-optical-sizing: auto; font-size-adjust: none; font-kerning: auto; font-feature-settings: normal; font-variation-settings: normal; font-language-override: normal; font-family: Menlo, Monaco, Consolas, "Cascadia Mono", "Ubuntu Mono", "DejaVu Sans Mono", "Liberation Mono", "JetBrains Mono", "Fira Code", Cousine, "Roboto Mono", "Courier New", Courier, sans-serif, system-ui; background-color: rgb(235, 238, 242); border-radius: 6px; align-items: center; padding: 0px 5px; display: inline-flex; font-size: 0.875em !important;">COMMIT=Y</code>:每导入一批数据后提交,防止大事务占用回滚段。</p></li><li><p style="margin-bottom: 0px; line-height: 1.75em; margin-top: 0px !important;"><code style="box-sizing: border-box; font-variant: normal; font-stretch: 100%; line-height: 22px; font-optical-sizing: auto; font-size-adjust: none; font-kerning: auto; font-feature-settings: normal; font-variation-settings: normal; font-language-override: normal; font-family: Menlo, Monaco, Consolas, "Cascadia Mono", "Ubuntu Mono", "DejaVu Sans Mono", "Liberation Mono", "JetBrains Mono", "Fira Code", Cousine, "Roboto Mono", "Courier New", Courier, sans-serif, system-ui; background-color: rgb(235, 238, 242); border-radius: 6px; align-items: center; padding: 0px 5px; display: inline-flex; font-size: 0.875em !important;">ROWS=Y</code>(默认)/<code style="box-sizing: border-box; font-variant: normal; font-stretch: 100%; line-height: 22px; font-optical-sizing: auto; font-size-adjust: none; font-kerning: auto; font-feature-settings: normal; font-variation-settings: normal; font-language-override: normal; font-family: Menlo, Monaco, Consolas, "Cascadia Mono", "Ubuntu Mono", "DejaVu Sans Mono", "Liberation Mono", "JetBrains Mono", "Fira Code", Cousine, "Roboto Mono", "Courier New", Courier, sans-serif, system-ui; background-color: rgb(235, 238, 242); border-radius: 6px; align-items: center; padding: 0px 5px; display: inline-flex; font-size: 0.875em !important;">N</code>:是否导入数据行。</p></li></ul><hr style="background: none 0% 0% / auto repeat scroll padding-box border-box rgba(0, 0, 0, 0.1); border-width: medium; border-style: none; border-color: currentcolor; border-image: initial; height: 1px; margin: 32px 0px; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; white-space: normal;"/><h2 style="font-style: normal; font-variant: normal; font-size-adjust: none; font-language-override: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 22px; line-height: 32px; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; margin: 32px 0px 16px; color: rgb(15, 17, 21); white-space: normal; background-color: rgb(255, 255, 255);"><strong>导入前的准备工作</strong></h2><ol start="1" style="margin: 16px 0px; padding-left: 18px; color: rgb(15, 17, 21); font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; white-space: normal; background-color: rgb(255, 255, 255);" class=" list-paddingleft-2"><li><p style="margin-bottom: 0px; line-height: 1.75em; margin-top: 0px !important;"><span style="font-weight: 600;">确认目标库环境</span>:字符集应与导出库一致(否则可能出现乱码或导入失败)。</p></li><li><p style="margin-bottom: 0px; line-height: 1.75em; margin-top: 0px !important;"><span style="font-weight: 600;">创建必要用户/模式</span>:如果导入指定用户或模式,需确保目标库中存在这些用户(且权限足够)。可使用 <code style="box-sizing: border-box; font-variant: normal; font-stretch: 100%; line-height: 22px; font-optical-sizing: auto; font-size-adjust: none; font-kerning: auto; font-feature-settings: normal; font-variation-settings: normal; font-language-override: normal; font-family: Menlo, Monaco, Consolas, "Cascadia Mono", "Ubuntu Mono", "DejaVu Sans Mono", "Liberation Mono", "JetBrains Mono", "Fira Code", Cousine, "Roboto Mono", "Courier New", Courier, sans-serif, system-ui; background-color: rgb(235, 238, 242); border-radius: 6px; align-items: center; padding: 0px 5px; display: inline-flex; font-size: 0.875em !important;">CREATE USER</code> 和 <code style="box-sizing: border-box; font-variant: normal; font-stretch: 100%; line-height: 22px; font-optical-sizing: auto; font-size-adjust: none; font-kerning: auto; font-feature-settings: normal; font-variation-settings: normal; font-language-override: normal; font-family: Menlo, Monaco, Consolas, "Cascadia Mono", "Ubuntu Mono", "DejaVu Sans Mono", "Liberation Mono", "JetBrains Mono", "Fira Code", Cousine, "Roboto Mono", "Courier New", Courier, sans-serif, system-ui; background-color: rgb(235, 238, 242); border-radius: 6px; align-items: center; padding: 0px 5px; display: inline-flex; font-size: 0.875em !important;">GRANT</code> 提前创建。</p></li><li><p style="margin-bottom: 0px; line-height: 1.75em; margin-top: 0px !important;"><span style="font-weight: 600;">清理目标对象</span>:根据需求决定是否提前删除已有对象,或使用 <code style="box-sizing: border-box; font-variant: normal; font-stretch: 100%; line-height: 22px; font-optical-sizing: auto; font-size-adjust: none; font-kerning: auto; font-feature-settings: normal; font-variation-settings: normal; font-language-override: normal; font-family: Menlo, Monaco, Consolas, "Cascadia Mono", "Ubuntu Mono", "DejaVu Sans Mono", "Liberation Mono", "JetBrains Mono", "Fira Code", Cousine, "Roboto Mono", "Courier New", Courier, sans-serif, system-ui; background-color: rgb(235, 238, 242); border-radius: 6px; align-items: center; padding: 0px 5px; display: inline-flex; font-size: 0.875em !important;">TABLE_EXISTS_ACTION</code> 控制冲突行为。</p></li><li><p style="margin-bottom: 0px; line-height: 1.75em; margin-top: 0px !important;"><span style="font-weight: 600;">备份目标库</span>:在生产环境导入前,强烈建议对目标库进行一次物理或逻辑备份,以防误操作。</p></li></ol><hr style="background: none 0% 0% / auto repeat scroll padding-box border-box rgba(0, 0, 0, 0.1); border-width: medium; border-style: none; border-color: currentcolor; border-image: initial; height: 1px; margin: 32px 0px; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; white-space: normal;"/><h2 style="font-style: normal; font-variant: normal; font-size-adjust: none; font-language-override: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 22px; line-height: 32px; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; margin: 32px 0px 16px; color: rgb(15, 17, 21); white-space: normal; background-color: rgb(255, 255, 255);"><strong>导入操作示例</strong></h2><h3 style="font-style: normal; font-variant: normal; font-size-adjust: none; font-language-override: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 20px; line-height: 30px; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; margin: 32px 0px 16px; color: rgb(15, 17, 21); white-space: normal; background-color: rgb(255, 255, 255);"><strong>场景1:全库导入(FULL)</strong></h3><pre class="brush:bash;toolbar:false">./dimp SYSDBA/SYSDBA@localhost:5236 \
       DIRECTORY=/dm8/backup \
       FILE=full_db.dmp \
       LOG=full_import.log \
       FULL=Y \
       TABLE_EXISTS_ACTION=REPLACE   # 谨慎使用,会覆盖现有表</pre><h3 style="font-style: normal; font-variant: normal; font-size-adjust: none; font-language-override: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 20px; line-height: 30px; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; margin: 32px 0px 16px; color: rgb(15, 17, 21); white-space: normal; background-color: rgb(255, 255, 255);"><strong>场景2:按用户导入(OWNER)</strong></h3><pre class="brush:bash;toolbar:false">./dimp SYSDBA/SYSDBA@localhost:5236 \
       DIRECTORY=/dm8/backup \
       FILE=owner_user01.dmp \
       LOG=import_user01.log \
       OWNER=USER01 \
       TABLE_EXISTS_ACTION=APPEND</pre><h3 style="font-style: normal; font-variant: normal; font-size-adjust: none; font-language-override: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 20px; line-height: 30px; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; margin: 32px 0px 16px; color: rgb(15, 17, 21); white-space: normal; background-color: rgb(255, 255, 255);"><strong>场景3:按模式导入(SCHEMAS)</strong></h3><pre class="brush:bash;toolbar:false">./dimp SYSDBA/SYSDBA@localhost:5236 \
       DIRECTORY=/dm8/backup \
       FILE=schema_dmhr.dmp \
       LOG=import_dmhr.log \
       SCHEMAS=DMHR \
       IGNORE=Y</pre><h3 style="font-style: normal; font-variant: normal; font-size-adjust: none; font-language-override: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 20px; line-height: 30px; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; margin: 32px 0px 16px; color: rgb(15, 17, 21); white-space: normal; background-color: rgb(255, 255, 255);"><strong>场景4:按表导入(TABLES)</strong></h3><pre class="brush:bash;toolbar:false">./dimp SYSDBA/SYSDBA@localhost:5236 \
       DIRECTORY=/dm8/backup \
       FILE=table_order.dmp \
       LOG=import_order.log \
       TABLES="PROD.ORDER_MAIN,PROD.ORDER_DETAIL" \
       TABLE_EXISTS_ACTION=TRUNCATE</pre><hr/><h2 style="font-style: normal; font-variant: normal; font-size-adjust: none; font-language-override: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 22px; line-height: 32px; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; margin: 32px 0px 16px; color: rgb(15, 17, 21); white-space: normal; background-color: rgb(255, 255, 255);"><strong>生产环境注意事项<br/></strong></h2><h3 style="font-style: normal; font-variant: normal; font-size-adjust: none; font-language-override: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 20px; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; margin: 32px 0px 16px; color: rgb(15, 17, 21); white-space: normal; background-color: rgb(255, 255, 255); line-height: 1.75em;"><strong>1. 表空间与存储</strong></h3><ul style="margin: 16px 0px; padding-left: 18px; color: rgb(15, 17, 21); font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; white-space: normal; background-color: rgb(255, 255, 255);" class=" list-paddingleft-2"><li><p style="margin-bottom: 0px; line-height: 1.75em; margin-top: 0px !important;">如果导入的目标库表空间不足,导入可能失败。提前检查表空间使用情况,必要时增加数据文件。</p></li><li><p style="margin-bottom: 0px; line-height: 1.75em; margin-top: 0px !important;">若使用 <code style="box-sizing: border-box; font-variant: normal; font-stretch: 100%; line-height: 22px; font-optical-sizing: auto; font-size-adjust: none; font-kerning: auto; font-feature-settings: normal; font-variation-settings: normal; font-language-override: normal; font-family: Menlo, Monaco, Consolas, "Cascadia Mono", "Ubuntu Mono", "DejaVu Sans Mono", "Liberation Mono", "JetBrains Mono", "Fira Code", Cousine, "Roboto Mono", "Courier New", Courier, sans-serif, system-ui; background-color: rgb(235, 238, 242); border-radius: 6px; align-items: center; padding: 0px 5px; display: inline-flex; font-size: 0.875em !important;">REPLACE</code> 或创建表,需确保目标用户拥有在指定表空间上创建表的权限。</p></li></ul><h3 style="font-style: normal; font-variant: normal; font-size-adjust: none; font-language-override: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 20px; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; margin: 32px 0px 16px; color: rgb(15, 17, 21); white-space: normal; background-color: rgb(255, 255, 255); line-height: 1.75em;"><strong>2. 约束与触发器</strong></h3><ul style="margin: 16px 0px; padding-left: 18px; color: rgb(15, 17, 21); font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; white-space: normal; background-color: rgb(255, 255, 255);" class=" list-paddingleft-2"><li><p style="margin-bottom: 0px; line-height: 1.75em; margin-top: 0px !important;">导入时,表的约束(主键、外键等)和触发器会在数据导入后重建。如果存在外键依赖,建议先导入主表,再导入子表,或导入完成后手动启用约束。</p></li><li><p style="margin-bottom: 0px; line-height: 1.75em; margin-top: 0px !important;">可添加参数 <code style="box-sizing: border-box; font-variant: normal; font-stretch: 100%; line-height: 22px; font-optical-sizing: auto; font-size-adjust: none; font-kerning: auto; font-feature-settings: normal; font-variation-settings: normal; font-language-override: normal; font-family: Menlo, Monaco, Consolas, "Cascadia Mono", "Ubuntu Mono", "DejaVu Sans Mono", "Liberation Mono", "JetBrains Mono", "Fira Code", Cousine, "Roboto Mono", "Courier New", Courier, sans-serif, system-ui; background-color: rgb(235, 238, 242); border-radius: 6px; align-items: center; padding: 0px 5px; display: inline-flex; font-size: 0.875em !important;">CONSTRAINTS=Y</code>(默认)或 <code style="box-sizing: border-box; font-variant: normal; font-stretch: 100%; line-height: 22px; font-optical-sizing: auto; font-size-adjust: none; font-kerning: auto; font-feature-settings: normal; font-variation-settings: normal; font-language-override: normal; font-family: Menlo, Monaco, Consolas, "Cascadia Mono", "Ubuntu Mono", "DejaVu Sans Mono", "Liberation Mono", "JetBrains Mono", "Fira Code", Cousine, "Roboto Mono", "Courier New", Courier, sans-serif, system-ui; background-color: rgb(235, 238, 242); border-radius: 6px; align-items: center; padding: 0px 5px; display: inline-flex; font-size: 0.875em !important;">N</code> 控制是否导入约束。</p></li></ul><h3 style="font-style: normal; font-variant: normal; font-size-adjust: none; font-language-override: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 20px; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; margin: 32px 0px 16px; color: rgb(15, 17, 21); white-space: normal; background-color: rgb(255, 255, 255); line-height: 1.75em;"><strong>3. 索引</strong></h3><ul style="margin: 16px 0px; padding-left: 18px; color: rgb(15, 17, 21); font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; white-space: normal; background-color: rgb(255, 255, 255);" class=" list-paddingleft-2"><li><p style="margin-bottom: 0px; line-height: 1.75em; margin-top: 0px !important;">导入数据后,索引会自动重建,但大量数据导入时,可先删除索引,导入完成后再重建,以加快导入速度(通过 <code style="box-sizing: border-box; font-variant: normal; font-stretch: 100%; line-height: 22px; font-optical-sizing: auto; font-size-adjust: none; font-kerning: auto; font-feature-settings: normal; font-variation-settings: normal; font-language-override: normal; font-family: Menlo, Monaco, Consolas, "Cascadia Mono", "Ubuntu Mono", "DejaVu Sans Mono", "Liberation Mono", "JetBrains Mono", "Fira Code", Cousine, "Roboto Mono", "Courier New", Courier, sans-serif, system-ui; background-color: rgb(235, 238, 242); border-radius: 6px; align-items: center; padding: 0px 5px; display: inline-flex; font-size: 0.875em !important;">INDEXES=N</code> 实现)。</p></li></ul><h3 style="font-style: normal; font-variant: normal; font-size-adjust: none; font-language-override: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 20px; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; margin: 32px 0px 16px; color: rgb(15, 17, 21); white-space: normal; background-color: rgb(255, 255, 255); line-height: 1.75em;"><strong>4. 大对象(LOB)</strong></h3><ul style="margin: 16px 0px; padding-left: 18px; color: rgb(15, 17, 21); font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; white-space: normal; background-color: rgb(255, 255, 255);" class=" list-paddingleft-2"><li><p style="margin-bottom: 0px; line-height: 1.75em; margin-top: 0px !important;">导出时如果使用了 <code style="box-sizing: border-box; font-variant: normal; font-stretch: 100%; line-height: 22px; font-optical-sizing: auto; font-size-adjust: none; font-kerning: auto; font-feature-settings: normal; font-variation-settings: normal; font-language-override: normal; font-family: Menlo, Monaco, Consolas, "Cascadia Mono", "Ubuntu Mono", "DejaVu Sans Mono", "Liberation Mono", "JetBrains Mono", "Fira Code", Cousine, "Roboto Mono", "Courier New", Courier, sans-serif, system-ui; background-color: rgb(235, 238, 242); border-radius: 6px; align-items: center; padding: 0px 5px; display: inline-flex; font-size: 0.875em !important;">LOB_AS_FILE</code> 等选项,导入时需要对应处理。一般默认方式下,LOB数据正常导入。</p></li></ul><h3 style="font-style: normal; font-variant: normal; font-size-adjust: none; font-language-override: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 20px; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; margin: 32px 0px 16px; color: rgb(15, 17, 21); white-space: normal; background-color: rgb(255, 255, 255); line-height: 1.75em;"><strong>5. 权限</strong></h3><ul style="margin: 16px 0px; padding-left: 18px; color: rgb(15, 17, 21); font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; white-space: normal; background-color: rgb(255, 255, 255);" class=" list-paddingleft-2"><li><p style="margin-bottom: 0px; line-height: 1.75em; margin-top: 0px !important;">执行导入的用户(如 <code style="box-sizing: border-box; font-variant: normal; font-stretch: 100%; line-height: 22px; font-optical-sizing: auto; font-size-adjust: none; font-kerning: auto; font-feature-settings: normal; font-variation-settings: normal; font-language-override: normal; font-family: Menlo, Monaco, Consolas, "Cascadia Mono", "Ubuntu Mono", "DejaVu Sans Mono", "Liberation Mono", "JetBrains Mono", "Fira Code", Cousine, "Roboto Mono", "Courier New", Courier, sans-serif, system-ui; background-color: rgb(235, 238, 242); border-radius: 6px; align-items: center; padding: 0px 5px; display: inline-flex; font-size: 0.875em !important;">SYSDBA</code>)需要拥有创建用户、角色的权限,以及导入对象的相应权限。普通用户导入自己的对象时无需特殊权限。</p></li></ul><h3 style="font-style: normal; font-variant: normal; font-size-adjust: none; font-language-override: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 20px; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; margin: 32px 0px 16px; color: rgb(15, 17, 21); white-space: normal; background-color: rgb(255, 255, 255); line-height: 1.75em;"><strong>6. 字符集</strong></h3><ul style="margin: 16px 0px; padding-left: 18px; color: rgb(15, 17, 21); font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; white-space: normal; background-color: rgb(255, 255, 255);" class=" list-paddingleft-2"><li><p style="margin-bottom: 0px; line-height: 1.75em; margin-top: 0px !important;">若导出库与目标库字符集不一致,可能导致中文乱码或数据截断。建议提前使用 <code style="box-sizing: border-box; font-variant: normal; font-stretch: 100%; line-height: 22px; font-optical-sizing: auto; font-size-adjust: none; font-kerning: auto; font-feature-settings: normal; font-variation-settings: normal; font-language-override: normal; font-family: Menlo, Monaco, Consolas, "Cascadia Mono", "Ubuntu Mono", "DejaVu Sans Mono", "Liberation Mono", "JetBrains Mono", "Fira Code", Cousine, "Roboto Mono", "Courier New", Courier, sans-serif, system-ui; background-color: rgb(235, 238, 242); border-radius: 6px; align-items: center; padding: 0px 5px; display: inline-flex; font-size: 0.875em !important;">SELECT * FROM V$NLS_PARAMETERS WHERE PARAMETER='NLS_CHARACTERSET';</code> 检查两库字符集,保持一致。</p></li></ul><h3 style="font-style: normal; font-variant: normal; font-size-adjust: none; font-language-override: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 20px; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; margin: 32px 0px 16px; color: rgb(15, 17, 21); white-space: normal; background-color: rgb(255, 255, 255); line-height: 1.75em;"><strong>7. 日志分析</strong></h3><ul style="margin: 16px 0px; padding-left: 18px; color: rgb(15, 17, 21); font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; white-space: normal; background-color: rgb(255, 255, 255);" class=" list-paddingleft-2"><li><p style="margin-bottom: 0px; line-height: 1.75em; margin-top: 0px !important;">导入完成后,务必查看日志文件(<code style="box-sizing: border-box; font-variant: normal; font-stretch: 100%; line-height: 22px; font-optical-sizing: auto; font-size-adjust: none; font-kerning: auto; font-feature-settings: normal; font-variation-settings: normal; font-language-override: normal; font-family: Menlo, Monaco, Consolas, "Cascadia Mono", "Ubuntu Mono", "DejaVu Sans Mono", "Liberation Mono", "JetBrains Mono", "Fira Code", Cousine, "Roboto Mono", "Courier New", Courier, sans-serif, system-ui; background-color: rgb(235, 238, 242); border-radius: 6px; align-items: center; padding: 0px 5px; display: inline-flex; font-size: 0.875em !important;">LOG=...</code>),确认无错误(<code style="box-sizing: border-box; font-variant: normal; font-stretch: 100%; line-height: 22px; font-optical-sizing: auto; font-size-adjust: none; font-kerning: auto; font-feature-settings: normal; font-variation-settings: normal; font-language-override: normal; font-family: Menlo, Monaco, Consolas, "Cascadia Mono", "Ubuntu Mono", "DejaVu Sans Mono", "Liberation Mono", "JetBrains Mono", "Fira Code", Cousine, "Roboto Mono", "Courier New", Courier, sans-serif, system-ui; background-color: rgb(235, 238, 242); border-radius: 6px; align-items: center; padding: 0px 5px; display: inline-flex; font-size: 0.875em !important;">Error</code>)或警告(<code style="box-sizing: border-box; font-variant: normal; font-stretch: 100%; line-height: 22px; font-optical-sizing: auto; font-size-adjust: none; font-kerning: auto; font-feature-settings: normal; font-variation-settings: normal; font-language-override: normal; font-family: Menlo, Monaco, Consolas, "Cascadia Mono", "Ubuntu Mono", "DejaVu Sans Mono", "Liberation Mono", "JetBrains Mono", "Fira Code", Cousine, "Roboto Mono", "Courier New", Courier, sans-serif, system-ui; background-color: rgb(235, 238, 242); border-radius: 6px; align-items: center; padding: 0px 5px; display: inline-flex; font-size: 0.875em !important;">Warning</code>)。若存在失败对象,需单独处理。</p></li></ul><h3 style="font-style: normal; font-variant: normal; font-size-adjust: none; font-language-override: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 20px; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; margin: 32px 0px 16px; color: rgb(15, 17, 21); white-space: normal; background-color: rgb(255, 255, 255); line-height: 1.75em;"><strong>8. 并行导入限制</strong></h3><ul style="margin: 16px 0px; padding-left: 18px; color: rgb(15, 17, 21); font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; white-space: normal; background-color: rgb(255, 255, 255);" class=" list-paddingleft-2"><li><p style="margin-bottom: 0px; line-height: 1.75em; margin-top: 0px !important;">使用 <code style="box-sizing: border-box; font-variant: normal; font-stretch: 100%; line-height: 22px; font-optical-sizing: auto; font-size-adjust: none; font-kerning: auto; font-feature-settings: normal; font-variation-settings: normal; font-language-override: normal; font-family: Menlo, Monaco, Consolas, "Cascadia Mono", "Ubuntu Mono", "DejaVu Sans Mono", "Liberation Mono", "JetBrains Mono", "Fira Code", Cousine, "Roboto Mono", "Courier New", Courier, sans-serif, system-ui; background-color: rgb(235, 238, 242); border-radius: 6px; align-items: center; padding: 0px 5px; display: inline-flex; font-size: 0.875em !important;">PARALLEL</code> 时,要求导出文件为多文件格式(即 <code style="box-sizing: border-box; font-variant: normal; font-stretch: 100%; line-height: 22px; font-optical-sizing: auto; font-size-adjust: none; font-kerning: auto; font-feature-settings: normal; font-variation-settings: normal; font-language-override: normal; font-family: Menlo, Monaco, Consolas, "Cascadia Mono", "Ubuntu Mono", "DejaVu Sans Mono", "Liberation Mono", "JetBrains Mono", "Fira Code", Cousine, "Roboto Mono", "Courier New", Courier, sans-serif, system-ui; background-color: rgb(235, 238, 242); border-radius: 6px; align-items: center; padding: 0px 5px; display: inline-flex; font-size: 0.875em !important;">dexp</code> 时使用了 <code style="box-sizing: border-box; font-variant: normal; font-stretch: 100%; line-height: 22px; font-optical-sizing: auto; font-size-adjust: none; font-kerning: auto; font-feature-settings: normal; font-variation-settings: normal; font-language-override: normal; font-family: Menlo, Monaco, Consolas, "Cascadia Mono", "Ubuntu Mono", "DejaVu Sans Mono", "Liberation Mono", "JetBrains Mono", "Fira Code", Cousine, "Roboto Mono", "Courier New", Courier, sans-serif, system-ui; background-color: rgb(235, 238, 242); border-radius: 6px; align-items: center; padding: 0px 5px; display: inline-flex; font-size: 0.875em !important;">FILESIZE</code> 或 <code style="box-sizing: border-box; font-variant: normal; font-stretch: 100%; line-height: 22px; font-optical-sizing: auto; font-size-adjust: none; font-kerning: auto; font-feature-settings: normal; font-variation-settings: normal; font-language-override: normal; font-family: Menlo, Monaco, Consolas, "Cascadia Mono", "Ubuntu Mono", "DejaVu Sans Mono", "Liberation Mono", "JetBrains Mono", "Fira Code", Cousine, "Roboto Mono", "Courier New", Courier, sans-serif, system-ui; background-color: rgb(235, 238, 242); border-radius: 6px; align-items: center; padding: 0px 5px; display: inline-flex; font-size: 0.875em !important;">PARALLEL</code> 导出)。否则 <code style="box-sizing: border-box; font-variant: normal; font-stretch: 100%; line-height: 22px; font-optical-sizing: auto; font-size-adjust: none; font-kerning: auto; font-feature-settings: normal; font-variation-settings: normal; font-language-override: normal; font-family: Menlo, Monaco, Consolas, "Cascadia Mono", "Ubuntu Mono", "DejaVu Sans Mono", "Liberation Mono", "JetBrains Mono", "Fira Code", Cousine, "Roboto Mono", "Courier New", Courier, sans-serif, system-ui; background-color: rgb(235, 238, 242); border-radius: 6px; align-items: center; padding: 0px 5px; display: inline-flex; font-size: 0.875em !important;">dimp</code> 的并行无效。</p></li></ul><hr style="background: none 0% 0% / auto repeat scroll padding-box border-box rgba(0, 0, 0, 0.1); border-width: medium; border-style: none; border-color: currentcolor; border-image: initial; height: 1px; margin: 32px 0px; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; white-space: normal;"/><h2 style="font-style: normal; font-variant: normal; font-size-adjust: none; font-language-override: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 22px; line-height: 32px; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; margin: 32px 0px 16px; color: rgb(15, 17, 21); white-space: normal; background-color: rgb(255, 255, 255);"><strong>验证导入结果</strong></h2><p class="ds-markdown-paragraph" style="margin: 16px 0px; color: rgb(15, 17, 21); font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; white-space: normal; background-color: rgb(255, 255, 255);">导入后,通过 <code style="box-sizing: border-box; font-variant: normal; font-stretch: 100%; line-height: 22px; font-optical-sizing: auto; font-size-adjust: none; font-kerning: auto; font-feature-settings: normal; font-variation-settings: normal; font-language-override: normal; font-family: Menlo, Monaco, Consolas, "Cascadia Mono", "Ubuntu Mono", "DejaVu Sans Mono", "Liberation Mono", "JetBrains Mono", "Fira Code", Cousine, "Roboto Mono", "Courier New", Courier, sans-serif, system-ui; background-color: rgb(235, 238, 242); border-radius: 6px; align-items: center; padding: 0px 5px; display: inline-flex; font-size: 0.875em !important;">disql</code> 登录目标库,执行以下检查:</p><pre class="brush:bash;toolbar:false">-- 检查表行数
SELECT COUNT(*) FROM SCHEMA_NAME.TABLE_NAME;
-- 检查对象是否存在
SELECT OBJECT_NAME, OBJECT_TYPE FROM ALL_OBJECTS WHERE OWNER='SCHEMA_NAME';
-- 检查约束状态
SELECT CONSTRAINT_NAME, STATUS FROM ALL_CONSTRAINTS WHERE OWNER='SCHEMA_NAME';</pre><hr/><h2 style="font-style: normal; font-variant: normal; font-size-adjust: none; font-language-override: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 22px; line-height: 32px; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; margin: 32px 0px 16px; color: rgb(15, 17, 21); white-space: normal; background-color: rgb(255, 255, 255);"><strong>常见报错及处理</strong></h2><div class="ds-scroll-area ds-scroll-area--show-on-focus-within _1210dd7 c03cafe9" style="z-index: 0; --ds-scroll-area-gutters-disappear-delay: 1s; position: relative; overflow-x: auto; scrollbar-width: none; color: rgb(15, 17, 21); font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; white-space: normal; background-color: rgb(255, 255, 255);"><table width="752"><thead><tr class="firstRow"><th style="border-bottom: 1px solid rgba(0, 0, 0, 0.12); font: 500 15px / 25px quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; border-top-width: medium; border-top-style: none; border-top-color: currentcolor; padding: 10px 16px 10px 0px; text-align: left;">报错信息</th><th style="border-bottom: 1px solid rgba(0, 0, 0, 0.12); font: 500 15px / 25px quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; border-top-width: medium; border-top-style: none; border-top-color: currentcolor; padding: 10px 16px; text-align: left;">原因</th><th style="border-bottom: 1px solid rgba(0, 0, 0, 0.12); font: 500 15px / 25px quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; border-top-width: medium; border-top-style: none; border-top-color: currentcolor; padding: 10px 16px; text-align: left;">解决方案</th></tr></thead><tbody><tr><td style="border-bottom: 1px solid rgba(0, 0, 0, 0.1); font-style: normal; font-variant: normal; font-size-adjust: none; font-language-override: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 15px; line-height: 25px; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; min-width: 100px; max-width: min(30vw, 320px); padding: 10px 16px 10px 0px;"><code style="box-sizing: border-box; font-style: normal; font-variant: normal; font-size-adjust: none; font-language-override: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 13px; line-height: 22px; font-family: Menlo, Monaco, Consolas, "Cascadia Mono", "Ubuntu Mono", "DejaVu Sans Mono", "Liberation Mono", "JetBrains Mono", "Fira Code", Cousine, "Roboto Mono", "Courier New", Courier, sans-serif, system-ui; background-color: rgb(235, 238, 242); border-radius: 6px; align-items: center; padding: 0px 5px; display: inline-flex;">ORA-00942: table or view does not exist</code></td><td style="border-bottom: 1px solid rgba(0, 0, 0, 0.1); font-style: normal; font-variant: normal; font-size-adjust: none; font-language-override: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 15px; line-height: 25px; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; min-width: 100px; max-width: min(30vw, 320px); padding: 10px 16px;">目标库不存在该表或用户</td><td style="border-bottom: 1px solid rgba(0, 0, 0, 0.1); font-style: normal; font-variant: normal; font-size-adjust: none; font-language-override: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 15px; line-height: 25px; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; min-width: 100px; max-width: min(30vw, 320px); padding: 10px 0px 10px 16px;">使用 <code style="box-sizing: border-box; font-style: normal; font-variant: normal; font-size-adjust: none; font-language-override: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 13px; line-height: 22px; font-family: Menlo, Monaco, Consolas, "Cascadia Mono", "Ubuntu Mono", "DejaVu Sans Mono", "Liberation Mono", "JetBrains Mono", "Fira Code", Cousine, "Roboto Mono", "Courier New", Courier, sans-serif, system-ui; background-color: rgb(235, 238, 242); border-radius: 6px; align-items: center; padding: 0px 5px; display: inline-flex;">IGNORE=Y</code> 跳过,或先创建用户/模式</td></tr><tr><td style="border-bottom: 1px solid rgba(0, 0, 0, 0.1); font-style: normal; font-variant: normal; font-size-adjust: none; font-language-override: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 15px; line-height: 25px; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; min-width: 100px; max-width: min(30vw, 320px); padding: 10px 16px 10px 0px;"><code style="box-sizing: border-box; font-style: normal; font-variant: normal; font-size-adjust: none; font-language-override: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 13px; line-height: 22px; font-family: Menlo, Monaco, Consolas, "Cascadia Mono", "Ubuntu Mono", "DejaVu Sans Mono", "Liberation Mono", "JetBrains Mono", "Fira Code", Cousine, "Roboto Mono", "Courier New", Courier, sans-serif, system-ui; background-color: rgb(235, 238, 242); border-radius: 6px; align-items: center; padding: 0px 5px; display: inline-flex;">IMP-00058: ORACLE error 942 encountered</code></td><td style="border-bottom: 1px solid rgba(0, 0, 0, 0.1); font-style: normal; font-variant: normal; font-size-adjust: none; font-language-override: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 15px; line-height: 25px; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; min-width: 100px; max-width: min(30vw, 320px); padding: 10px 16px;">导入时依赖的对象不存在</td><td style="border-bottom: 1px solid rgba(0, 0, 0, 0.1); font-style: normal; font-variant: normal; font-size-adjust: none; font-language-override: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 15px; line-height: 25px; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; min-width: 100px; max-width: min(30vw, 320px); padding: 10px 0px 10px 16px;">检查导入顺序(先导入结构,再导入数据)</td></tr><tr><td style="border-bottom: 1px solid rgba(0, 0, 0, 0.1); font-style: normal; font-variant: normal; font-size-adjust: none; font-language-override: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 15px; line-height: 25px; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; min-width: 100px; max-width: min(30vw, 320px); padding: 10px 16px 10px 0px;"><code style="box-sizing: border-box; font-style: normal; font-variant: normal; font-size-adjust: none; font-language-override: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 13px; line-height: 22px; font-family: Menlo, Monaco, Consolas, "Cascadia Mono", "Ubuntu Mono", "DejaVu Sans Mono", "Liberation Mono", "JetBrains Mono", "Fira Code", Cousine, "Roboto Mono", "Courier New", Courier, sans-serif, system-ui; background-color: rgb(235, 238, 242); border-radius: 6px; align-items: center; padding: 0px 5px; display: inline-flex;">IMP-00041: Column data type mismatch</code></td><td style="border-bottom: 1px solid rgba(0, 0, 0, 0.1); font-style: normal; font-variant: normal; font-size-adjust: none; font-language-override: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 15px; line-height: 25px; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; min-width: 100px; max-width: min(30vw, 320px); padding: 10px 16px;">表结构不匹配(列类型改变)</td><td style="border-bottom: 1px solid rgba(0, 0, 0, 0.1); font-style: normal; font-variant: normal; font-size-adjust: none; font-language-override: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 15px; line-height: 25px; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; min-width: 100px; max-width: min(30vw, 320px); padding: 10px 0px 10px 16px;">删除目标表,让导入重新创建</td></tr><tr><td style="border-bottom: 1px solid rgba(0, 0, 0, 0.1); font-style: normal; font-variant: normal; font-size-adjust: none; font-language-override: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 15px; line-height: 25px; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; min-width: 100px; max-width: min(30vw, 320px); padding: 10px 16px 10px 0px;"><code style="box-sizing: border-box; font-style: normal; font-variant: normal; font-size-adjust: none; font-language-override: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 13px; line-height: 22px; font-family: Menlo, Monaco, Consolas, "Cascadia Mono", "Ubuntu Mono", "DejaVu Sans Mono", "Liberation Mono", "JetBrains Mono", "Fira Code", Cousine, "Roboto Mono", "Courier New", Courier, sans-serif, system-ui; background-color: rgb(235, 238, 242); border-radius: 6px; align-items: center; padding: 0px 5px; display: inline-flex;">IMP-00017: following statement failed with ORACLE error 1</code></td><td style="border-bottom: 1px solid rgba(0, 0, 0, 0.1); font-style: normal; font-variant: normal; font-size-adjust: none; font-language-override: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 15px; line-height: 25px; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; min-width: 100px; max-width: min(30vw, 320px); padding: 10px 16px;">违反唯一约束</td><td style="border-bottom: 1px solid rgba(0, 0, 0, 0.1); font-style: normal; font-variant: normal; font-size-adjust: none; font-language-override: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 15px; line-height: 25px; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; min-width: 100px; max-width: min(30vw, 320px); padding: 10px 0px 10px 16px;">使用 <code style="box-sizing: border-box; font-style: normal; font-variant: normal; font-size-adjust: none; font-language-override: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 13px; line-height: 22px; font-family: Menlo, Monaco, Consolas, "Cascadia Mono", "Ubuntu Mono", "DejaVu Sans Mono", "Liberation Mono", "JetBrains Mono", "Fira Code", Cousine, "Roboto Mono", "Courier New", Courier, sans-serif, system-ui; background-color: rgb(235, 238, 242); border-radius: 6px; align-items: center; padding: 0px 5px; display: inline-flex;">TABLE_EXISTS_ACTION=TRUNCATE</code> 清空表,或清理重复数据</td></tr><tr><td style="border-bottom: 1px solid rgba(0, 0, 0, 0.1); font-style: normal; font-variant: normal; font-size-adjust: none; font-language-override: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 15px; line-height: 25px; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; min-width: 100px; max-width: min(30vw, 320px); padding: 10px 16px 10px 0px;"><code style="box-sizing: border-box; font-style: normal; font-variant: normal; font-size-adjust: none; font-language-override: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 13px; line-height: 22px; font-family: Menlo, Monaco, Consolas, "Cascadia Mono", "Ubuntu Mono", "DejaVu Sans Mono", "Liberation Mono", "JetBrains Mono", "Fira Code", Cousine, "Roboto Mono", "Courier New", Courier, sans-serif, system-ui; background-color: rgb(235, 238, 242); border-radius: 6px; align-items: center; padding: 0px 5px; display: inline-flex;">IMP-00033: Warning: Table "..." already exists, data will be skipped</code></td><td style="border-bottom: 1px solid rgba(0, 0, 0, 0.1); font-style: normal; font-variant: normal; font-size-adjust: none; font-language-override: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 15px; line-height: 25px; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; min-width: 100px; max-width: min(30vw, 320px); padding: 10px 16px;">表存在且未指定动作</td><td style="border-bottom: 1px solid rgba(0, 0, 0, 0.1); font-style: normal; font-variant: normal; font-size-adjust: none; font-language-override: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 15px; line-height: 25px; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; min-width: 100px; max-width: min(30vw, 320px); padding: 10px 0px 10px 16px;">添加 <code style="box-sizing: border-box; font-style: normal; font-variant: normal; font-size-adjust: none; font-language-override: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 13px; line-height: 22px; font-family: Menlo, Monaco, Consolas, "Cascadia Mono", "Ubuntu Mono", "DejaVu Sans Mono", "Liberation Mono", "JetBrains Mono", "Fira Code", Cousine, "Roboto Mono", "Courier New", Courier, sans-serif, system-ui; background-color: rgb(235, 238, 242); border-radius: 6px; align-items: center; padding: 0px 5px; display: inline-flex;">TABLE_EXISTS_ACTION=REPLACE/TRUNCATE/APPEND</code></td></tr></tbody></table></div><hr/><h3 style="font-variant: normal; white-space: normal; font-size-adjust: none; font-language-override: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 20px; line-height: 30px; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; margin: 32px 0px 16px; color: rgb(15, 17, 21); background-color: rgb(255, 255, 255);"><strong><span style="font-size: 24px;">达梦数据库</span></strong><strong><span style="font-size: 24px;">表级误删恢复(应急响应场景)</span></strong></h3><p style="margin: 16px 0px; color: rgb(15, 17, 21); font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; white-space: normal; background-color: rgb(255, 255, 255); line-height: 1.75em;">当误删某张表时,利用之前的逻辑备份或从物理备份中提取,是生产环境最高频的操作 <a href="https://eco.dameng.com/community/article/202403151021318ZA0OFTTNPAPYGMV5A" target="_blank" rel="noreferrer noopener" style="color: rgb(57, 100, 254); transition: box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1); border-width: 2px 3px; border-style: solid; border-color: rgba(255, 255, 255, 0); margin-left: -3px; margin-right: -3px; text-decoration: none; position: relative; cursor: default;"></a>。</p><p style="margin-bottom: 8px; line-height: 1.75em; margin-top: 0px !important;"><span style="font-weight: 600;">1.初始化临时实例</span>(从物理备份中提取数据)<br/>如果只有物理全量备份,需要在一个临时目录初始化新库用于恢复。</p><pre class="brush:bash;toolbar:false"># 初始化一个临时实例(注意端口不能冲突,如 5237)
cd /dm8/bin
./dminit PATH=/dm8/temp_data PORT_NUM=5237</pre><p style="margin-bottom: 0px; line-height: 1.75em; margin-top: 0px !important;"><span style="font-weight: 600;">2.将物理备份恢复到临时实例</span><br/>使用上一步全库恢复的 <code style="box-sizing: border-box; font-variant: normal; font-stretch: 100%; line-height: 22px; font-optical-sizing: auto; font-size-adjust: none; font-kerning: auto; font-feature-settings: normal; font-variation-settings: normal; font-language-override: normal; font-family: Menlo, Monaco, Consolas, "Cascadia Mono", "Ubuntu Mono", "DejaVu Sans Mono", "Liberation Mono", "JetBrains Mono", "Fira Code", Cousine, "Roboto Mono", "Courier New", Courier, sans-serif, system-ui; background-color: rgb(235, 238, 242); border-radius: 6px; align-items: center; padding: 0px 5px; display: inline-flex; font-size: 0.875em !important;">dmrman</code> 三步操作,将备份集恢复到 <code style="box-sizing: border-box; font-variant: normal; font-stretch: 100%; line-height: 22px; font-optical-sizing: auto; font-size-adjust: none; font-kerning: auto; font-feature-settings: normal; font-variation-settings: normal; font-language-override: normal; font-family: Menlo, Monaco, Consolas, "Cascadia Mono", "Ubuntu Mono", "DejaVu Sans Mono", "Liberation Mono", "JetBrains Mono", "Fira Code", Cousine, "Roboto Mono", "Courier New", Courier, sans-serif, system-ui; background-color: rgb(235, 238, 242); border-radius: 6px; align-items: center; padding: 0px 5px; display: inline-flex; font-size: 0.875em !important;">/dm8/temp_data</code> 目录。</p><p style="margin-bottom: 8px; line-height: 1.75em; margin-top: 0px !important;"><span style="font-weight: 600;">3.从临时实例导出误删表</span></p><pre class="brush:bash;toolbar:false"># 启动临时实例
./dmserver /dm8/temp_data/DAMENG/dm.ini
# 另开窗口,导出需要恢复的表
./dexp SYSDBA/SYSDBA@localhost:5237 DIRECTORY=/dm8/backup FILE=miss_table.dmp TABLES=SCHEMA_NAME.MISS_TABLE</pre><p class="ds-markdown-paragraph" style="margin-bottom: 8px; margin-top: 0px !important;"><span style="font-weight: 600;">4.导入生产环境</span></p><pre class="brush:bash;toolbar:false"># 在生产库(5236端口)中导入表
./dimp SYSDBA/SYSDBA@localhost:5236 DIRECTORY=/dm8/backup FILE=miss_table.dmp TABLES=SCHEMA_NAME.MISS_TABLE</pre><p class="ds-markdown-paragraph" style="margin-bottom: 8px; margin-top: 0px !important;">导入后请严格验证数据行数是否一致 <a href="https://eco.dameng.com/community/article/202403151021318ZA0OFTTNPAPYGMV5A" target="_blank" rel="noreferrer noopener" style="color: rgb(57, 100, 254); transition: box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1); border-width: 2px 3px; border-style: solid; border-color: rgba(255, 255, 255, 0); margin-left: -3px; margin-right: -3px; text-decoration: none; position: relative; cursor: default;"></a>。<span style="font-weight: 600;"></span></p><h3 style="font-style: normal; font-variant: normal; font-size-adjust: none; font-language-override: normal; font-kerning: auto; font-optical-sizing: auto; font-feature-settings: normal; font-variation-settings: normal; font-stretch: normal; font-size: 20px; font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; margin: 32px 0px 16px; color: rgb(15, 17, 21); white-space: normal; background-color: rgb(255, 255, 255); line-height: 1.75em;"><strong>生产环境最佳实践建议</strong></h3><ol start="1" style="margin: 16px 0px; padding-left: 18px; color: rgb(15, 17, 21); font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; white-space: normal; background-color: rgb(255, 255, 255);" class=" list-paddingleft-2"><li><p style="margin-bottom: 0px; line-height: 1.75em; margin-top: 0px !important;"><span style="font-weight: 600;">备份集有效性检查</span>:定期使用 <code style="box-sizing: border-box; font-variant: normal; font-stretch: 100%; line-height: 22px; font-optical-sizing: auto; font-size-adjust: none; font-kerning: auto; font-feature-settings: normal; font-variation-settings: normal; font-language-override: normal; font-family: Menlo, Monaco, Consolas, "Cascadia Mono", "Ubuntu Mono", "DejaVu Sans Mono", "Liberation Mono", "JetBrains Mono", "Fira Code", Cousine, "Roboto Mono", "Courier New", Courier, sans-serif, system-ui; background-color: rgb(235, 238, 242); border-radius: 6px; align-items: center; padding: 0px 5px; display: inline-flex; font-size: 0.875em !important;">dmrman</code> 中的 <code style="box-sizing: border-box; font-variant: normal; font-stretch: 100%; line-height: 22px; font-optical-sizing: auto; font-size-adjust: none; font-kerning: auto; font-feature-settings: normal; font-variation-settings: normal; font-language-override: normal; font-family: Menlo, Monaco, Consolas, "Cascadia Mono", "Ubuntu Mono", "DejaVu Sans Mono", "Liberation Mono", "JetBrains Mono", "Fira Code", Cousine, "Roboto Mono", "Courier New", Courier, sans-serif, system-ui; background-color: rgb(235, 238, 242); border-radius: 6px; align-items: center; padding: 0px 5px; display: inline-flex; font-size: 0.875em !important;">CHECK BACKUPSET</code> 命令验证备份集是否损坏。</p></li><li><p style="margin-bottom: 0px; line-height: 1.75em; margin-top: 0px !important;"><span style="font-weight: 600;">异地备份</span>:生产环境的备份集务必通过脚本(如 <code style="box-sizing: border-box; font-variant: normal; font-stretch: 100%; line-height: 22px; font-optical-sizing: auto; font-size-adjust: none; font-kerning: auto; font-feature-settings: normal; font-variation-settings: normal; font-language-override: normal; font-family: Menlo, Monaco, Consolas, "Cascadia Mono", "Ubuntu Mono", "DejaVu Sans Mono", "Liberation Mono", "JetBrains Mono", "Fira Code", Cousine, "Roboto Mono", "Courier New", Courier, sans-serif, system-ui; background-color: rgb(235, 238, 242); border-radius: 6px; align-items: center; padding: 0px 5px; display: inline-flex; font-size: 0.875em !important;">rsync</code>、<code style="box-sizing: border-box; font-variant: normal; font-stretch: 100%; line-height: 22px; font-optical-sizing: auto; font-size-adjust: none; font-kerning: auto; font-feature-settings: normal; font-variation-settings: normal; font-language-override: normal; font-family: Menlo, Monaco, Consolas, "Cascadia Mono", "Ubuntu Mono", "DejaVu Sans Mono", "Liberation Mono", "JetBrains Mono", "Fira Code", Cousine, "Roboto Mono", "Courier New", Courier, sans-serif, system-ui; background-color: rgb(235, 238, 242); border-radius: 6px; align-items: center; padding: 0px 5px; display: inline-flex; font-size: 0.875em !important;">scp</code>)同步至另一台服务器或对象存储,防止物理硬件损坏。</p></li><li><p style="margin-bottom: 8px; line-height: 1.75em; margin-top: 0px !important;"><span style="font-weight: 600;">关键参数配置</span>:</p></li><ul style="margin: 4px 0px 0px; padding-left: 18px;" class=" list-paddingleft-2"><li><p style="margin-bottom: 0px; line-height: 1.75em; margin-top: 0px !important;"><code style="box-sizing: border-box; font-variant: normal; font-stretch: 100%; line-height: 22px; font-optical-sizing: auto; font-size-adjust: none; font-kerning: auto; font-feature-settings: normal; font-variation-settings: normal; font-language-override: normal; font-family: Menlo, Monaco, Consolas, "Cascadia Mono", "Ubuntu Mono", "DejaVu Sans Mono", "Liberation Mono", "JetBrains Mono", "Fira Code", Cousine, "Roboto Mono", "Courier New", Courier, sans-serif, system-ui; background-color: rgb(235, 238, 242); border-radius: 6px; align-items: center; padding: 0px 5px; display: inline-flex; font-size: 0.875em !important;">COMPRESSED</code>:备份时开启压缩(级别5-6),显著节省磁盘空间 <a href="https://damodev.csdn.net/6886edf8bb9d8e0ecec365a5.html" target="_blank" rel="noreferrer noopener" style="color: rgb(57, 100, 254); transition: box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1); border-width: 2px 3px; border-style: solid; border-color: rgba(255, 255, 255, 0); margin-left: -3px; margin-right: -3px; text-decoration: none; position: relative; cursor: default;"></a>。</p></li><li><p style="margin-bottom: 0px; line-height: 1.75em; margin-top: 0px !important;"><code style="box-sizing: border-box; font-variant: normal; font-stretch: 100%; line-height: 22px; font-optical-sizing: auto; font-size-adjust: none; font-kerning: auto; font-feature-settings: normal; font-variation-settings: normal; font-language-override: normal; font-family: Menlo, Monaco, Consolas, "Cascadia Mono", "Ubuntu Mono", "DejaVu Sans Mono", "Liberation Mono", "JetBrains Mono", "Fira Code", Cousine, "Roboto Mono", "Courier New", Courier, sans-serif, system-ui; background-color: rgb(235, 238, 242); border-radius: 6px; align-items: center; padding: 0px 5px; display: inline-flex; font-size: 0.875em !important;">PARALLEL</code>:多核服务器可设置并行度(如4或8),加快备份速度 <a href="https://damodev.csdn.net/6886edf8bb9d8e0ecec365a5.html" target="_blank" rel="noreferrer noopener" style="color: rgb(57, 100, 254); transition: box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1); border-width: 2px 3px; border-style: solid; border-color: rgba(255, 255, 255, 0); margin-left: -3px; margin-right: -3px; text-decoration: none; position: relative; cursor: default;"></a>。</p></li></ul><li><p style="margin-bottom: 0px; line-height: 1.75em; margin-top: 0px !important;"><span style="font-weight: 600;">保留周期</span>:建议全量备份保留30天,归档日志保留7-15天(视磁盘空间而定)。</p></li></ol><blockquote><p class="ds-markdown-paragraph" style="margin-top: 16px; color: rgb(15, 17, 21); font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; white-space: normal; background-color: rgb(255, 255, 255); margin-bottom: 0px !important;"><span style="color: rgb(192, 0, 0);">在生产环境操作前,务必先在测试环境验证备份文件和导入流程。</span></p></blockquote><p class="ds-markdown-paragraph" style="margin-top: 16px; color: rgb(15, 17, 21); font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; white-space: normal; background-color: rgb(255, 255, 255); margin-bottom: 0px !important;"><br/></p><p class="ds-markdown-paragraph" style="margin-top: 16px; color: rgb(15, 17, 21); font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; white-space: normal; background-color: rgb(255, 255, 255); margin-bottom: 0px !important;"><strong>参考:</strong></p><ul class=" list-paddingleft-2" style="list-style-type: disc;"><li><p class="ds-markdown-paragraph" style="margin-top: 16px; color: rgb(15, 17, 21); font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; white-space: normal; background-color: rgb(255, 255, 255); margin-bottom: 0px !important;"><a href="https://chegva.com/6699.html" target="_blank" rel="noopener noreferrer">达梦数据库备份详解</a><br/></p></li><li><p class="ds-markdown-paragraph" style="margin-top: 16px; color: rgb(15, 17, 21); font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; white-space: normal; background-color: rgb(255, 255, 255); margin-bottom: 0px !important;"><a href="https://eco.dameng.com/community/article/cc681fe2a07050114dc2d82dc0712766" target="_blank" rel="noopener noreferrer">达梦数据库备份与还原的操作指南</a><br/></p></li><li><p class="ds-markdown-paragraph" style="margin-top: 16px; color: rgb(15, 17, 21); font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; white-space: normal; background-color: rgb(255, 255, 255); margin-bottom: 0px !important;"><a href="https://eco.dameng.com/community/article/202403151021318ZA0OFTTNPAPYGMV5A" target="_blank" rel="noopener noreferrer">达梦数据库备份恢复实战(物理+逻辑)</a><br/></p></li><li><p class="ds-markdown-paragraph" style="margin-top: 16px; color: rgb(15, 17, 21); font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; white-space: normal; background-color: rgb(255, 255, 255); margin-bottom: 0px !important;"><a href="https://blog.csdn.net/qq_45111959/article/details/147334660" target="_blank" rel="noopener noreferrer">达梦数据库-库级物理备份恢复(超详细版)</a><br/></p></li><li><p class="ds-markdown-paragraph" style="margin-top: 16px; color: rgb(15, 17, 21); font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; white-space: normal; background-color: rgb(255, 255, 255); margin-bottom: 0px !important;"><a href="https://damodev.csdn.net/6886edf8bb9d8e0ecec365a5.html" target="_blank" rel="noopener noreferrer">达梦数据库备份恢复和DTS工具运用(超详细)</a><br/></p></li><li><p class="ds-markdown-paragraph" style="margin-top: 16px; color: rgb(15, 17, 21); font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; white-space: normal; background-color: rgb(255, 255, 255); margin-bottom: 0px !important;"><a href="https://eco.dameng.com/community/article/f6ecc8f22e34c1c0a751af5fcf58e115" target="_blank" rel="noopener noreferrer">银河麒麟V10操作系统上备份还原操作实录</a><br/></p></li></ul><p class="ds-markdown-paragraph" style="margin-top: 16px; color: rgb(15, 17, 21); font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; white-space: normal; background-color: rgb(255, 255, 255); margin-bottom: 0px !important;"><span style="color: rgb(15, 17, 21); font-family: quote-cjk-patch, Inter, system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; background-color: rgb(255, 255, 255);">[/zkqw]</span></p><p><br/></p>