GoldenGate DDL雙向復制

??

? 繼續上一篇的實驗。

??節點說明:?
? dd1(源庫)--->>kf2(目標庫)
? dd1(目標庫)<<---kf2(源庫)

?

? 在配置反向復制過程中,可暫時把源庫和目標庫調換位置,配置基本上雷同。
?
? 但在官網上有說明要注意的一個地方:
? Do either of the following to? specify the Replicat database us er. All transactions generated
? by this user will be excluded from being captured. This information is available to Extract
? in the transaction record.
? ● Identify the Replicat database user by name with the following parameter statement
? in the Extract parameter file.
? TRANLOGOPTIONS EXCLUDEUSER <user name>
?
? 該參數加到主端和備端的extract 參數文件中,否則會出現死循環復制。


?

1. 在dd1上配置全局參數

?

? GGSCI (dd1) 1> view params ./GLOBALS
?
? ggschema ogguser
?
?
? GGSCI (dd1) 2> edit params ./GLOBALS
?
?
? ggschema ogguser
? checkpointtable ogguser.checkpoint
?
?
? GGSCI (dd1) 3> dblogin userid
ogguser@test1,password ogguser?????????
? Successfully logged into database.
?
? 添加checkpoint表:
? GGSCI (dd1) 4> add checkpointtable
? ERROR: Missing checkpoint table specification.
?
? GGSCI (dd1) 5> add checkpointtable ogguser.checkpoint
?
? Successfully created checkpoint table OGGUSER.CHECKPOINT.
?

?

2. 在kf2上確認全局參數,開啟附加日志,強制日志,歸檔

?

? GGSCI (kf2.calvin) 4> view params ./GLOBALS
?
? GGSCHEMA ogguser
? CHECKPOINTTABLE ogguser.checkpoint
?
?
? SQL> alter database add supplemental log data;
?
? Database altered.
?
? SQL> alter system switch logfile;
?
? System altered.
?
? SQL> alter database force logging;
?
? Database altered.
?
? SQL> alter system set recyclebin=off scope=spfile;
???
? System altered.
?
? SQL> select log_mode,supplemental_log_data_min,force_logging from v$database;
?
? LOG_MODE???? SUPPLEME FOR
? ------------ -------- ---
? ARCHIVELOG?? YES????? YES
?

3. 在kf2上配置ddl支持
?
?
SQL> @marker_setup.sql
?
? SQL> @ddl_setup.sql
?
? SQL> @role_setup.sql
?
? SQL> grant GGS_GGSUSER_ROLE to ogguser;
?
? SQL> @ddl_enable.sql
?
? SQL> @?/rdbms/admin/dbmspool.sql
?
? SQL> @ddl_pin.sql ogguser


?

4. 在kf2上添加extract,exttrail,并配置參數

?

? GGSCI (kf2.calvin) 5> dblogin userid ogguser@test2,password ogguser
? Successfully logged into database.
?
? GGSCI (kf2.calvin) 6> add extract ext1,tranlog,begin now
? EXTRACT added.
?
?
? GGSCI (kf2.calvin) 7> add exttrail /data/oracle/ogg11/dirdat/lt,extract ext1
? EXTTRAIL added.
?
? GGSCI (kf2.calvin) 8> edit params ext1
? extract ext1
? userid
ogguser@test2, password ogguser
? tranlogoptions excludeuser ogguser?? ##避免死循環復制,同樣的,dd1上的extract test1參數也要設置
? rmthost 192.168.130.168, mgrport 7809
? rmttrail /data/oracle/ogg11/dirdat/lt
? ddl include mapped objname stat.*;
? table stat.*;
?
?
? GGSCI (kf2.calvin) 4> info all
?
? Program???? Status????? Group?????? Lag?????????? Time Since Chkpt
?
? MANAGER???? RUNNING??????????????????????????????????????????
? EXTRACT???? RUNNING???? EXT1??????? 00:00:00????? 00:10:24???
? REPLICAT??? RUNNING???? TEST2?????? 00:00:00????? 00:00:07
?

?

5. 在dd1上 添加replicat,extrtrail,并配置參數

?

? GGSCI (dd1) 4> add replicat ext2,exttrail /data/oracle/ogg11/dirdat/lt,checkpointtable ogguser.checkpoint
? REPLICAT added.
?
? GGSCI (dd1) 5> edit params ext2
? replicat ext2
? ASSUMETARGETDEFS
? userid
ogguser@test1,password ogguser
? discardfile /data/oracle/ogg11/dirdat/test1_discard.txt,append, megabytes 10
? DDL INCLUDE MAPPED
? DDLERROR DEFAULT IGNORE RETRYOP
? map stat.*, target stat.*;
?
?
? GGSCI (dd1) 6> start replicat ext2
?
? Sending START request to MANAGER ...
? REPLICAT EXT2 starting
?
?
? GGSCI (dd1) 7> info all
?
? Program???? Status????? Group?????? Lag?????????? Time Since Chkpt
?
? MANAGER???? RUNNING??????????????????????????????????????????
? EXTRACT???? RUNNING???? TEST1?????? 00:00:00????? 00:00:06???
? REPLICAT??? RUNNING???? EXT2??????? 00:00:00????? 00:00:01
??
?

6. 測試數據雙向同步

?

? kf2:
? SQL> create table tp_test2(name varchar2(10));
?
? Table created.
?
? SQL> insert into tp_test2 values('calvin'); ##在kf2上插入數據
?
? 1 row created.
?
? SQL> commit;
?
? Commit complete.
?
? SQL> select * from tp_test2;
?
? NAME
? ----------
? calvin
?
? 1 row selected
?
?
? dd1:
? SQL> select * from tp_test2;
?
? NAME
? ----------
? calvin????????? ##數據已經同步
?
? SQL> insert into tp_test2 values('fish'); ##在dd1上插入數據
?
? 1 row created.
?
? SQL> commit;
?
? Commit complete.
?
? SQL> select * from tp_test2;
?
? NAME
? ----------
? calvin
? fish
?
? kf2:
? SQL> select * from tp_test2;
?
? NAME
? ----------
? calvin
? fish?????????? ##數據已經同步

?

?

?

轉載于:https://www.cnblogs.com/xinyuyuanm/archive/2013/04/17/3027181.html

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/376732.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/376732.shtml
英文地址,請注明出處:http://en.pswp.cn/news/376732.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

轉載|pymysql.err.InternalError: Packet sequence number wrong - got 45 expected 0

原文鏈接&#xff1a;https://www.cnblogs.com/heiao10duan/p/9373237.html 原因&#xff1a; 使用了多線程&#xff0c;多線程共享了同一個數據庫連接&#xff0c;但每個execute前沒有加上互斥鎖 方法&#xff1a; 方法一&#xff1a;每個execute前加上互斥鎖 lock.acquire…

JSF入門

1. 簡介 JSF技術是Sun公司在2004年發布的用于開發Web應用的框架。當前版本是2.2&#xff0c;由JSR344規范定義。它是Java EE 7推薦的Web標準框架。Mojarra(https://javaserverfaces.java.net/)是Oracle官方采用的JSF的參考實現&#xff0c;其他的參考實現還有Apache基金的MyFac…

nyist 488 素數環

有一個整數n&#xff0c;把從1到n的數字無重復的排列成環&#xff0c;且使每相鄰兩個數&#xff08;包括首尾&#xff09;的和都為素數&#xff0c;稱為素數環。 為了簡便起見&#xff0c;我們規定每個素數環都從1開始。例如&#xff0c;下圖就是6的一個素數環。 這題在進行判斷…

Android System分區大小異常

平臺&#xff1a;Freescale &#xff0f; Android 4.2.2 問題描述&#xff1a; 用 df 命令&#xff0c;看到/system分區大小275M。 用 busybox fdisk -l /dev/block/mmcblk0p5&#xff0c;看到 536M。 Freescale的刷機工具是Mfgtool&#xff0c;分區的動作在mksdcard-android.s…

python數據庫連接池使用

在轉載|pymysql.err.InternalError: Packet sequence number wrong - got 45 expected 0這一篇中&#xff0c;我使用了方法一。接下來試試方法三&#xff0c;方法三和方法二其實意義差不多&#xff0c;但是對于數據庫的連接并不是交由程序員管理而是交由連接池管理了&#xff0…

.Net入門-部署問題

學習一門新的語言難免會遇到各種各樣的問題&#xff0c;總結一下。 測試環境&#xff1a;windows2008serverIIS7 開發環境: vs2010 問題1&#xff1a;"Unrecognized attribute targetFramework. Note that attribute names are case-sensitive. " 分析&#xff1a; 開…

