goldengate(15)---Managing long-running transactions
goldengate 管理oracle中的长事务
使用的参数为WARNLONGTRANS
该参数使用方法:
WARNLONGTRANS
Default One hour (and check every five minutes using a separate processing thread)
Syntax WARNLONGTRANS
[, CHECKINTERVAL ]
[, NOUSETHREADS]
[, USELASTREADTIME]
示例:extract 抽取进程添加下面配置
WARNLONGTRANS 30s, CHECKINTERVAL 5s
当发现超过30秒长事务的时候,goldengate 每5秒检查一次(我这里是测试,所以时间比较短)
extract 抽取进程配置:
EXTRACT s_ex_hr
--SETENV (NLS_LANG = "CHINESE_CHINA.ZHS16GBK")
SETENV (ORACLE_HOME = "/u01/app/oracle/product/11.2.0/dbhome_1")
SETENV (ORACLE_SID = "dbking")
DBOPTIONS ALLOWUNUSEDCOLUMN
USERID ggs, PASSWORD ggs
TRANLOGOPTIONS ASMUSER sys@asm, ASMPASSWORD grid
EXTTRAIL /u01/app/oracle/ggs/dirdat/trail/hr/tt
--TABLEEXCLUDE test.MV_123, test.mlog$_xy101
SEQUENCE gis_test.*;
GETTRUNCATES
WARNLONGTRANS 30s, CHECKINTERVAL 5s
DDL INCLUDE MAPPED OBJNAME "gis_test.*"
TABLE gis_test.*;
表GIS_TEST.T3插入1百万条记录(不提交):
begin
for i in 101..1000000 loop
insert into gis_test.t3(tranid) values (i);
end loop;
--commit;
end;
/
观察该条事务:
GGSCI (dbhouse) 70> send extract s_ex_hr showtrans
Sending SHOWTRANS request to EXTRACT S_EX_HR ...
Oldest redo log file necessary to restart Extract is:
Redo Log Sequence Number 202, RBA 9254928
------------------------------------------------------------
XID: 5.19.1005
Items: 66252
Extract: S_EX_HR
Redo Thread: 1
Start Time: 2013-03-19:04:01:58
SCN: 0.7537430 (7537430)
Redo Seq: 202
Redo RBA: 9254928
Status: Running
再运行一遍:
GGSCI (dbhouse) 71> send extract s_ex_hr showtrans
Sending SHOWTRANS request to EXTRACT S_EX_HR ...
Oldest redo log file necessary to restart Extract is:
Redo Log Sequence Number 202, RBA 9254928
------------------------------------------------------------
XID: 5.19.1005
Items: 140255
Extract: S_EX_HR
Redo Thread: 1
Start Time: 2013-03-19:04:01:58
SCN: 0.7537430 (7537430)
Redo Seq: 202
Redo RBA: 9254928
Status: Running
记录数从66252 增加到 140255 , 后续一直要到1000000条记录数
查看日志:
2013-03-19 04:03:57 WARNING OGG-01027 Long Running Transaction: XID 5.19.1005, Items 513892, Extract S_EX_HR, Redo Thread 1, SCN 0.7537430 (7537430
), Redo Seq #202, Redo RBA 9254928.
2013-03-19 04:04:03 WARNING OGG-01027 Long Running Transaction: XID 5.19.1005, Items 515886, Extract S_EX_HR, Redo Thread 1, SCN 0.7537430 (7537430
), Redo Seq #202, Redo RBA 9254928.
2013-03-19 04:04:08 WARNING OGG-01027 Long Running Transaction: XID 5.19.1005, Items 526102, Extract S_EX_HR, Redo Thread 1, SCN 0.7537430 (7537430
), Redo Seq #202, Redo RBA 9254928.
因为该事务超过了参数指定的时间,30秒,故而goldengate每5秒记录一次长事务,事务ID:5.19.1005
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/21266384/viewspace-756753/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/21266384/viewspace-756753/