goldengate学习笔记

goldengate是一个oracle收购的软件 目前非常的火爆 咱们也得跟上时代 是不?

首先去官网下载 http://edelivery.oracle.com/EPD/Download/get_form 下载了一个 linux X86版本

下下来是这么一个东西 V18156-01.zip 先解压一下 unzip 然后tar xvf

安装过程其实是非常的简单的 如下:

[oracle@dg01 goldengate]$ ./ggsci

Oracle GoldenGate Command Interpreter for Oracle

Version 10.4.0.19 Build 002

Linux, x86, 32bit (optimized), Oracle 10 on Sep 17 2009 23:49:42

Copyright (C) 1995, 2009, Oracle and/or its affiliates. All rights reserved.

GGSCI (dg01) 1> create subdirs

Creating subdirectories under current directory /goldengate

Parameter files /goldengate/dirprm: created

Report files /goldengate/dirrpt: created

Checkpoint files /goldengate/dirchk: created

Process status files /goldengate/dirpcs: created
goldengate学习笔记

SQL script files /goldengate/dirsql: created

Database definitions files /goldengate/dirdef: created

Extract data files /goldengate/dirdat: created

Temporary files /goldengate/dirtmp: created

Veridata files /goldengate/dirver: created

Veridata Lock files /goldengate/dirver/lock: created

Veridata Out-Of-Sync files /goldengate/dirver/oos: created

Veridata Out-Of-Sync XML files /goldengate/dirver/oosxml: created

Veridata Parameter files /goldengate/dirver/params: created

Veridata Report files /goldengate/dirver/report: created

Veridata Status files /goldengate/dirver/status: created

Veridata Trace files /goldengate/dirver/trace: created

Stdout files /goldengate/dirout: created

GGSCI (dg01) 2> help

GGSCI Command Summary

SUBDIRS CREATE SUBDIRS

ER INFO ER, KILL ER, LAG ER, SEND ER, STATUS ER,

START ER, STATS ER, STOP ER

EXTRACT ADD, ALTER, CLEANUP, DELETE, INFO, KILL,

LAG, SEND, START, STATS, STATUS, STOP

EXTTRAIL ADD, ALTER, DELETE, INFO

GGSEVT VIEW

MANAGER INFO, REFRESH, SEND, START, STOP, STATUS

MARKER INFO

PARAMS EDIT, VIEW

REPLICAT ADD, ALTER, CLEANUP, DELETE, INFO, KILL,

LAG, SEND, START, STATS, STATUS, STOP

REPORT VIEW

RMTTRAIL ADD, ALTER, DELETE, INFO

TRACETABLE ADD, DELETE, INFO

TRANDATA ADD, DELETE, INFO

Database DBLOGIN, LIST TABLES,

ENCRYPT PASSWORD

DDL DUMPDDL

CHECKPOINTTABLE ADD CHECKPOINTTABLE, DELETE CHECKPOINTTABLE,

CLEANUP CHECKPOINTTABLE, INFO CHECKPOINTTABLE

Miscellaneous FC, HELP, HISTORY, INFO ALL, INFO MARKER, OBEY,

SET, SHELL, SHOW, VERSIONS, !

For help on a specific command, type HELP <command> <object>.

Example: HELP ADD REPLICAT

GGSCI (dg01) 3>

我这里就直接使用oracle用户了 当然你可以单独建一个os用户 用来安装goldegate

不过在数据库中 你还得建立相应的账户 示例如下:

SQL> create user goldengate identified by goldengate;

User created.

SQL> grant connect,resource to goldengate;

Grant succeeded.

SQL> grant select any dictionary to goldengate;

Grant succeeded.

SQL> grant select any table to goldengate;

Grant succeeded.

SQL> grant dba to goldengate;

Grant succeeded.

SQL>

SQL>

SQL> archive log list;

Database log mode Archive Mode

Automatic archival Enabled

Archive destination /arch

Oldest online log sequence 150

Next log sequence to archive 151

Current log sequence 151

SQL> select SUPPLEMENTAL_LOG_DATA_MIN from v$database;

SUPPLEME

--------

NO

SQL> alter database add supplemental log data;

Database altered.

SQL>

至于上面的权限 其实只授予dba就够了。。。。

补充:安装和建立goldengate账户 在原库和目标库中操作完全一样

######### 配置

原库:

GGSCI (dg01) 5> edit params mgr

port 7809

dynamicportlist 7800-8000