pymysql.err.OperationalError: (1203, “User root already has more than ‘max_user_connections‘ active

max_connections 是指MySQL服務器的最大連接數。即所有用戶最大連接數的和。 max_user_connections 是指MySQL中單個用戶的最大連接數。 這里說明當前用戶的連接數大于了單個用戶的最大連接數&#xff0c;需要擴大連接數&#xff1a; mysql> show variables like %connect%…

北京行——JSP入門與Servlet精通

Servlet技術 用來動態生成 網頁數據資源Servlet生成HTML 頁面數據時&#xff0c;所有內容都是通過 response.getWriter response.getOutputStream 向瀏覽器輸出的 <html> <head> </head> <body> Hello </body></html> 用Servlet 輸出流打印…

json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

可以參考一波&#xff1a;https://stackoverflow.com/questions/16573332/jsondecodeerror-expecting-value-line-1-column-1-char-0 1、json格式不對引起的錯誤 加上if json_rep.content:判空操作 json_rep requests.post(url monitor_url, headers monitor_header,json …

WINDOWS系統Eclipse+NDK+Android + OpenCv

WINDOWS系統EclipseNDKAndroid OpenCv 參考文檔博客 1 NDK環境搭建 http://jingyan.baidu.com/article/5d6edee22d908799eadeec9f.html 2 官方文檔 Android.mk與Application.mk如何編寫&#xff0c;OpenCV庫如何調用 http://docs.opencv.org/trunk/doc/tutorials/introduction…

ural 1910. Titan Ruins: Hidden Entrance(Titan Ruins系列題目)

這是Titan Ruins系列第一道題&#xff0c;以后慢慢更新。 赤裸裸滴閱讀理解題&#xff0c;大意就是找到三個連在一起的數&#xff0c;使其之和最大&#xff0c;輸出的第一個數是這三個數的和&#xff0c;第二個數是中間那個數所在的位置。水題一道&#xff0c;很簡單。 1 #incl…

python OSError: [Errno 24] Too many open files | HTTPConnectionPool(host=‘‘, port=80): Max retries e

對于問題&#xff1a;python OSError: [Errno 24] Too many open files 原因:超出了進程同一時間最多可開啟的文件數. 解決方案P: 使用ulimit -n查看進程同一時間最多可開啟的文件數 mac默認是256&#xff0c;linux是1024 修改 sudo vim /etc/security/limits.conf 這個文件的最…

Android 之視頻監控

Android 視頻監控已經有示例了&#xff0c;如http://www.open-open.com/lib/view/open1346400423609.html完全可以實現簡單的監控功能。但是&#xff0c;如果想要在手機上監控另外一個手機就需要做一些改動了。 其中&#xff0c;手機A實現的功能和上文中的一樣&#xff0c;主要…

Max retries exceeded with url 解決方案

目錄問題解決方案keep alive 與close使用場景問題解決方案 在上一篇問題解決中&#xff1a;python OSError: [Errno 24] Too many open files | HTTPConnectionPool(host‘‘, port80): Max retries e 有提到修改本地進程最大文件數來避免Max retries exceeded with url 報錯&…

正確理解JavaScript

過去幾年我注意到技術圈一個很奇怪的現象&#xff0c;有太多程序員將那些他們只是有過非常淺顯的了解&#xff0c; 但其實根本就不懂的技術寫到他們的簡歷中&#xff0c;這個現象幾乎每種語言都有&#xff0c;但這其中最嚴重的就要數javascript了。 你不知道你不懂 出現這種狀況…

醫療機構遠程視頻監控集中管理,貝銳蒲公英提供一站式解決方案

上海某企業專業致力于醫療軟件、家居智能化研發、設計、銷售、集成及實施&#xff0c;企業主營業務之一為醫療軟件&#xff0c;涉及PACS/RIS/WEB/HIS、示教系統等方面的醫院信息化建設。 在實際應用、部署過程中&#xff0c;需要實現各地區分院與總院間的數據庫互相訪問、視頻數…

py腳本:linux系統下定時清理文件

linux清空文件內容的三種方法&#xff1a; 1.使用vi/vim命令打開文件后&#xff0c;輸入"%d"清空&#xff0c;后保存即可。但當文件內容較大時&#xff0c;處理較慢&#xff0c;命令如下&#xff1a; vim file_name :%d :wq2.使用cat命令情況&#xff0c;命令如下&a…

Process類:啟動和停止本地系統進程

Process.Start 方法 (String, String) 通過指定應用程序的名稱和一組命令行參數來啟動一個進程資源。&#xff08;并將該資源與新的 Process 組件相關聯&#xff09; 如果沒有啟動資源&#xff0c;則返回null Process.Start("d:\\0.jpg"); Process.StartInfo 屬性 獲…

NYOJ2括號配對問題

括號配對是最基本的棧的問題&#xff0c;它是棧入門的經典題目&#xff0c;思路是&#xff0c;如果是左括號直接進棧&#xff0c;如果是右括號&#xff0c;這時就要比較棧頂的元素與他是否匹配&#xff0c;如果匹配則出棧&#xff0c;否則進棧&#xff0c;下面是代碼的實現&…

SVC編碼簡單了解

基本概念 可伸縮視頻編碼 SVC&#xff08;Scalable Video Coding&#xff09; 作為 H.264 標準的一個擴展,可用于生成不同幀率、分辨率和質量等可分層的視頻流。 基本層編碼最低層的時域、空域和質量流&#xff1b; 增強層以基本層作為起始點&#xff0c;對附加信息進行補充&a…