标签:password 启动 last 查找 情况 表拆分 size lte ted
36个数据库的12张表目标端入库进程拆分
由于目标端OGG入库进程同步的表较多,数据量较大,导致入库进程出现延时。在主机CPU和内存足够的情况下,可以对出现延时的进程进行拆分,将一个进程中的多个表分给其他进程来同步,或者几个进程同步一张数据量大的表也是可以的。
拆分进程的流程说明:
1)查找拆分表所在的进程
2)停拆分的表所在的进程
3)获取拆分表所在进程的seqno和rba号
4)排表(MAPEXCLUDE)
5)添加拆分后的进程
6)指定拆分后的进程读取队列文件的seqno和rba号
7)编辑拆分的新进程
8)启动进程
注意:请先看明白以上流程后,再执行以下操作!
1、确定需要拆分进程的表(本示例共拆分12张表)
HX_SB.SB_DKDJ_SKBG 该表拆分3个进程
HX_SB.SB_SBB 该表拆分6个进程
HX_SB.SB_ZZS_FB_ZZSJMSSBMXB_MSXM 该表拆分3个进程
HX_SB.SB_ZZS_XGM 该表拆分6个进程
HX_SB.SB_ZZS_XGM_FB_FLZL 该表拆分3个进程
HX_SB.SB_ZZS_YBNSR 该表拆分3个进程
HX_SB.SB_ZZS_YBNSR_FB_JXSEJGMXB 该表拆分6个进程
HX_SB.SB_ZZS_YBNSR_FB_YGZSFFXCSM 该表拆分3个进程
HX_SB.SB_ZZS_YBNSR_FB_YNSEAYSKM 该表拆分3个进程
HX_SB.SB_ZZS_YBNSR_FB1_BQXSQKMX 该表拆分6个进程
HX_SB.SB_ZZS_YBNSR_FB2_BQJXSEMX 该表拆分6个进程
HX_SB.SB_ZZS_YBNSR_FB5_BDCFQDKB 该表拆分3个进程
2、以上12张表所在的进程就是需要被拆分的进程。找出需要拆分的12张表所在的进程:
示例:
view param RZG_FF2B --HX_SB.SB_SBB
view param RZG_FF2H --HX_SB.SB_ZZS_YBNSR_FB1_BQXSQKMX
view param RZG_FF2I --HX_SB.SB_ZZS_YBNSR_FB2_BQJXSEMX
view param RZG_FF2J --HX_SB.SB_ZZS_YBNSR HX_SB.SB_ZZS_XGM
view param RZG_FF2N --HX_SB.SB_ZZS_XGM_FB_FLZL
view param RZG_FF2A --包含了剩余的6张表
3、停需要拆分(排表)的入库进程
stop RZG_FF2B
stop RZG_FF2H
stop RZG_FF2I
stop RZG_FF2J
stop RZG_FF2N
stop RZG_FF2A
4、取当前seqno和rba号,如xx单位如下
示例:
GGSCI (nmsthxffdb01) 3> info RZG_FF2B
REPLICAT RZG_FF2B Last Started 2017-01-14 19:07 Status RUNNING
Checkpoint Lag 01:23:38 (updated 02:20:38 ago)
Log Read Checkpoint File ./dirdat/zb002751
2017-01-14 17:22:34.052064 RBA 347329296
info RZG_FF2B -- zb002751 RBA 347329296
info RZG_FF2H -- zb002751 RBA 347335602
info RZG_FF2I -- zb002751 RBA 347335602
info RZG_FF2J -- zb002751 RBA 347335602
info RZG_FF2N -- zb002751 RBA 347378402
info RZG_FF2A -- zb002751 RBA 347521117
5、对原进程进行排表(编辑进程,添加排除表的语句,如果进程中只有1张表,无需排除)
示例(添加下面MAPEXCLUDE 排表语句,加到最后一个参数下面,然后保存退出):
eidt param RZG_FF2A
MAPEXCLUDE HX_SB.SB_DKDJ_SKBG;
MAPEXCLUDE HX_SB.SB_ZZS_YBNSR_FB_JXSEJGMXB;
MAPEXCLUDE HX_SB.SB_ZZS_YBNSR_FB_YGZSFFXCSM;
MAPEXCLUDE HX_SB.SB_ZZS_YBNSR_FB_YNSEAYSKM;
MAPEXCLUDE HX_SB.SB_ZZS_FB_ZZSJMSSBMXB_MSXM;
MAPEXCLUDE HX_SB.SB_ZZS_YBNSR_FB5_BDCFQDKB;
6、添加拆分后的进程,根据上面查到的数据量大小拆分一个进程为多个进程(3或者6个进程),新进程命名格式:RSB_P** , 其中"*"表示数字,且从01开始递增
示例:
拆分三个进程如下:
add replicat RSB_P01, exttrail ./dirdat/zb
add replicat RSB_P02, exttrail ./dirdat/zb
add replicat RSB_P03, exttrail ./dirdat/zb
拆分六个进程如下:
add replicat RSB_P04, exttrail ./dirdat/zb
add replicat RSB_P05, exttrail ./dirdat/zb
add replicat RSB_P06, exttrail ./dirdat/zb
add replicat RSB_P07, exttrail ./dirdat/zb
add replicat RSB_P08, exttrail ./dirdat/zb
add replicat RSB_P09, exttrail ./dirdat/zb
7、指定拆分新进程的seqno和rba,上面“info 进程名” (注意进程名对应关系)
拆分三个进程如下:
alter replicat RSB_P01, extseqno 002751 ,extrba 347521117
alter replicat RSB_P02, extseqno 002751 ,extrba 347521117
alter replicat RSB_P03, extseqno 002751 ,extrba 347521117
拆分六个进程如下:
alter replicat RSB_P04, extseqno 002751 ,extrba 347329296
alter replicat RSB_P05, extseqno 002751 ,extrba 347329296
alter replicat RSB_P06, extseqno 002751 ,extrba 347329296
alter replicat RSB_P07, extseqno 002751 ,extrba 347329296
alter replicat RSB_P08, extseqno 002751 ,extrba 347329296
alter replicat RSB_P09, extseqno 002751 ,extrba 347329296
8、编辑拆分的新进程
注意:
1)replicat rsb_p01
2)DISCARDFILE ./dirrpt/rsb_p01.dsc,APPEND,MEGABYTES 100
3)拆分的表名
示例:
edit param RSB_P01
replicat rsb_p01
SETENV (ORACLE_SID="nmsthxff")
SETENV (NLS_LANG=AMERICAN_AMERICA.AL32UTF8)
Userid ggs,PASSWORD AACAAAAAAAAAAAIAUCOJGDDFPFHEGCPD, BLOWFISH, ENCRYPTKEY DEFAULT
REPORT AT 01:59
REPORTROLLOVER AT 02:00
CACHEMGR, CACHESIZE 256MB
REPERROR DEFAULT,ABEND
DISCARDFILE ./dirrpt/rsb_p01.dsc,APPEND,MEGABYTES 100
DISCARDROLLOVER AT 06:00
GETTRUNCATES
NUMFILES 3000
EOFDELAYCSECS 30
ASSUMETARGETDEFS
ALLOWNOOPUPDATES
DYNAMICRESOLUTION
GETUPDATEBEFORES
NOCOMPRESSDELETES
MAP HX_SB.SB_DKDJ_SKBG, TARGET HX_SB.SB_DKDJ_SKBG, colmap (usedefaults , &
sjtb_sj = @date ("yyyy-mm-dd hh:mi:ss.ffffff", "JTS", @GETENV("JULIANTIMESTAMP"))),FILTER(@RANGE(1,4)); --这里的1是 一张表拆分的第一个进程,4是该表一共拆分成4个进程
9、启动进程(注:必须先启动新拆分的进程,且等新进程没有延时,再启动原进程)
示例:
--拆分的新进程
start RSB_P01
start RSB_P02
start RSB_P03
--原进程
start RZG_FF2A
--拆分的新进程
start RSB_P04
start RSB_P05
start RSB_P06
start RSB_P07
start RSB_P08
start RSB_P09
--原进程
start RZG_FF2B
--OK啦!!
OGG进程拆分
标签:password 启动 last 查找 情况 表拆分 size lte ted
原文地址:http://www.cnblogs.com/wounder/p/7563414.html