autorestart extract *,waitminutes 2,resetminutes 5

GGSCI (dg01) 6> start mgr

Manager started.

GGSCI (dg01) 7> info all

Program Status Group Lag Time Since Chkpt

MANAGER RUNNING

-----目标库操作完全一样 edit params mgr

原库操作:

GGSCI (dg01) 8> dblogin userid goldengate,PASSWORD goldengate

ERROR: Failed to open data source for user GOLDENGATE.

GGSCI (dg01) 9>

------登陆错误通常是由于listener.ora tnsnames.ora造成 注意IP等等。

GGSCI (dg01) 15> view params testdb1 ----配置抽取进程参数(其实可以直接修改 /goldengate/dirprm/testdb1.prm文件)

dynamicresolution

gettruncates

extract testdb1

userid ggs,password ggs

rmthost 192.168.1.11,mgrport 7809

rmttrail /opt/ggc/dirdat/et

table scott.*;

GGSCI (dg01) 11> dblogin USERID goldengate ---登陆原库

Successfully logged into database.

GGSCI (dg01) 12> add extract testdb1,tranlog,begin now

EXTRACT added.

GGSCI (dg01) 13> add rmttrail /opt/ggc/dirdat/et,extract testdb1,megabytes 100

RMTTRAIL added.

-----如上2步骤是配置抽取进程

GGSCI (dg01) 14> info extract testdb1

EXTRACT TESTDB1 Initialized 2010-11-15 09:03 Status STOPPED

Checkpoint Lag 00:00:00 (updated 00:00:27 ago)

Log Read Checkpoint Oracle Redo Logs

2010-11-15 09:03:00 Seqno 0, RBA 0

GGSCI (dg01) 15> view params testdb2

extract TESTDB2

dynamicresolution

PASSTHRU

rmthost 192.168.1.21,mgrport 7809, compress

rmttrail /opt/ggc/dirdat/et

numfiles 3000

TABLE scott.* ;

GGSCI (dg01) 48> add extract testdb2,exttrailsource /opt/ggc/dirdat/et,begin now ------配置投递进程

EXTRACT added.

GGSCI (dg01) 49> add rmttrail /opt/ggc/dirdat/et,extract testdb2

RMTTRAIL added.

目标库配置:

GGSCI (roger) 9> dblogin userid goldengate

Successfully logged into database.

GGSCI (roger) 11> view params alexldb1

replicat alexdb1

SETENV (ORACLE_SID=devdb)

userid ggs,password ggs

handlecollisions

--allownoopupdates

ASSUMETARGETDEFS

dynamicresolution

numfiles 3000

discardfile /opt/ggc/dirdat/alex.dsc,append,megabytes 50

map scott.*,target scott.* ;

--添加CHECKPOINT TABLE

GGSCI (roger) 10>edit params ./GLOBALS

checkpointtable ggs.checkpoint

GGSCI (roger) 10>add checkpointtable ggs.checkpoint

GGSCI (roger) 10>add replicat alexdb1,exttrail /opt/ggc/dirdat/et,CHECKPOINTTABLE ggs.checkpoint ---配置接受进程,并设置checkpoint table

[oracle@roger dirprm]$

补充:不增加ASSUMETARGETDEFS 参数,会报错:

2010-11-15 10:13:21 GGS ERROR 101 Could not find definition for ROGER.TEST.

GGSCI (roger) 32> start replicat alexdb1

Sending START request to MANAGER ...

REPLICAT ALEXDB1 starting

GGSCI (roger) 33> info all

Program Status Group Lag Time Since Chkpt

MANAGER RUNNING

REPLICAT RUNNING ALEXDB1 00:00:00 00:00:00

同步测试:

在原库进行操作,如下:

GGSCI (dg01) 65> info all

Program Status Group Lag Time Since Chkpt

MANAGER RUNNING

EXTRACT RUNNING TESTDB1 00:00:00 00:00:06

EXTRACT RUNNING TESTDB2 00:00:00 00:00:04

GGSCI (dg01) 66>

SQL> delete from test where object_id <100 and object_id >50;

49 rows deleted.

SQL> commit;

Commit complete.

SQL>

SQL> delete from test where object_id >900 and object_id <950;

47 rows deleted.

SQL> commit;

Commit complete.

查看状态:

GGSCI (dg01) 66> stats testdb1

Sending STATS request to EXTRACT TESTDB1 ...

Start of Statistics at 2010-11-15 10:18:20.

Output to ./oracle/gg:

