当前位置:网站首页>GoldenGate中使用 exp/imp 进行初始化
GoldenGate中使用 exp/imp 进行初始化
2022-08-10 22:48:00 【青木与风】
使用数据泵工具 exp/imp 进行初始化步骤大致如下:
1. 配置同步的 Change Extract 和 Change Replicat 进程。
2. 启动 Change Extract 进程,捕捉改变的数据。
3. 用带有 flashback_scn 的 exp/imp 或者 exp/imp 迁移数据。
4. 迁移结束后启动 Change Replicat, 完成数据同步。
一、准备工作
在目标端数据库 truncate 要初始化同步的表 send.t1:
$sqlplus /nolog
SQL>conn send/send
SQL>truncate table t1;
SQL>select to_char(sysdate, 'yyyy-mm-dd hh24:mi:ss') from dual;
二、添加 Change Extract/Change Replicat 进程
这里沿用之前配置好的源端的 ext0, pmp01 以及目标端的 rep01 进程。
注意:目标端的抽取进程和传输进程要处于 RUNNING, 而复制进程要处于 stop 状态。
检查源端的进程状态:
GGSCI (udbs01) 11> info all
检查目标端的进程状态:
GGSCI (udbs01) 9> info all
发现目标端的 rep01 复制进程为 RUNNING 状态,必须先停止 rep01 进程
GGSCI (udbs01) 10> stop replicat rep01
三、用带 flashback_scn 的 exp/imp 完成初始化
1. 在源端数据库查询当前的 SCN
SQL>show parameter db_name;
SQL>select current_scn from v$database;
2. 在源端导出 send.t1 表的数据
$ exp system/[email protected] tables=send.t_ file=/home/oracle/t.dmp FLASHBACK_SCN=
log=/home/oracle/t.log
3. 源端删除 send.t1 表的部分数据
SQL>deelct from t where rowwnum<500;
SQL>commit;
SQL>select current_scn from v$database;
SQL>seelct count(*) from t1;
4. 将源端 t1 表的 dump 文件 scp 到目标端
$ scp t1.dmp udbs02:/home/oracle
5. 在目标端使用 imp 倒入 t1.dump 文件
$ imp system/[email protected] file=/home/oracle/t1.dmp log=/home/oracle/t1.log fromuser=send touser=send ignore=y
6. 在目标端用 SCN 启动 Replicat 进程
GGSCI (udbs02) 12>start replicat rep01, aftercsn 1286162
GGSCI (udbs02) 13> info all
GGSCI (udbs02) 14>info replicat rep01
四、数据验证
在源端:
$ sqlplus send/[email protected]
SQL>seelct count(*) from t1;
在目标端:
$ sqlplus send/[email protected]
SQL>seelct count(*) from t1;
边栏推荐
- "DevOps Night Talk" - Pilot - Introduction to CNCF Open Source DevOps Project DevStream - feat. PMC member Hu Tao
- canvas
- JS中使用正则表达式g模式和非g模式的区别
- HGAME 2022 Week1 writeup
- geemap的详细安装步骤及环境配置
- BM7 链表中环的入口结点
- How to be a Righteous Hacker?What should you study?
- CIKM2022 | Sequence Recommendation Based on Bidirectional Transformers Contrastive Learning
- 【uniapp】uniapp微信小程序开发:启动微信开发者工具提示no such file or directory错误
- MySQL学习笔记(2)——简单操作
猜你喜欢
IFIT的架构与功能
leetcode:357. 统计各位数字都不同的数字个数
Qualcomm Platform Development Series Explanation (Application) Introduction to QCMAP Application Framework
电力系统潮流计算(牛顿-拉夫逊法、高斯-赛德尔法、快速解耦法)(Matlab代码实现)
文件IO-缓冲区
RK3399 platform development series explanation (kernel-driven peripherals) 6.35, IAM20680 gyroscope introduction
Redis
【软件测试】2022年最火的十大测试工具,你掌握了几个
Pytorch面试题面经
How many threads does LabVIEW allocate?
随机推荐
Nodes in the linked list are flipped in groups of k
二叉树 | 对称二叉树、相同的树、子树相同 | leecode刷题笔记
实例055:按位取反
pytorch tear CNN
gcc492 compile `.rodata‘ can not be used when making a PIE object; recompile with -fPIE
一、ICESat-2数据查询,下载,与处理
Apache Doris支持的数据类型详解
数学建模准备知识
风控逻辑利器---规则引擎
如何反弹shell
Leave a message with a prize | OpenBMB x Tsinghua University NLP: The update of the large model open class is complete!
BM7 list entry in central
68: Chapter 6: Develop article services: 1: Content sorting; article table introduction; creating [article] article services;
使用方便、易于集成、可扩展的用于物流运输行业的文档管理软件
Addition of linked lists (2)
如何成为一名正义黑客?你应该学习什么?
This visual tool artifact is more intuitive and easy to use!love so much
(PC+WAP)带手机端pbootcms模板园林景观类网站
从零开始配置 vim(7)——自动命令
确诊了!是Druid1.1.20的锅,查询无法映射LocalDateTime类型(带源码解析及解决方案)