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
Edit GLOBALS(upper case) parameter file to indicate checkpoint table
GGSCI (rhel102.oracle.com) 11> edit params ./GLOBALS
Add:
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:
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.
Add Replicat group:
GGSCI (rhel102.oracle.com) 5> add replicat rora_1,exttrail ./dirdat/ra
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
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;
Update data:
SCOTT@PROD>update ggtab set ename='lvh' where empno=7788;
SCOTT@PROD>commit;
Check the result in target system:
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.
GGSCI (rhel101.oracle.com) 1> view params eora_1
GGSCI (rhel101.oracle.com) 7> view params pora_1
GGSCI (rhel102.oracle.com) 3> view params rora_1
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
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
吕星昊
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/29475508/viewspace-2147522/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/29475508/viewspace-2147522/