Extracting from ROGER.TEST to ROGER.TEST:

*** Total statistics since 2010-11-15 09:30:10 ***

Total inserts 0.00

Total updates 0.00

Total deletes 96.00

Total discards 0.00

Total operations 96.00

*** Daily statistics since 2010-11-15 09:30:10 ***

Total inserts 0.00

Total updates 0.00

Total deletes 96.00

Total discards 0.00

Total operations 96.00

*** Hourly statistics since 2010-11-15 10:00:00 ***

No database operations have been performed.

*** Latest statistics since 2010-11-15 09:30:10 ***

Total inserts 0.00

Total updates 0.00

Total deletes 96.00

Total discards 0.00

Total operations 96.00

End of Statistics.

GGSCI (dg01) 67> status testdb2

EXTRACT TESTDB2: RUNNING

GGSCI (dg01) 68> stats testdb2

Extracting from ROGER.TEST to ROGER.TEST:

*** Total statistics since 2010-11-15 09:30:12 ***

Total inserts 0.00

Total updates 0.00

Total deletes 96.00

Total discards 0.00

Total operations 96.00

*** Daily statistics since 2010-11-15 09:30:12 ***

Total inserts 0.00

Total updates 0.00

Total deletes 96.00

Total discards 0.00

Total operations 96.00

*** Hourly statistics since 2010-11-15 10:00:00 ***

No database operations have been performed.

*** Latest statistics since 2010-11-15 09:30:12 ***

Total inserts 0.00

Total updates 0.00

Total deletes 96.00

Total discards 0.00

Total operations 96.00

End of Statistics.

GGSCI (dg01) 69>

目标库同步情况:

GGSCI (roger) 34> stats alexdb1

Sending STATS request to REPLICAT ALEXDB1 ...

Start of Statistics at 2010-11-15 10:19:14.

Replicating from ROGER.TEST to ROGER.TEST:

*** Total statistics since 2010-11-15 10:18:55 ***

Total inserts 0.00

Total updates 0.00

Total deletes 96.00

Total discards 0.00

Total operations 96.00

Total delete collisions 96.00

*** Daily statistics since 2010-11-15 10:18:55 ***

Total inserts 0.00

Total updates 0.00

Total deletes 96.00

Total discards 0.00

Total operations 96.00

Total delete collisions 96.00

*** Hourly statistics since 2010-11-15 10:18:55 ***

Total inserts 0.00

Total updates 0.00

Total deletes 96.00

Total discards 0.00

Total operations 96.00

Total delete collisions 96.00

*** Latest statistics since 2010-11-15 10:18:55 ***

Total inserts 0.00

Total updates 0.00

Total deletes 96.00

Total discards 0.00

Total operations 96.00

Total delete collisions 96.00

End of Statistics.

  

爱华网本文地址 » http://www.aihuau.com/a/25101013/168091.html

更多阅读

中小学教师职业道德规范学习笔记

中小学教师职业道德规范学习笔记一、依法执教。学习和宣传马列主义、毛泽东思想和邓--同志建设有中国特色社会主义理论,拥护党的基本路线,全面贯彻国家教育方针,自觉遵守《教师法》等法律法规,在教育教学中同党和国家的方针政策保持一

伤寒学习笔记(下

伤寒学习笔记---14,桂枝用量问题?学习仲景药法,涉及用量问题。深入考证,固然不必,简单了解,实属必要。仅以桂枝为例,整理如下:基本资料:《现代中医药应用与研究大系》1985年版,简称《大系》。药法:凡例里说:“将其折合今之用量---,并结合笔者临床

关于闪光灯TTL的学习笔记

关于闪光灯TTL的学习笔记(转)俺注:一直对加闪光灯的拍摄比较疑惑,要知道并不是加开个闪光就一了百了的。特别是现在的专业闪灯,有好几种模式,都需要配合相机的测光使用。今天无意之间看到一篇解疑的文章,赶紧收集下来仔细学习。想学习下闪

“Doit,掌控每一天”学习笔记和使用感受

使用感受:学习经历:微信课,4节沪江职场讲座,准备报名参加易仁教主的威海线下活动。以上表明:我对Doit软件学习的决心,不仅仅是因为教主的推荐,更多的是对自我的挑战。参加“沪江网:掌控每一天活动:写感受,拿福利”是我做过的最漂亮的项目类事

声明:《goldengate学习笔记》为网友綻放的煙花分享!如侵犯到您的合法权益请联系我们删除