当前位置:网站首页>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;
边栏推荐
猜你喜欢

This visual tool artifact is more intuitive and easy to use!love so much

【软件测试】2022年最火的十大测试工具,你掌握了几个

2022年8月10日:使用 ASP.NET Core 为初学者构建 Web 应用程序--使用 ASP.NET Core 创建 Web UI(没看懂需要再看一遍)

信息系统项目管理师核心考点(六十五)信息安全基础知识网络安全

分享一个后台管理系统可拖拽式组件的设计思路

实例050:随机数

消息队列总结

geemap的详细安装步骤及环境配置

file IO-buffer

二叉树 | 翻转二叉树 | leecode刷题笔记
随机推荐
【秋招】【更新中ing】手撕代码系列
OneNote tutorial, how to organize notebooks in OneNote?
基于深度学习的三维点云分割综述
web项目访问引用jar内部的静态资源
二叉树 | 迭代遍历 | leecode刷题笔记
从零开始配置 vim(7)——自动命令
CFdiv2-Common Number-(奇偶数二分+规律)
Three major logs in mysql
确诊了!是Druid1.1.20的锅,查询无法映射LocalDateTime类型(带源码解析及解决方案)
The Missing Semester of Your CS Education
DC-9靶场下载及渗透实战详细过程(DC靶场系列)
瑞幸咖啡第二季营收33亿:门店达7195家 更换CFO
JS中使用正则表达式g模式和非g模式的区别
实例053:按位异或
二叉树 | 代码随想录学习笔记
BM7 list entry in central
LabVIEW分配多少线程?
RecyclerView上下滑动时,不调用onBindViewHolder 导致列表的item不刷新
链表相加(二)
文件IO-缓冲区