Install Oracle GoldenGate in 1 instance database [3]

30 Mar

III. Demo Replication
1. manager harus start
[oracle@orcl10 ~]$ export GGATE=/u01/app/oracle/product/gg
[oracle@orcl10 ~]$ cd $GGATE
[oracle@orcl10 gg]$ ./ggsci
Oracle GoldenGate Command Interpreter for Oracle
Version 10.4.0.19 Build 002
Linux, x64, 64bit (optimized), Oracle 10 on Sep 22 2009 14:18:08
Copyright (C) 1995, 2009, Oracle and/or its affiliates. All rights reserved.

GGSCI (orcl10) 1> info all
Program Status Group Lag Time Since Chkpt
MANAGER STOPPED

GGSCI (orcl10) 2> info manager
Manager is DOWN!

GGSCI (orcl10) 3> start manager
Manager started.

GGSCI (orcl10) 4> info all
Program Status Group Lag Time Since Chkpt
MANAGER RUNNING

2. Create scipt source
GGSCI (orcl10) 5> add extract ext1, tranlog, begin now
EXTRACT added.

GGSCI (orcl10) 6> add exttrail /u01/app/oracle/product/gg/dirdat/lt, extract ext1
EXTTRAIL added.

GGSCI (orcl10) 7> edit params ext1
–extract group–
EXTRACT ext1
–connection to database–
USERID ggate, PASSWORD 123456
–hostname and port for trail–
RMTHOST orcl10, MGRPORT 7809
–path and name for trail–
rmttrail /u01/app/oracle/product/gg/dirdat/lt
–DDL support
ddl include mapped objname sumber.*
–DML
TABLE sumber.*;

GGSCI (orcl10) 6> info all
Program Status Group Lag Time Since Chkpt
MANAGER RUNNING
EXTRACT STOPPED EXT1 00:00:00 00:02:48

GGSCI (orcl10) 7> start EXTRACT EXT1

GGSCI (orcl10) 8> info all
Program Status Group Lag Time Since Chkpt
MANAGER RUNNING
EXTRACT RUNNING EXT1 00:00:00 00:03:03

3. Create scipt untuk target
GGSCI (orcl10) 1> dblogin userid ggate
Password:
Successfully logged into database.

GGSCI (orcl10) 2> add checkpointtable ggate.checkpoint
Successfully created checkpoint table GGATE.CHECKPOINT.

GGSCI (orcl10) 3> edit params ./GLOBALS
GGSCHEMA tujuan
CHECKPOINTTABLE ggate.checkpoint

GGSCI (orcl3) 4> add replicat rep1, exttrail /u01/app/oracle/product/gg/dirdat/lt,checkpointtable ggate.checkpoint
REPLICAT added.

GGSCI (orcl3) 5> edit params rep1
–Replicat group —
replicat rep1
–source and target definitions
ASSUMETARGETDEFS
–target database login —
userid ggate, password 123456
–ddl support
DDL
–file for dicarded transaction —
discardfile /u01/app/oracle/product/gg/discard/rep1_discard.txt, append, megabytes 10
map sumber.*, target tujuan.*;

GGSCI (orcl10) 6> start REPLICAT REP1
Sending START request to MANAGER …
REPLICAT REP1 starting

GGSCI (orcl10) 7> info all
Program Status Group Lag Time Since Chkpt
MANAGER RUNNING
EXTRACT RUNNING EXT1 00:00:00 00:00:03
REPLICAT RUNNING REP1 00:00:00 00:00:03

4. testttttttttt
a. source : create table, insert 2 record
target : ter-replikasi
###################################
### Source:
###################################
[oracle@orcl10 gg]$ sqlplus source/123456@orcl10
SQL> CREATE TABLE DEPT
( DEPTNO NUMBER(2),
DNAME VARCHAR2(14),
LOC VARCHAR2(13)
);

SQL> CREATE UNIQUE INDEX PK_DEPT ON DEPT(DEPTNO) LOGGING;
SQL> ALTER TABLE DEPT ADD (CONSTRAINT PK_DEPT PRIMARY KEY (DEPTNO));
SQL> insert into dept values (51,’IT’,’SBY’);
SQL> insert into dept values (52,’AU’,’SBY’);
SQL> commit;
SQL> select * from dept order by deptno;
DEPTNO DNAME LOC
———- ————– ————-
51 IT SBY
52 AU SBY

###################################
### Target:
###################################
SQL> conn tujuan/123456@orcl10
SQL> select * from dept order by deptno;
DEPTNO DNAME LOC
———- ————– ————-
51 IT SBY
52 AU SBY

DEPTNO DNAME LOC
———- ————– ————-
51 IT SBY
52 AU SBY

b. source : insert 2 record lagi
target : ter-replikasi
###################################
### Source:
###################################
SQL> insert into dept values (53,’MKT’,’JKT’);
SQL> insert into dept values (54,’ACC’,’JKT’);
SQL> commit;
SQL> select * from dept order by deptno;
DEPTNO DNAME LOC
———- ————– ————-
51 IT SBY
52 AU SBY
53 MKT JKT
54 ACC JKT

###################################
### Target:
###################################
SQL> select * from dept order by deptno;
DEPTNO DNAME LOC
———- ————– ————-
51 IT SBY
52 AU SBY
53 MKT JKT
54 ACC JKT

c. source : delete record
target : ter-replikasi
###################################
### Source:
###################################
SQL> delete dept where deptno > 52;
SQL> commit;
SQL> select * from dept order by deptno;
DEPTNO DNAME LOC
———- ————– ————-
51 IT SBY
52 AU SBY
###################################
### Target :
###################################
SQL> select * from dept order by deptno;
DEPTNO DNAME LOC
———- ————– ————-
51 IT SBY
52 AU SBY

1. install oracle goldengate in 1 instance database-1

2. install oracle goldengate in 1 instance database-2

3. install oracle goldengate in 1 instance database-3

6 Responses to “Install Oracle GoldenGate in 1 instance database [3]”

  1. setijo agus April 7, 2010 at 7:46 am #

    contoh diatas tidak untuk ‘update’ dan ‘bi-directonal’

    kalau ada waktu nanti saya demokan
    untuk kasus – kasus ‘update’ dan ‘bi-directonal’

  2. Jack Nickolson May 4, 2010 at 8:38 pm #

    Good article for Oracle GoldenGate installation explaination.

    • setijoagus May 7, 2010 at 4:04 am #

      thank’s Jack Nickolson

  3. siva prakash May 7, 2010 at 12:02 am #

    very good article , i trie dto setup in similar lines
    but for some reason

    these two process are not starting

    EXTRACT RUNNING EXT1 00:00:00 00:00:03
    REPLICAT RUNNING REP1 00:00:00 00:00:03

    appreciate ur help regarding this .

    i am using 10g database

  4. siva prakash May 7, 2010 at 12:07 am #

    GGSCI (belgium.nms.fnc.fujitsu.com) 45> start extract ext1

    Sending START request to MANAGER …
    EXTRACT EXT1 starting

    GGSCI (belgium.nms.fnc.fujitsu.com) 46> info all

    Program Status Group Lag Time Since Chkpt

    MANAGER RUNNING
    EXTRACT STOPPED EXT1 00:00:00 01:09:01
    REPLICAT STOPPED REP1 00:00:00 00:17:42

  5. setijoagus May 17, 2010 at 3:52 am #

    look log file in /u01/app/oracle/product/gg/dirrpt
    [oracle@orcl4 dirrpt]$ ls
    MGR.rpt REP1.rpt

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: