Menu

15 Ocak 2013 Salı

Golden Gate DML senkorinasyonu (active-standby)

Bu makalemizde, Golden gate ile kaynak veritabanindan, hedef veritabanina, kaynak veritabaninda yapilan bir DML(insert, update, delete) isleminin hedef veritabanina nasil etkilendigini gorecegiz.

Oncelikle Her iki veritabanida archivelog mode olmalidir
##################### Her iki tarfdada ##############################
[oracle@db1 gg]$ ggsci

    GGSCI (db1) 1> dblogin userid ggs_admin, password ggs_admin

    Successfully logged into database.
    GGSCI (db1) 2> add trandata SCOTT.*

################## Her iki makinedede ####################
      ggsci > edit param mgr
port 7980
purgeoldextracts dirdat/*, usecheckpoints, minkeepdays 2

    ggsci > start manager

    Manager started.

    ggsci > info manager

    Manager is running (IP port canada.7980).

############### Kaynak Makinede #######################################

    ggsci> edit param ext1
      extract ext1
      userid ggs_admin, password ggs_admin
      exttrail /u01/app/gg/dirdat/t1
      table SCOTT.*;
     
    GGSCI (db1) 8> add extract ext1, tranlog, begin now
    EXTRACT added.

    GGSCI (db1) 9> add exttrail /u01/app/gg/dirdat/t1, extract ext1, megabytes 100

    EXTTRAIL added.
   
    GGSCI (db1) 10> start extract ext1
    Sending START request to MANAGER ...
    EXTRACT EXT1 starting

    GGSCI (db1) 13> info extract ext1

    EXTRACT    EXT1      Last Started 2013-01-12 20:47   Status RUNNING
    Checkpoint Lag       00:00:00 (updated 00:00:03 ago)
    Log Read Checkpoint  Oracle Redo Logs
2013-01-12 20:48:15  Seqno 5, RBA 6204416

    ggsci > stop extract ext1


############# Kaynak makinede ############3


GGSCI> edit param dpump1


    extract dpump1

    passthru
    rmthost db2, mgrport 7980
    rmttrail dirdat/t2
    table SCOTT.*;

    GGSCI (db1) 15> add extract dpump1, exttrailsource /u01/app/gg/dirdat/t1

    EXTRACT added.

    GGSCI (db1) 16> add rmttrail dirdat/t2, extract dpump1, megabytes 100

    RMTTRAIL added.

    GGSCI (db1) 17> start extract dpump1
    Sending START request to MANAGER ...
    EXTRACT DPUMP1 starting

##### To stop datapump.

    GGSCI> stop extract dpump1

    GGSCI (db1) 18> info extract dpump1

      EXTRACT    DPUMP1    Last Started 2013-01-12 20:58   Status RUNNING
      Checkpoint Lag       00:00:00 (updated 00:00:04 ago)
      Log Read Checkpoint  File /u01/app/gg/dirdat/t1000000
 First Record  RBA 943

    GGSCI (db1) 19> info all


      Program     Status      Group       Lag           Time Since Chkpt

      MANAGER     RUNNING                                          
      EXTRACT     RUNNING     DPUMP1      00:00:00      00:00:00  
      EXTRACT     RUNNING     EXT1        00:00:00      00:00:02
     
############## Hedef makinede ##########################

[oracle@london gg]$ ggsci


#### -create checkpoint table ####


    GGSCI (db2) 3> dblogin userid ggs_admin, password ggs_admin

    Successfully logged into database.

    GGSCI (db2) 4> add checkpointtable ggs_admin.chkpt

    Successfully created checkpoint table GGS_ADMIN.CHKPT.

    GGSCI (db2) 1> edit param repl1

      replicat repl1
      userid ggs_admin, password ggs_admin
      handlecollisions
      assumetargetdefs
      discardfile dirrpt/repl1.dsc, append
      discardrollover at 5:00 on sunday
      map SCOTT.*, target SCOTT.*;

    GGSCI (db2) 5> add replicat repl1, exttrail dirdat/t2, checkpointtable ggs_admin.chkpt

    REPLICAT added.

    GGSCI (db2) 6> start replicat repl1

    Sending START request to MANAGER ...
    REPLICAT REPL1 starting

## To stop replicat service. ###


    GGSCI> stop replicat repl1


    GGSCI (db2) 7> info replicat repl1

      REPLICAT   REPL1     Last Started 2013-01-12 21:28   Status RUNNING
      Checkpoint Lag       00:00:00 (updated 00:00:09 ago)
      Log Read Checkpoint  File dirdat/t2000000
 First Record  RBA 0

    GGSCI (db2) 8> info all


      Program     Status      Group       Lag           Time Since Chkpt

      MANAGER     RUNNING                                          
      REPLICAT    RUNNING     REPL1       00:00:00      00:00:03
     
###################### Kontrol edelim ##############################

###################### Kaynak Makinde ###########################

    SQL> conn scott/tiger;

    SQL> update emp set sal=17000 where ename='MILLER';

    1 row updated.

    SQL> commit;

    Commit complete.

###################### Hedef Makinede ###########################


    SQL> conn scott/tiger;


    SQL> select sal from emp where ename='MILLER';


 SAL

    ----------
17000

SQL> exit


[oracle@db2 gg]$ ggsci


GGSCI (db2) 1> stats replicat repl1


Sending STATS request to REPLICAT REPL1 ...


Start of Statistics at 2013-01-12 21:35:11.


Replicating from SCOTT.EMP to SCOTT.EMP:


*** Total statistics since 2013-01-12 21:31:54 ***

        Total inserts                                0.00
        Total updates                                1.00
        Total deletes                                0.00
        Total discards                               0.00
        Total operations                             1.00

*** Daily statistics since 2013-01-12 21:31:54 ***

        Total inserts                                0.00
        Total updates                                1.00
        Total deletes                                0.00
        Total discards                               0.00
        Total operations                             1.00

*** Hourly statistics since 2013-01-12 21:31:54 ***

        Total inserts                                0.00
        Total updates                                1.00
        Total deletes                                0.00
        Total discards                               0.00
        Total operations                             1.00

*** Latest statistics since 2013-01-12 21:31:54 ***

        Total inserts                                0.00
        Total updates                                1.00
        Total deletes                                0.00
        Total discards                               0.00
        Total operations                             1.00

End of Statistics.

2 yorum:

  1. Friday means the end of the work week, a two-day weekend to
    check forward to when I can hang throughout
    the hosue during my jammies half the afternoon if I desire to my website if
    you notice a screw or nail a single of your tires, remedy it
    immediately.

    YanıtlaSil