【OGG】Oracle GoldenGate 11g (二) GoldenGate 11g 單向同步配置 下
Item |
Source System |
Target System |
Platform |
RHEL6.4 - 64bit |
RHEL6.4 - 64bit |
Hostname |
rhel64.oracle.com |
ora11g.oracle.com |
Database |
Oracle 11.2.0.3 |
Oracle 11.2.0.3 |
Character Set |
AL32UTF8 |
AL32UTF8 |
ORACLE_SID |
PROD |
EMREP |
Listener Name/Port |
LISTENER/1521 |
LISTENER/1521 |
Goldengate User |
ogg |
ogg |
1.6 Configure Replicat process in target system
1.6.1 Create GLOBALS parameter in target system
Edit GLOBALS(upper case) parameter file to indicate checkpoint table
GGSCI (rhel102.oracle.com) 11> edit params ./GLOBALS
Add:
CHECKPOINTTABLE ogg.ggschkpt
Verify:
[oracle@rhel102 ~]$ ll /u01/app/oracle/ggs/11.2.1/GLOBALS -rw-rw-rw- 1 oracle oinstall 29 Jan 5 10:17 /u01/app/oracle/ggs/11.2.1/GLOBALS |
For GLOBALS configuration take effect, we must exit GGSCI session:
GGSCI (rhel102.oracle.com) 14> exit
Add replicat checkpoint table in target system:
[oracle@rhel102 11.2.1]$ ggsci GGSCI (rhel102.oracle.com) 1> dblogin userid ogg,password ogg Successfully logged into database.
GGSCI (rhel102.oracle.com) 2> add checkpointtable
No checkpoint table specified, using GLOBALS specification (ogg.ggschkpt)...
Successfully created checkpoint table ogg.ggschkpt.
|
1.6.2 Edit Delivery process parameter rora_1
Add Replicat group:
GGSCI (rhel102.oracle.com) 5> add replicat rora_1,exttrail ./dirdat/ra
REPLICAT added.、
|
Edit replicat process RORA_1 parameter:
GGSCI (rhel102.oracle.com) 4> edit params rora_1
Add:
-- Change Delivery parameter file to apply scott.ggtab Changes
REPLICAT RORA_1
SETENV (NLS_LANG=AMERICAN_AMERICA.AL32UTF8)
USERID ogg, PASSWORD ogg
HANDLECOLLISIONS
ASSUMETARGETDEFS
DISCARDFILE ./dirrpt/RORAaa.DSC, PURGE
MAP scott.ggtab, TARGET scott.ggtab;
Note: In the MAP statement, the first owner/schema is for the source and the second for the target.
GGSCI (rhel102.oracle.com) 15> view params rora_1
|
Start Replicat process:
GGSCI (rhel102.oracle.com) 7> start replicat rora_1
Sending START request to MANAGER ... REPLICAT RORA_1 starting
GGSCI (rhel102.oracle.com) 8> info replicat rora_1
REPLICAT RORA_1 Last Started 2017-01-05 10:27 Status RUNNING Checkpoint Lag 00:00:00 (updated 00:00:05 ago) Log Read Checkpoint File ./dirdat/ra000000 First Record RBA 0
GGSCI (rhel102.oracle.com) 9> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING REPLICAT RUNNING RORA_1 00:00:00 00:00:08 |
1.6.3 Verify if DML can be duplicated correctly
1.6.3.1 Insert operation
Insert data in source system:
SCOTT@PROD>insert into ggtab values (8888,'Damon','DBA',7788,sysdate,800,100,10); SCOTT@PROD>commit; |
Check the result in target system:
SCOTT@EMREP>select * from ggtab;
|
1.6.3.2 Update operation
Update data:
SCOTT@PROD>update ggtab set ename='lvh' where empno=7788; SCOTT@PROD>commit; |
Check the result in target system:
|
1.6.3.3 Delete operation
Delete data:
SCOTT@PROD>delete from ggtab where deptno=10; SCOTT@PROD>commit; |
Check the result in target system:
SCOTT@EMREP>select * from ggtab;
|
SCOTT@ test1>select * from lvxinghao;
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
------ ------- --------- ----- --------- ------ ----- ------
7788 lxh ANALYST 7566 19-APR-87 3000 20
7839 KING PRESIDENT 17-NOV-81 5000 10
7844 TURNER SALESMAN 7698 08-SEP-81 1500 0 30
7876 ADAMS CLERK 7788 23-MAY-87 1100 20
7900 JAMES CLERK 7698 03-DEC-81 950 30
7902 FORD ANALYST 7566 03-DEC-81 3000 20
7934 MILLER CLERK 7782 23-JAN-82 1300 10
8000 Damon CLERK 7902 13-SEP-14 800 100 20
8001 Elena CLERK 7698 13-SEP-14 600 200 30
9 rows selected.
1.7 Configure eora_1 pora_1 rora_1 同步scott使用者所有表
1.7.1 eora_1
GGSCI (rhel101.oracle.com) 1> view params eora_1
|
1.7.2 pora_1
GGSCI (rhel101.oracle.com) 7> view params pora_1
|
1.7.3 rora_1
GGSCI (rhel102.oracle.com) 3> view params rora_1
|
1.8 Limitation and Process
1.8.1 Column Width differs in different encoding
In zhs16gbk encoding, two bytes represents one chinese character. However, in AL32UTF8 encoding three bytes represents one chinese character. Therefore, if we INSERT 10 chinese characters in source system (zhs16gbk), which actually occupies 20 bytes, it will become 30 bytes in target system (AL32UTF8). If the column maximum width is 20 bytes, The INSERT operation can succeed in source system, but fail in target system.
List details about process : info replicat rora_1,showch --showch show channel
1.8.2 List details about process
Source system
GGSCI (rhel101.oracle.com) 41> info all
Program Status Group Lag Time Since Chkpt
MANAGER RUNNING EXTRACT RUNNING EORA_1 00:00:00 00:00:01 EXTRACT RUNNING PORA_1 00:00:00 00:00:05
GGSCI (rhel101.oracle.com) 43> info extract eora_1,showch
EXTRACT EORA_1 Last Started 2014-09-13 20:38 Status RUNNING Checkpoint Lag 00:00:00 (updated 00:00:07 ago) Log Read Checkpoint Oracle Redo Logs 2014-09-13 21:41:04 Seqno 21, RBA 13795840
Current Checkpoint Detail:
Read Checkpoint #1 Oracle Redo Log Startup Checkpoint (starting position in the data source): Sequence #: 21 RBA: 11470864 Timestamp: 2014-09-13 20:36:38.000000 Redo File: Recovery Checkpoint (position of oldest unprocessed transaction in the data source): Sequence #: 21 RBA: 13795344 Timestamp: 2014-09-13 21:41:04.000000 Redo File: /disk1/oradata/prod/redo02a.log Current Checkpoint (position of last record read in the data source): Sequence #: 21 RBA: 13795840 Timestamp: 2014-09-13 21:41:04.000000 Redo File: /disk1/oradata/prod/redo02a.log Write Checkpoint #1 GGS Log Trail Current Checkpoint (current write position): Sequence #: 0 RBA: 2432 Timestamp: 2014-09-13 21:41:08.203754 Extract Trail: ./dirdat/aa Header: Version = 2 Record Source = A Type = 4 # Input Checkpoints = 1 # Output Checkpoints = 1 File Information: Block Size = 2048 Max Blocks = 100 Record Length = 2048 Current Offset = 0 Configuration: Data Source = 3 Transaction Integrity = 1 Task Type = 0
Status: Start Time = 2014-09-13 20:38:06 Last Update Time = 2014-09-13 21:41:08 Stop Status = A Last Result = 400
GGSCI (rhel101.oracle.com) 44> info extract pora_1,showch
EXTRACT PORA_1 Last Started 2014-09-13 20:59 Status RUNNING Checkpoint Lag 00:00:00 (updated 00:00:06 ago) Log Read Checkpoint File ./dirdat/aa000000 2014-09-13 21:28:58.000000 RBA 2432 Current Checkpoint Detail: Read Checkpoint #1 GGS Log Trail Startup Checkpoint (starting position in the data source): Sequence #: 0 RBA: 0 Timestamp: Not Available Extract Trail: ./dirdat/aa Current Checkpoint (position of last record read in the data source): Sequence #: 0 RBA: 2432 Timestamp: 2014-09-13 21:28:58.000000 Extract Trail: ./dirdat/aa Write Checkpoint #1 GGS Log Trail Current Checkpoint (current write position): Sequence #: 0 RBA: 2469 Timestamp: 2014-09-13 21:43:01.820809 Extract Trail: ./dirdat/pa Header: Version = 2 Record Source = A Type = 1 # Input Checkpoints = 1 # Output Checkpoints = 1 File Information: Block Size = 2048 Max Blocks = 100 Record Length = 2048 Current Offset = 0 Configuration: Data Source = 0 Transaction Integrity = 1 Task Type = 0 Status: Start Time = 2014-09-13 20:59:44 Last Update Time = 2014-09-13 21:43:01 Stop Status = A Last Result = 400 |
Target System
GGSCI (rhel102.oracle.com) 12> info all
Program Status Group Lag Time Since Chkpt
MANAGER RUNNING REPLICAT RUNNING RORA_1 00:00:00 00:00:09
GGSCI (rhel102.oracle.com) 14> info replicat rora_1,showch
REPLICAT RORA_1 Last Started 2014-09-13 21:09 Status RUNNING Checkpoint Lag 00:00:00 (updated 00:00:01 ago) Log Read Checkpoint File ./dirdat/pa000000 2014-09-13 21:28:58.461077 RBA 2469 Current Checkpoint Detail: Read Checkpoint #1 GGS Log Trail Startup Checkpoint (starting position in the data source): Sequence #: 0 RBA: 0 Timestamp: Not Available Extract Trail: ./dirdat/pa Current Checkpoint (position of last record read in the data source): Sequence #: 0 RBA: 2469 Timestamp: 2014-09-13 21:28:58.461077 Extract Trail: ./dirdat/pa Header: Version = 2 Record Source = A Type = 1 # Input Checkpoints = 1 # Output Checkpoints = 0 File Information: Block Size = 2048 Max Blocks = 100 Record Length = 2048 Current Offset = 0 Configuration: Data Source = 0 Transaction Integrity = -1 Task Type = 0 Database Checkpoint: Checkpoint table = OGG.GGSCHKPT Key = 421866981 (0x19252de5) Create Time = 2014-09-13 21:07:43 Status: Start Time = 2014-09-13 21:09:51 Last Update Time = 2014-09-13 21:37:56 Stop Status = A Last Result = 400 |
呂星昊
2017年11月20日
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29475508/viewspace-2147522/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 【OGG】Oracle GoldenGate 11g (二) GoldenGate 11g 單向同步配置 上OracleGo
- 【GoldenGate】Oracle GoldenGate(二) 雙向同步配置GoOracle
- Oracle 11g GoldenGate單向複製配置(DML)OracleGo
- Oracle goldengate 11g (二)【DML and DDL單向複製】OracleGo
- 【OGG】Oracle GoldenGate 11g (一) 安裝GoldenGate 11g on LinuxOracleGoLinux
- 【GoldenGate】Oracle GoldenGate(一) 安裝與DML單向同步配置GoOracle
- Oracle GoldenGate10g→11g單向DDL部署OracleGo
- GoldenGate雙向同步配置Go
- Linux下GoldenGate單機單向同步LinuxGo
- oracle goldengate 10g--->11g配置OracleGo
- 【GoldenGate】Oracle GoldenGate(三) DDL同步配置GoOracle
- Linux下GoldenGate單機雙向同步LinuxGo
- GoldenGate單向表DML同步Go
- goldengate 單向複製配置Go
- mysql goldengate同步 簡單配置MySqlGo
- Oracle GoldenGate系統之----單向同步資料表OracleGo
- 安裝配置Oracle GoldenGate for DB2(單向)OracleGoDB2
- goldengate單向複製的配置Go
- Oracle 11g RAC到單例項OGG同步Oracle單例
- oracle goldengate 雙向複製配置OracleGo
- Oracle goldengate 11g 錯誤彙總OracleGo
- 【OGG】RAC環境下配置OGG單向同步 (四)
- oracle資料庫配置goldengate同步Oracle資料庫Go
- GoldenGate配置(二)之雙向複製配置Go
- Oracle GoldenGate系統之----單向同步資料表(續)OracleGo
- GoldenGate配置(一)之單向複製配置Go
- Oracle GoldenGate(OGG)診斷OracleGo
- goldengate 單向DDLGo
- 配置Oracle GoldenGate for DB2(雙向)OracleGoDB2
- oracle goldengate 配置OracleGo
- Oracle GoldenGate 11g官方文件Administrator’s Guide續二OracleGoGUIIDE
- 使用GoldenGate 實現Oracle for Oracle 單向資料同步(實現表的DML操作同步)GoOracle
- Oracle 高可用 goldengate 11g 錯誤彙總OracleGo
- Goldengate單表新增同步Go
- GoldenGate單向複製配置(支援DDL複製)Go
- Oracle GoldenGate系統之----雙向同步資料表OracleGo
- GoldenGate實現oracle和sqlserver雙向資料同步GoOracleSQLServer
- Oracle GoldenGate OGG管理員手冊OracleGo