1. oracle database 기본 goldengate db user 생성 (source, target)

     SQL> create user oggmgr identified by oracle default tablespace users;
     SQL> grant dba to oggmgr;  -- role_setup script 는 ? 
     
2. oracle database supplemental log & archive log 설정 (source)
     SQL> alter database add supplemental log data; 
     SQL> select supplemental_log_data_min from v$database;
     SQL> shutdown immediate;
     SQL> startup mount
     SQL> alter database archivelog;
     SQL> alter database open;
     SQL> alter system switch logfile;
     SQL> archive log list;
     SQL> show parameter log_archive_dest_1

3. database test user 생성 (source, target)
     SQL> create user app identified by app default tablespace users;
     SQL> grant connect, resource to app;

4. goldengate 설치 (source, target)
     # ggsci
     GGSCI> create subdirs
     GGSCI> edit params ./GLOBALS

     GGSCHEMA OGGMGR
     CHECKPOINTTABLE OGGMGR.GGSCHKPT
     SYSLOG NONE

     GGSCI> edit param mgr

     port 9010 -- target은 9020

     GGSCI> start mgr
     GGSCI> info mgr
     GGSCI> info all

5. 테스트 테이블 생성 (source, target)
     # sqlplus app/app @demo_ora_create

6. 테스트 테이블에 대한 suplemental logging 설정 (source)
     # ggsci
     GGSCI> dblogin userid oggmgr, password oracle
     GGSCI> info trandata app.*
     GGSCI> add trandata app.tcustmer
     GGSCI> add trandata app.tcustord
     GGSCI> info trandata app.*

7. checkpoint table 생성 (target)
     #ggsci
     GGSCI> dblogin userid oggmgr, password oracle
     GGSCI> add checkpointtable

8. extract configuration & start (source)
     GGSCI> edit param ext01
     
     extract ext01
     userid oggmgr, password oracle
     discardfile ./dirout/ext01.dec, append, megabytes 50
     discardrollover at 00:01
     reportcount every 1 records
     reportrollover at 00:01

     exttrail ./dirdat/ex
     table app.*;

     GGSCI> dblogin userid oggmgr, password oracle
     GGSCI> add extract ext01, tranlog, begin now
     GGSCI> add exttrail ./dirdat/ext, extract ext01, megabytes 50
     GGSCI> info ext01
     GGSCI> start ext01

9. pump configuration & start (source)
     # ggsci
     GGSCI> edit param pmp01

     extract pmp01
     passthru
     rmthost oggtest.localdomain, mgrport 9020
     rmttrail ./dirdat/ex
     reportcount every 1 records
     reportrollover at 00:01
     table app.*;

     GGSCI> add extract pmp01, exttrailsource ./dirdat/ex
     GGSCI> add exttrail ./dirdat/ex, extract pmp01, megabytes 50
     GGSCI> start pmp01
     GGSCI> info pmp01

10. replicat configuration & start (target)
     #ggsci
     GGSCI> edit param rep01

     replicat rep01
     userid oggmgr, password oracle
     discardfile ./dirout/rep01.dec, append, megabytes 50
     discardrollover at 00:01
     reportcount every 1 records
     reportrollover at 00:01
     assumetargetdefs
     map app.tcustmer, target app.tcustmer;
     map app.tcustord, target app.tcustord;

     GGSCI> add replicat rep01, exttrail ./dirdat/ex
     GGSCI> start rep01
     GGSCI> info rep01

11. 테스트 (source)
     # sqlplus app/app @demo_ora_insert

12. goldengate stop (source, target)
     #ggsci
     GGSCI> stop *
     GGSCI> stop mgr


'Oracle Middleware' 카테고리의 다른 글

Oracle Goldengate의 initial data load  (0) 2013.12.10

+ Recent posts