Oracle 19C OGG基礎運維-07減少複製表
Oracle 19C OGG基礎運維-07減少複製表
場景一:源端extract程式和目標端replicat程式引數檔案中透過*來匹配所有表。
場景二:源端extract程式和目標端replicat程式引數檔案中沒有透過*來匹配所有表,而是指定了固定的表。
場景一:源端extract程式和目標端replicat程式引數檔案中透過*來匹配所有表。
例如:
源端:
extract程式
GGSCI (cjcos01 as c##ogg@cjcdb/CJCPDB) 87> edit param ext_01
GGSCI (cjcos01 as c##ogg@cjcdb/CJCPDB) 88> view param ext_01
extract ext_01
userid c##ogg@cjcdb,password oracle
GETUPDATEBEFORES
GETTRUNCATES
BR BRINTERVAL 2H
CACHEMGR CACHESIZE 500MB
WARNLONGTRANS 2H,CHECKINTERVAL 5M
NUMFILES 4000
EOFDELAYCSECS 10
LOGALLSUPCOLS
TRANLOGOPTIONS INTEGRATEDPARAMS (max_sga_size 200, parallelism 2)
discardfile ./dirrpt/jcms.dsc,append, megabytes 200
exttrail ./dirdat/ex
DDL INCLUDE ALL
DDLOPTIONS ADDTRANDATA, REPORT
TABLE cjcpdb.cjc.*;
---TABLE cjcpdb.cjc.emp;
---TABLE cjcpdb.cjc.dept;
---TABLE cjcpdb.cjc.bonus;
---TABLE cjcpdb.cjc.salgrade;
---TABLE cjcpdb.cjc.dummy;
---TABLE cjcpdb.cjc.t1;
pump程式
GGSCI (cjcos01 as c##ogg@cjcdb/CJCPDB) 89> edit param pump_01
GGSCI (cjcos01 as c##ogg@cjcdb/CJCPDB) 90> view param pump_01
extract pump_01
dynamicresolution
setenv (NLS_LANG=AMERICAN_AMERICA.AL32UTF8)
userid c##ogg@cjcdb,password oracle
rmthost 192.168.31.100,mgrport 7809,compress
rmttrail ./dirdat/dp
TABLE cjcpdb.cjc.*;
---TABLE cjcpdb.cjc.emp;
---TABLE cjcpdb.cjc.dept;
---TABLE cjcpdb.cjc.bonus;
---TABLE cjcpdb.cjc.salgrade;
---TABLE cjcpdb.cjc.dummy;
---TABLE cjcpdb.cjc.t1;
目標端:
replicat程式
GGSCI (cjcos02) 48> edit param rep_01
GGSCI (cjcos02) 49> view param rep_01
replicat rep_01
setenv (NLS_LANG=AMERICAN_AMERICA.AL32UTF8)
userid ogg@chenpdb,password oracle
assumetargetdefs
reperror default,discard
discardfile ./dirrpt/replzl.dsc,append,megabytes 50
DDL INCLUDE MAPPED
DDLOPTIONS REPORT
DDLERROR 942 IGNORE
MAP cjcpdb.cjc.*, TARGET chenpdb.chen.*;
---MAP cjcpdb.cjc.emp, TARGET chenpdb.chen.emp;
---MAP cjcpdb.cjc.dept, TARGET chenpdb.chen.dept;
---MAP cjcpdb.cjc.bonus, TARGET chenpdb.chen.bonus;
---MAP cjcpdb.cjc.salgrade, TARGET chenpdb.chen.salgrade;
---MAP cjcpdb.cjc.dummy, TARGET chenpdb.chen.dummy;
---MAP cjcpdb.cjc.t1, TARGET chenpdb.chen.t1;
減少複製表操作:
1 在源端修改extract程式的引數,排除不復制的表。
例如 不復制t1表
源端:
extract引數
GGSCI (cjcos01 as c##ogg@cjcdb/CJCPDB) 97> edit param ext_01
GGSCI (cjcos01 as c##ogg@cjcdb/CJCPDB) 98> view param ext_01
extract ext_01
userid c##ogg@cjcdb,password oracle
GETUPDATEBEFORES
GETTRUNCATES
BR BRINTERVAL 2H
CACHEMGR CACHESIZE 500MB
WARNLONGTRANS 2H,CHECKINTERVAL 5M
NUMFILES 4000
EOFDELAYCSECS 10
LOGALLSUPCOLS
TRANLOGOPTIONS INTEGRATEDPARAMS (max_sga_size 200, parallelism 2)
discardfile ./dirrpt/jcms.dsc,append, megabytes 200
exttrail ./dirdat/ex
DDL INCLUDE ALL
DDLOPTIONS ADDTRANDATA, REPORT
tableexclude cjcpdb.cjc.t1;
TABLE cjcpdb.cjc.*;
---TABLE cjcpdb.cjc.emp;
---TABLE cjcpdb.cjc.dept;
---TABLE cjcpdb.cjc.bonus;
---TABLE cjcpdb.cjc.salgrade;
---TABLE cjcpdb.cjc.dummy;
---TABLE cjcpdb.cjc.t1;
pump引數
GGSCI (cjcos01 as c##ogg@cjcdb/CJCPDB) 99> edit param pump_01
GGSCI (cjcos01 as c##ogg@cjcdb/CJCPDB) 100> view param pump_01
extract pump_01
dynamicresolution
setenv (NLS_LANG=AMERICAN_AMERICA.AL32UTF8)
userid c##ogg@cjcdb,password oracle
rmthost 192.168.31.100,mgrport 7809,compress
rmttrail ./dirdat/dp
tableexclude cjcpdb.cjc.t1;
TABLE cjcpdb.cjc.*;
---TABLE cjcpdb.cjc.emp;
---TABLE cjcpdb.cjc.dept;
---TABLE cjcpdb.cjc.bonus;
---TABLE cjcpdb.cjc.salgrade;
---TABLE cjcpdb.cjc.dummy;
---TABLE cjcpdb.cjc.t1;
2 在目標端修改extract程式的引數,排除不復制的表。
目標端:
在map語句上一行新增:mapexclude cjcpdb.cjc.t1;
GGSCI (cjcos02) 53> edit param rep_01
GGSCI (cjcos02) 54> view param rep_01
replicat rep_01
setenv (NLS_LANG=AMERICAN_AMERICA.AL32UTF8)
userid ogg@chenpdb,password oracle
assumetargetdefs
reperror default,discard
discardfile ./dirrpt/replzl.dsc,append,megabytes 50
DDL INCLUDE MAPPED
DDLOPTIONS REPORT
DDLERROR 942 IGNORE
mapexclude cjcpdb.cjc.t1;
MAP cjcpdb.cjc.*, TARGET chenpdb.chen.*;
---MAP cjcpdb.cjc.emp, TARGET chenpdb.chen.emp;
---MAP cjcpdb.cjc.dept, TARGET chenpdb.chen.dept;
---MAP cjcpdb.cjc.bonus, TARGET chenpdb.chen.bonus;
---MAP cjcpdb.cjc.salgrade, TARGET chenpdb.chen.salgrade;
---MAP cjcpdb.cjc.dummy, TARGET chenpdb.chen.dummy;
---MAP cjcpdb.cjc.t1, TARGET chenpdb.chen.t1;
3 在源端系統上首先驗證所需歸檔日誌存在
檢視指定程式詳細資訊
GGSCI (cjcos01 as c##ogg@cjcdb/CJCPDB) 79> Info ext_01, detail
檢視程式的檢查點資訊
GGSCI (cjcos01 as c##ogg@cjcdb/CJCPDB) 80> Info ext_01, showch
4 重啟extract和replicat程式
源端:停止
stop pump_01
stop ext_01
目標端:停止
stop rep_01
源端:啟動
start pump_01
start ext_01
目標端:啟動
start rep_01
5 更新t1表,檢視資料庫是否同步
源端:
SQL> conn cjc/cjc@cjcpdb
SQL> insert into t1 values(80,'CHEN','AAA');
SQL> insert into t1 values(90,'JCH','BBB');
SQL> commit;
SQL> select * from t1;
DEPTNO DNAME LOC
---------- -------------- -------------
10 ACCOUNTING NEW YORK
20 RESEARCH DALLAS
30 SALES CHICAGO
40 OPERATIONS BOSTON
50 DBA DUNHUA
60 CJC DAPUCHAI
70 CHEN AAA
80 CHEN AAA
90 JCH BBB
9 rows selected.
目標端:t1表資料已不在同步
SQL> select * from t1;
DEPTNO DNAME LOC
---------- -------------- -------------
10 ACCOUNTING NEW YORK
20 RESEARCH DALLAS
30 SALES CHICAGO
40 OPERATIONS BOSTON
50 DBA DUNHUA
60 CJC DAPUCHAI
70 CHEN AAA
7 rows selected.
場景二:源端extract程式和目標端replicat程式引數檔案中沒有透過*來匹配所有表,而是指定了固定的表。
例如:
源端:
extract引數
GGSCI (cjcos01 as c##ogg@cjcdb/CJCPDB) 73> edit param ext_01
GGSCI (cjcos01 as c##ogg@cjcdb/CJCPDB) 74> view param ext_01
extract ext_01
userid c##ogg@cjcdb,password oracle
GETUPDATEBEFORES
GETTRUNCATES
BR BRINTERVAL 2H
CACHEMGR CACHESIZE 500MB
WARNLONGTRANS 2H,CHECKINTERVAL 5M
NUMFILES 4000
EOFDELAYCSECS 10
LOGALLSUPCOLS
TRANLOGOPTIONS INTEGRATEDPARAMS (max_sga_size 200, parallelism 2)
discardfile ./dirrpt/jcms.dsc,append, megabytes 200
exttrail ./dirdat/ex
DDL INCLUDE ALL
DDLOPTIONS ADDTRANDATA, REPORT
---TABLE cjcpdb.cjc.*;
TABLE cjcpdb.cjc.emp;
TABLE cjcpdb.cjc.dept;
TABLE cjcpdb.cjc.bonus;
TABLE cjcpdb.cjc.salgrade;
TABLE cjcpdb.cjc.dummy;
TABLE cjcpdb.cjc.t1;
pump引數
GGSCI (cjcos01 as c##ogg@cjcdb/CJCPDB) 75> edit param pump_01
GGSCI (cjcos01 as c##ogg@cjcdb/CJCPDB) 76> view param pump_01
extract pump_01
dynamicresolution
setenv (NLS_LANG=AMERICAN_AMERICA.AL32UTF8)
userid c##ogg@cjcdb,password oracle
rmthost 192.168.31.100,mgrport 7809,compress
rmttrail ./dirdat/dp
---TABLE cjcpdb.cjc.*;
TABLE cjcpdb.cjc.emp;
TABLE cjcpdb.cjc.dept;
TABLE cjcpdb.cjc.bonus;
TABLE cjcpdb.cjc.salgrade;
TABLE cjcpdb.cjc.dummy;
TABLE cjcpdb.cjc.t1;
目標端:
replicat引數
GGSCI (cjcos02) 43> edit param rep_01
GGSCI (cjcos02) 44> view param rep_01
replicat rep_01
setenv (NLS_LANG=AMERICAN_AMERICA.AL32UTF8)
userid ogg@chenpdb,password oracle
assumetargetdefs
reperror default,discard
discardfile ./dirrpt/replzl.dsc,append,megabytes 50
DDL INCLUDE MAPPED
DDLOPTIONS REPORT
DDLERROR 942 IGNORE
---MAP cjcpdb.cjc.*, TARGET chenpdb.chen.*;
MAP cjcpdb.cjc.emp, TARGET chenpdb.chen.emp;
MAP cjcpdb.cjc.dept, TARGET chenpdb.chen.dept;
MAP cjcpdb.cjc.bonus, TARGET chenpdb.chen.bonus;
MAP cjcpdb.cjc.salgrade, TARGET chenpdb.chen.salgrade;
MAP cjcpdb.cjc.dummy, TARGET chenpdb.chen.dummy;
MAP cjcpdb.cjc.t1, TARGET chenpdb.chen.t1;
減少複製表操作:
1 在源端系統上首先驗證所需歸檔日誌存在
檢視 ext_01程式詳細資訊
GGSCI (cjcos01 as c##ogg@cjcdb/CJCPDB) 79> Info ext_01, detail
檢視 ext_01程式的檢查點資訊
GGSCI (cjcos01 as c##ogg@cjcdb/CJCPDB) 80> Info ext_01, showch
2 在源端停止extract程式
GGSCI (cjcos01 as c##ogg@cjcdb/CJCPDB) 81> stop ext_01
GGSCI (cjcos01 as c##ogg@cjcdb/CJCPDB) 81> stop pump_01
3 在目標端停止replicat程式程式
GGSCI (cjcos02) 45> stop rep_01
4 源端:直接註釋掉該表所在table行即可
例如 :
源端:
extract程式
GGSCI (cjcos01 as c##ogg@cjcdb/CJCPDB) 73> edit param ext_01
GGSCI (cjcos01 as c##ogg@cjcdb/CJCPDB) 74> view param ext_01
extract ext_01
userid c##ogg@cjcdb,password oracle
GETUPDATEBEFORES
GETTRUNCATES
BR BRINTERVAL 2H
CACHEMGR CACHESIZE 500MB
WARNLONGTRANS 2H,CHECKINTERVAL 5M
NUMFILES 4000
EOFDELAYCSECS 10
LOGALLSUPCOLS
TRANLOGOPTIONS INTEGRATEDPARAMS (max_sga_size 200, parallelism 2)
discardfile ./dirrpt/jcms.dsc,append, megabytes 200
exttrail ./dirdat/ex
DDL INCLUDE ALL
DDLOPTIONS ADDTRANDATA, REPORT
---TABLE cjcpdb.cjc.*;
TABLE cjcpdb.cjc.emp;
TABLE cjcpdb.cjc.dept;
TABLE cjcpdb.cjc.bonus;
TABLE cjcpdb.cjc.salgrade;
TABLE cjcpdb.cjc.dummy;
---TABLE cjcpdb.cjc.t1;
pump程式
GGSCI (cjcos01 as c##ogg@cjcdb/CJCPDB) 75> edit param pump_01
GGSCI (cjcos01 as c##ogg@cjcdb/CJCPDB) 76> view param pump_01
extract pump_01
dynamicresolution
setenv (NLS_LANG=AMERICAN_AMERICA.AL32UTF8)
userid c##ogg@cjcdb,password oracle
rmthost 192.168.31.100,mgrport 7809,compress
rmttrail ./dirdat/dp
---TABLE cjcpdb.cjc.*;
TABLE cjcpdb.cjc.emp;
TABLE cjcpdb.cjc.dept;
TABLE cjcpdb.cjc.bonus;
TABLE cjcpdb.cjc.salgrade;
TABLE cjcpdb.cjc.dummy;
---TABLE cjcpdb.cjc.t1;
5 目標端:直接註釋掉該表所在MAP行即可
例如:
目標端:
replicat程式
GGSCI (cjcos02) 43> edit param rep_01
GGSCI (cjcos02) 44> view param rep_01
replicat rep_01
setenv (NLS_LANG=AMERICAN_AMERICA.AL32UTF8)
userid ogg@chenpdb,password oracle
assumetargetdefs
reperror default,discard
discardfile ./dirrpt/replzl.dsc,append,megabytes 50
DDL INCLUDE MAPPED
DDLOPTIONS REPORT
DDLERROR 942 IGNORE
---MAP cjcpdb.cjc.*, TARGET chenpdb.chen.*;
MAP cjcpdb.cjc.emp, TARGET chenpdb.chen.emp;
MAP cjcpdb.cjc.dept, TARGET chenpdb.chen.dept;
MAP cjcpdb.cjc.bonus, TARGET chenpdb.chen.bonus;
MAP cjcpdb.cjc.salgrade, TARGET chenpdb.chen.salgrade;
MAP cjcpdb.cjc.dummy, TARGET chenpdb.chen.dummy;
---MAP cjcpdb.cjc.t1, TARGET chenpdb.chen.t1;
6 目標端啟動replicat程式
start rep_01
7 源端啟動extract程式
start pump_01
start ext_01
8 更新t1表,檢視資料庫是否同步
源端:
SQL> conn cjc/cjc@cjcpdb
SQL> insert into t1 values(70,'CHEN','AAA');
SQL> insert into t1 values(80,'JCH','BBB');
SQL> commit;
SQL> select * from t1;
DEPTNO DNAME LOC
---------- -------------- -------------
10 ACCOUNTING NEW YORK
20 RESEARCH DALLAS
30 SALES CHICAGO
40 OPERATIONS BOSTON
50 DBA DUNHUA
60 CJC DAPUCHAI
70 CHEN AAA
80 JCH BBB
8 rows selected.
目標端:t1表不在同步
SQL> select * from t1;
DEPTNO DNAME LOC
---------- -------------- -------------
10 ACCOUNTING NEW YORK
20 RESEARCH DALLAS
30 SALES CHICAGO
40 OPERATIONS BOSTON
50 DBA DUNHUA
60 CJC DAPUCHAI
6 rows selected.
歡迎關注我的微信公眾號"IT小Chen",共同學習,共同成長!!!
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29785807/viewspace-2685564/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Oracle 19C OGG基礎運維-06增加複製表Oracle運維
- Oracle 19C OGG基礎運維-09OGG-15121錯誤Oracle運維
- Oracle 19C OGG基礎運維-03DML操作同步Oracle運維3D
- Oracle 19C OGG基礎運維-05DDL操作同步Oracle運維
- Oracle 19C OGG基礎運維-01環境準備Oracle運維
- Oracle 19C OGG基礎運維-08Error code [942]Oracle運維Error
- Oracle 19C OGG基礎運維-02資料初始化Oracle運維
- Oracle 19C OGG基礎運維-04DML同步常見問題Oracle運維
- Oracle 19C Data Guard基礎運維-07 failover後閃回恢復dg架構Oracle運維AI架構
- Oracle分割槽表基礎運維-07增加分割槽(2 HASH分割槽)Oracle運維
- Oracle分割槽表基礎運維-07增加分割槽(4 RANGE_HASH)Oracle運維
- Oracle分割槽表基礎運維-07增加分割槽(5RANGE_LIST)Oracle運維
- Oracle分割槽表基礎運維-07增加分割槽(6RANGE_RANGE)Oracle運維
- Oracle分割槽表基礎運維-07增加分割槽(3列表分割槽)Oracle運維
- Oracle 19C Data Guard基礎運維-02 Switchovers(物理)Oracle運維
- Oracle 19C Data Guard基礎運維-03 Failovers(物理)Oracle運維AI
- Oracle 19C Data Guard基礎運維-06 PROTECTION MODEOracle運維
- Oracle分割槽表基礎運維-07增加分割槽(1範圍分割槽)Oracle運維
- Oracle 19C Data Guard基礎運維-08 DML重定向Oracle運維
- Oracle 19C Data Guard基礎運維-04 Failovers疑問?Oracle運維AI
- Oracle 19C Data Guard基礎運維-05Failovers (GAP)Oracle運維AI
- Oracle 19C Data Guard基礎運維-01安裝物理standbyOracle運維
- ORACLE OGG運維及日常監控Oracle運維
- Oracle分割槽表基礎運維-08Coalescing PartitionsOracle運維
- Oracle分割槽表基礎運維-04列表分割槽Oracle運維
- Oracle分割槽表基礎運維-06分割槽表索引Oracle運維索引
- Oracle分割槽表基礎運維-09刪除分割槽Oracle運維
- Oracle分割槽表基礎運維-05組合分割槽Oracle運維
- Oracle分割槽表基礎運維-02範圍分割槽Oracle運維
- Oracle分割槽表基礎運維-03HASH分割槽Oracle運維
- Oracle分割槽表基礎運維-01分割槽表分類Oracle運維
- OGG 12c mysql複製到oracle部署方案MySqlOracle
- Oracle 19c Concepts(07):SQLOracleSQL
- Oracle OGG日常維護Oracle
- ORACLE基礎運維命令操作手冊Oracle運維
- OGG_mysql 12c複製到OGG_oracle 11g部署方案MySqlOracle
- ogg for oracle 19c 非cdb安裝配置Oracle
- Oracle 19c 線上縮減 UNDO 表空間 容量Oracle