在GoldenGate中主进程是manager进程,使用start mgr启动。可以在mgr进程中添加一些参数用来在启动mgr进程的同时启动extract和replicat进程
- GGSCI (gg01) 130> VIEW params mgr
- --mgr主进程端口号
- PORT 7809
- --动态端口,当指定端口不可用时,会从以下列表中选择一个可用端口
- DYNAMICPORTLIST 7800-7909
- --启动mgr进程启动启动extract进程
- AUTOSTART EXTRACT *
- --当extract进程异常终止时会自动启动,每5分钟尝试重新启动所有的extract进程,一共尝试3次,5分钟清零
- AUTORESTART EXTRACT *,RETRIES 3, WAITMINUTES 5, RESETMINUTES 10
启动源端mgr进程测试extract进程是否自动启动
- GGSCI (gg01) 135> info ALL
- Program STATUS GROUP Lag TIME Since Chkpt
- MANAGER STOPPED
- EXTRACT STOPPED EORAJJ 00:00:00 00:13:27
- GGSCI (gg01) 136> START mgr
- Manager started.
- GGSCI (gg01) 137> info ALL
- Program STATUS GROUP Lag TIME Since Chkpt
- MANAGER RUNNING
- EXTRACT RUNNING EORAJJ 00:00:00 00:13:31
配置目标端replicat进程自启动,在mgr参数中添加如下
- GGSCI (gg02) 140> VIEW params mgr
- --mgr主进程端口号
- PORT 7809
- --动态端口,当指定端口不可用时,会从以下列表中选择一个可用端口
- DYNAMICPORTLIST 7800-7909
- --自动启动replicat进程
- AUTOSTART REPLICAT *
- --当replicat进程异常终止时会自动启动,每5分钟尝试重新启动所有的replicat进程,一共尝试5次
- AUTORESTART REPLICAT *, WAITMINUTES 2, RETRIES 5
- --mgr进程每隔1小时检查extract延时情况,超过5分钟作为信息记录log中,超过7分钟作为警告记录log中
- LAGREPORTHOURS 1
- LAGINFOMINUTES 5
- LAGCRITICALMINUTES 7
- --删除10天前的trail文件
- PURGEOLDEXTRACTS /u01/app/oracle/goldengate/dirdat/*, USECHECKPOINTS, MINKEEPDAYS 10
- GGSCI (gg02) 141>
启动目标端mgr进程测试replicat进程是否自动启动
-
- GGSCI (gg02) 135> info ALL
- Program STATUS GROUP Lag TIME Since Chkpt
- MANAGER STOPPED
- REPLICAT STOPPED RORAJJ 00:00:00 00:08:55
- GGSCI (gg02) 136> START mgr
- Manager started.
- GGSCI (gg02) 137> info ALL
- Program STATUS GROUP Lag TIME Since Chkpt
- MANAGER RUNNING
- REPLICAT RUNNING RORAJJ 00:00:00 00:00:02