GoldenGate:目标端Replicat进程无法启动,状态“ABENDED”
在OGG的操作过程中,你可能会遇到如题所示的错误。
它发生的具体场景如下:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
GGSCI (ogg2 as system@andy) 21> view params repl replicat repl userid system,password oracle assumetargetdefs reperror default,discard discardfile ./dirrpt/repl.dsc,append,megabytes 50 dynamicresolution map scott.dept,target scott.dept; GGSCI (ogg2 as system@andy) 22> GGSCI (ogg2 as system@andy) 22> start repl Sending START request to MANAGER ... REPLICAT REPL starting GGSCI (ogg2 as system@andy) 23> GGSCI (ogg2 as system@andy) 23> info all Program Status Group Lag at Chkpt Time Since Chkpt MANAGER RUNNING REPLICAT ABENDED REPL 00:00:00 09:36:24 GGSCI (ogg2 as system@andy) 24> |
可以看到REPLICAT进程REPL,没有启动成功。
关于这个过程的详细日志信息如下:
日志文件:$OGG_HOME/ggserr.log
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
2016-03-27 06:12:28 INFO OGG-00987 Oracle GoldenGate Command Interpreter for Oracle: GGSCI command (oracle): start repl. 2016-03-27 06:12:28 INFO OGG-00963 Oracle GoldenGate Manager for Oracle, mgr.prm: Command received from GGSCI on host [192.168.232.150]:53044 (START REPLICAT REPL ). 2016-03-27 06:12:28 INFO OGG-00960 Oracle GoldenGate Manager for Oracle, mgr.prm: Access granted (rule #5). 2016-03-27 06:12:28 INFO OGG-00975 Oracle GoldenGate Manager for Oracle, mgr.prm: REPLICAT REPL starting. 2016-03-27 06:12:28 INFO OGG-00995 Oracle GoldenGate Delivery for Oracle, repl.prm: REPLICAT REPL starting. 2016-03-27 06:12:28 WARNING OGG-02904 Oracle GoldenGate Delivery for Oracle, repl.prm: Replication of PARTIAL XML containing NCHAR/NVARCHAR/NCLOB data may cause divergence. 2016-03-27 06:12:28 INFO OGG-03059 Oracle GoldenGate Delivery for Oracle, repl.prm: Operating system character set identified as UTF-8. 2016-03-27 06:12:28 INFO OGG-02695 Oracle GoldenGate Delivery for Oracle, repl.prm: ANSI SQL parameter syntax is used for parameter parsing. 2016-03-27 06:12:28 WARNING OGG-10173 Oracle GoldenGate Delivery for Oracle, repl.prm: (repl.prm) line 6: Parsing error, [dynamicresolution] is deprecated. 2016-03-27 06:12:29 WARNING OGG-06471 Oracle GoldenGate Delivery for Oracle, repl.prm: Unable to disable trigger firing. 2016-03-27 06:12:29 INFO OGG-01815 Oracle GoldenGate Delivery for Oracle, repl.prm: Virtual Memory Facilities for: COM anon alloc: mmap(MAP_ANON) anon free: munmap file alloc: mmap(MAP_SHARED) file free: munmap target directories: /u01/app/oracle/product/11.2.0/ogg_1/dirtmp. 2016-03-27 06:12:30 ERROR OGG-02091 Oracle GoldenGate Delivery for Oracle, repl.prm: Operation not supported because enable_goldengate_replication is not set to true. 2016-03-27 06:12:30 ERROR OGG-01668 Oracle GoldenGate Delivery for Oracle, repl.prm: PROCESS ABENDING. |
从日志中,你可以看到,失败的原因是因为需要在数据库实例中修改一个参数:enable_goldengate_replication。
进入实例(目标库实例,本例中,为:andy),修改参数:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
[oracle@ogg2 ogg_1]$ sqlplus / as sysdba SQL*Plus: Release 11.2.0.4.0 Production on Sun Mar 27 06:23:08 2016 Copyright (c) 1982, 2013, Oracle. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options SQL> show parameter enable_goldengate_replication NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ enable_goldengate_replication boolean FALSE SQL> SQL> alter system set enable_goldengate_replication=true scope=both; System altered. SQL> SQL> show parameter enable_goldengate_replication NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ enable_goldengate_replication boolean TRUE SQL> |
enable_goldengate_replication,是在Oracle DB的11.2.0.4/12.1.0.2之后才出现的新增参数。
通过设置该参数,你可以使用到OGG更多的一些功能。
如果你的环境中用于管理OGG的用户不是system,而是自建的其他用户的话,你最好执行下下面的这个存储过程(跟上面一样,在目标库实例中操作):
1 2 3 4 5 |
SQL> exec dbms_goldengate_auth.grant_admin_privilege('system','*',true); PL/SQL procedure successfully completed. SQL> |
这样以后,再回到OGG,操作:启动REPLICAT,应该就没问题了:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
[root@ogg2 ~]# su - oracle [oracle@ogg2 ~]$ cd /u01/app/oracle/product/11.2.0/ogg_1/ [oracle@ogg2 ogg_1]$ ggsci Oracle GoldenGate Command Interpreter for Oracle Version 12.2.0.1.1 OGGCORE_12.2.0.1.0_PLATFORMS_151211.1401_FBO Linux, x64, 64bit (optimized), Oracle 11g on Dec 12 2015 00:54:38 Operating system character set identified as UTF-8. Copyright (C) 1995, 2015, Oracle and/or its affiliates. All rights reserved. GGSCI (ogg2) 1> dblogin userid system,password oracle Successfully logged into database. GGSCI (ogg2 as system@andy) 2> info all Program Status Group Lag at Chkpt Time Since Chkpt MANAGER RUNNING REPLICAT ABENDED REPL 00:00:00 09:48:33 GGSCI (ogg2 as system@andy) 3> start repl Sending START request to MANAGER ... REPLICAT REPL starting GGSCI (ogg2 as system@andy) 4> info all Program Status Group Lag at Chkpt Time Since Chkpt MANAGER RUNNING REPLICAT RUNNING REPL 00:00:00 00:00:07 GGSCI (ogg2 as system@andy) 5> |
后台日志如下:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
2016-03-27 06:24:43 INFO OGG-00987 Oracle GoldenGate Command Interpreter for Oracle: GGSCI command (oracle): dblogin userid system password ***. 2016-03-27 06:24:52 INFO OGG-00987 Oracle GoldenGate Command Interpreter for Oracle: GGSCI command (oracle): info all. 2016-03-27 06:25:02 INFO OGG-00987 Oracle GoldenGate Command Interpreter for Oracle: GGSCI command (oracle): start repl. 2016-03-27 06:25:02 INFO OGG-00963 Oracle GoldenGate Manager for Oracle, mgr.prm: Command received from GGSCI on host [192.168.232.150]:53058 (START REPLICAT REPL ). 2016-03-27 06:25:02 INFO OGG-00960 Oracle GoldenGate Manager for Oracle, mgr.prm: Access granted (rule #5). 2016-03-27 06:25:02 INFO OGG-00975 Oracle GoldenGate Manager for Oracle, mgr.prm: REPLICAT REPL starting. 2016-03-27 06:25:02 INFO OGG-00995 Oracle GoldenGate Delivery for Oracle, repl.prm: REPLICAT REPL starting. 2016-03-27 06:25:02 WARNING OGG-02904 Oracle GoldenGate Delivery for Oracle, repl.prm: Replication of PARTIAL XML containing NCHAR/NVARCHAR/NCLOB data may cause divergence. 2016-03-27 06:25:02 INFO OGG-03059 Oracle GoldenGate Delivery for Oracle, repl.prm: Operating system character set identified as UTF-8. 2016-03-27 06:25:02 INFO OGG-02695 Oracle GoldenGate Delivery for Oracle, repl.prm: ANSI SQL parameter syntax is used for parameter parsing. 2016-03-27 06:25:02 WARNING OGG-10173 Oracle GoldenGate Delivery for Oracle, repl.prm: (repl.prm) line 6: Parsing error, [dynamicresolution] is deprecated. 2016-03-27 06:25:03 INFO OGG-06451 Oracle GoldenGate Delivery for Oracle, repl.prm: Triggers will be suppressed by default. 2016-03-27 06:25:03 INFO OGG-01815 Oracle GoldenGate Delivery for Oracle, repl.prm: Virtual Memory Facilities for: COM anon alloc: mmap(MAP_ANON) anon free: munmap file alloc: mmap(MAP_SHARED) file free: munmap target directories: /u01/app/oracle/product/11.2.0/ogg_1/dirtmp. 2016-03-27 06:25:03 INFO OGG-00996 Oracle GoldenGate Delivery for Oracle, repl.prm: REPLICAT REPL started. 2016-03-27 06:25:10 INFO OGG-00987 Oracle GoldenGate Command Interpreter for Oracle: GGSCI command (oracle): info all. |
这样,这个问题就得到解决了。
最后,还要说明的是,如果REPLICAT起不来(ABENDED),并且ggserr.log中出现了下面的error code,很可能也是因为上面的原因(1,参数没有设置;2,没有分配权限)导致的:
ERROR OGG-01820 Could not enable workspace.
ERROR OGG-01668 PROCESS ABENDING.
——————————————————————————
Done。