转载oracle ogg--ogg搭建过程中遇到的错误及处理
oracle ogg--ogg搭建过程中遇到的错误及处理
1 PRVF-0002 : Could not retrieve local nodename
---# Begin Stacktrace #---------------------------
ID: oracle.install.commons.util.exception.DefaultErrorAdvisor:37
oracle.cluster.verification.VerificationException: PRVF-0002 : Could not retrieve local nodename
at oracle.cluster.verification.ClusterVerification.<init>(ClusterVerification.java:242)
at oracle.cluster.verification.ClusterVerification.getInstance(ClusterVerification.java:347)
at oracle.install.driver.oui.OUISetupDriver.load(OUISetupDriver.java:430)
at oracle.install.ivw.db.driver.DBSetupDriver.load(DBSetupDriver.java:207)
at oracle.install.commons.base.driver.common.Installer.run(Installer.java:299)
at oracle.install.ivw.common.util.OracleInstaller.run(OracleInstaller.java:106)
at oracle.install.ivw.db.driver.DBInstaller.run(DBInstaller.java:136)
at oracle.install.commons.util.Application.startup(Application.java:896)
at oracle.install.commons.flow.FlowApplication.startup(FlowApplication.java:165)
at oracle.install.commons.flow.FlowApplication.startup(FlowApplication.java:182)
at oracle.install.commons.base.driver.common.Installer.startup(Installer.java:348)
at oracle.install.ivw.db.driver.DBInstaller.startup(DBInstaller.java:124)
at oracle.install.ivw.db.driver.DBInstaller.main(DBInstaller.java:155)
[root@ogg ~]# vim /etc/hosts
10.15.7.26 ogg
2 Could not open checkpoint file /u01/app/ogg/dirchk/RINI_1.cpr
GGSCI (DSI) 12> START EXTRACT EINI_1
Sending START request to MANAGER ...
EXTRACT EINI_1 starting
GGSCI (DSI) 16> VIEW REPORT EINI_1
2019-06-19 14:09:12 WARNING OGG-01194 EXTRACT task RINI_1 abended : Could not open checkpoint file /u01/app/ogg/dirchk/RINI_1.cpr, mode 1 (error 2, No such file
--目标端错误日志
[root@ogg ogg]# more ggserr.log | grep ERROR
2019-06-19 14:09:15 ERROR OGG-00446 Oracle GoldenGate Delivery for Oracle, rini_1.prm: Could not open checkpoint file /u01/app/ogg/dirchk/RINI_1.cpr, mode 1 (error 2, No such file or directory).
###在目标端执行
GGSCI (ogg) 9> add replicat RINI_1,specialrun
REPLICAT added.
##在执行
GGSCI (DSI) 19> START EXTRACT EINI_1
Sending START request to MANAGER ...
EXTRACT EINI_1 starting
GGSCI (DSI) 22> VIEW REPORT EINI_1
Report at 2019-06-19 14:18:35 (activity since 2019-06-19 14:18:28)
Output to RINI_1:
From Table SCOTT.EMP_OGG:
# inserts: 14
# updates: 0
# deletes: 0
# discards: 0
REDO Log Statistics
Bytes parsed 0
Bytes output 2616
3 Invalid data source -1 in checkpoint file /u01/app/ogg/dirchk/RORA_1.cpr
GGSCI (ogg) 8> view report RORA_1
2019-06-19 15:06:07 ERROR OGG-00446 Invalid data source -1 in checkpoint file /u01/app/ogg/dirchk/RORA_1.cpr.
##源库错误日志
[root@ogg dirdat]# more ../ggserr.log | grep ERROR
2019-06-19 15:12:52 ERROR OGG-00446 Oracle GoldenGate Delivery for Oracle, rora_1.prm: Invalid data source -1 in checkpoint file /u01/app/ogg/dirchk/RORA_1.cpr.
2019-06-19 15:12:52 ERROR OGG-01668 Oracle GoldenGate Delivery for Oracle, rora_1.prm: PROCESS ABENDING.
##详细检查REPLICAT进程的配置文件
##修改目标端RORA_1
GGSCI (ogg) 33> view param RORA_1
REPLICAT RORA_1
SETENV (NLS_LANG=AMERICAN_AMERICA.AL32UTF8)
USERID ogg, PASSWORD ogg
HANDLECOLLISIONS
ASSUMETARGETDEFS
DISCARDFILE /u01/app/ogg/dirrpt/RORA_1.DSC, APPEND, MEGABYTES 1000
MAP scott.emp_ogg, TARGET scott.emp_ogg;
MAP scott.dept_ogg, TARGET scott.dept_ogg;
4 如果安装过程中报错
SYS@ orcl >@/u01/app/ogg/ddl_setup.sql
Line/pos Error
---------------------------------------- -----------------------------------------------------------------
126/9 PL/SQL: SQL Statement ignored
128/23 PL/SQL: ORA-00942: table or view does not exist
133/21 PL/SQL: ORA-02289: sequence does not exist
133/5 PL/SQL: SQL Statement ignored
657/14 PLS-00905: object OGG.DDLAUX is invalid
657/5 PL/SQL: Statement ignored
919/25 PL/SQL: ORA-00942: table or view does not exist
919/4 PL/SQL: SQL Statement ignored
###卸载ogg,并使支持DDL功能失效
---SYS@ orcl >@/u01/app/ogg/ddl_disable.sql
SYS@ orcl >@/u01/app/ogg/ddl_disable.sql
SYS@ orcl >@/u01/app/ogg/ddl_remove.sql
SYS@ orcl >@/u01/app/ogg/marker_remove.sql
--检查相应的权限,在ogg脚本下面登录/u01/app/ogg
SQL> @/u01/app/ogg/marker_setup.sql
5 No database operations have been performed./No active replication maps.
GGSCI (ogg) 7> stats rep1
*** Total statistics since 2019-06-20 15:39:42 ***
No database operations have been performed.
GGSCI (ogg) 14> stats rep1
Sending STATS request to REPLICAT REP1 ...
No active replication maps.
##详细检查REPLICAT进程的配置文件
GGSCI (ogg) 18> edit param rep1
REPLICAT rep1
SETENV (NLS_LANG=AMERICAN_AMERICA.AL32UTF8)
USERID ogg, PASSWORD ogg
HANDLECOLLISIONS
ASSUMETARGETDEFS
DISCARDFILE ./dirrpt/rep1.dsc, PURGE
MAP scott.emp_ogg, TARGET scott.emp_ogg;
MAP scott.dept_ogg, TARGET scott.dept_ogg;
6 ORA-06512: at line 1 SQL BEGIN sys.dbms_xstream_gg.SET_FOO_TRIGGER_SESSION_CONTXT
GGSCI (ogg) 28> view report RORA_1
2019-06-20 09:16:01 ERROR OGG-00868 ORA-26947: Oracle GoldenGate replication is not enabled.
ORA-06512: at "SYS.DBMS_XSTREAM_GG_INTERNAL", line 46
ORA-06512: at "SYS.DBMS_XSTREAM_GG", line 13
ORA-06512: at line 1 SQL BEGIN sys.dbms_xstream_gg.SET_FOO_TRIGGER_SESSION_CONTXT (fire=>TRUE); END;.
GGSCI (DSI) 2> EDIT PARAMS RORA_1
##删除DBOPTIONS SUPPRESSTRIGGERS
---------分割线,前面的错误是最近2天搭建ogg所遇到的错误,下面是转载的,多一次分享,大家就容易解决问题
原文链接:https://www.linuxidc.com/Linux/2015-01/111930.htm
7 用户不存在
GGS ERROR 2001 Oracle GoldenGate Delivery for Oracle, rcrmheal.prm:
Fatal error executing DDL replication: error [Error code [1918], ORA-01918: user 'pxboracle' does not exist,
SQL /* GOLDENGATE_DDL_REPLICATION */ alter user pxboracle account unlock ],
no error handler present.
问题分析:
根据分析日志可以确定是目标端不存在该用户导致的故障。
问题处理:
方法1、如果不需要同步该用户,可以在目标端去掉掉映射该用户,再重启进程。
例如去掉:MAP pxboracle.*, TARGET tpxboracle.*;
方法2、在目标端手工创建该用户,再重启进程。
8 表不存在
GGS ERROR 101 Oracle GoldenGate Delivery for Oracle, rcrmheal.prm: Table PXBORACLE.TB_USERS does not exist in target database.
问题分析:
根据分析日志可以确定是目标端不存在该表导致的故障。
问题处理:
方法1、如果不需要同步该表,可以在目标端排除掉该表,再重启进程。
例如添加:MAPEXCLUDE PXBORACLE.TB_USERS
方法2、在目标端手工创建该表, 异构数据库还需要重新生成表结构定义文件,再重启进程。
9 数据库索引失效
GGS WARNING 218 Oracle GoldenGate Delivery for Oracle, rapcaxht.prm:
SQL error 1502 mapping TSM.DOCONTRACT to TTSM.DOCONTRACT OCI Error ORA-01502: index TSM.PK_SID' or partition of such index is in unusable state (status = 1502),
SQL <INSERT INTO "TSM"."DOCONTRACT" ("SID","RIQI","JGID","HT_ID","KH_XM","KH_ID","KH_NUM","CREATEDDATE","MODIFIEDDATE","USERNAME","REALNAME","BS","MEMO1","MEMO2","KH_IDLX","DXJGID","KH_IDTY","CPID") VA>.
问题分析:
数据库索引失效引起的故障。
问题处理:
重建这个有问题的索引,再重启进程,故障排除。
10 表结构不一致 GGS ERROR 218 Oracle GoldenGate Delivery for Oracle, rcrmheal.prm: Error mapping from OLAP.TB_FT_OFSTK_BAL_HIS to CRMOLAP.TB_FT_OFSTK_BAL_HIS.
问题分析:
出现该问题一般都是由于同步的源和目标表结构不一致,包括表字段和索引。
问题处理:
1、 如果是表字段不一致,需要修改表字段,异构数据库还需要重新生成表结构定义文件,再重启进程。
2、 如果是索引不一致,需要重建索引,异构数据库还需要重新生成表结构定义文件,再重启进程。
11 磁盘空间不足
GGS ERROR 103 Oracle GoldenGate Collector: Unable to write to file "./dirdat/crm/fl003629" (error 28, No space left on device).
问题分析:
根据分析日志可以确定是磁盘空间不足导致的故障。
问题处理:
划分足够的磁盘空间,再重启进程。
12 TCP/IP故障
GS WARNING 150 Oracle GoldenGate Capture for Oracle, BSAIAXEC.prm: TCP/IP error 10060 (由于连接方在一段时间后没有正确答复或连接的主机没有反应,连接尝试失败。).
问题分析:
根据分析日志可以确定是不能连接到远程主机,包括ip地址或端口号。
问题处理:
需要打通能够连接到远程主机IP和端口,再重启进程。
13 数据库不能连接
GGS ERROR 182 Oracle GoldenGate Delivery for Oracle, rtasaxta.prm: OCI Error during OCIServerAttach (status = 12154-ORA-12154: TNS:could not resolve the connect identifier specified).
问题分析:
这种故障是数据库不能连接导致goldengate进程异常。
问题处理:
需要先解决数据库异常,再重启进程。
14 表空间不足
GGS ERROR 103 Discard file (./dirrpt/rep1.dsc) exceeded max bytes (10000000).
问题分析:
根据错误可以看出直接引起GoldenGate进程停止的原因是discard文件被写满了,是什么原因造成discard文件被写满的呢?
从discard文件中我们看到是发生了ORA-01653: unable to extend 错误,看到这里我相信大家都知道该怎么处理了吧,我们只要扩展这个aaa.TB_LVY_TEMPINVOIC对象所在的表空间的大小即可。
问题处理:
1、找到相关对象存储的表空间;
例如:select owner,table_name,tablespace_name from dba_tables
2、执行表空间扩展
例如:ALTER TABLESPACE tbs_03 ADD DATAFILE 'tbs_f04.dbf' SIZE 100K AUTOEXTEND ON NEXT 10K MAXSIZE 100K;
15 网络传输问题
GGS ERROR 112 There is a problem in network communication, a remote file problem, encryption keys for target and source do not match (if using ENCRYPT) or an unknown error.
(Remote file used is /oradataA/ggtrail/b1000008, reply received is Unable to lock file "/oradataA/ggtrail/b1000008" (error 13, Permission denied). Lock currently held by process id (PID) 3674350).
问题分析:
问题处理:
方法1、手工去KILL掉相应的锁进程,再重新启动进程。
方法2、不需理会,大概2小时后会自动释放该锁进程。
方法3、goldengate 10.4.0.76 会解决锁问题。
16 参数变量配置不正确
Did not recognize parameter argument
问题分析:
进程参数文件配置不正确。
问题处理:
检查参数配置文件,可能是进程名称与配置文件不一致或者是参数不正确,重启进程
17 捕获进程不能为表添加补充日志
GS ERROR 2100 Oracle GoldenGate Capture for Oracle, ecrmheal.prm:
Could not add TRAN DATA for table, error [ORA-32588: supplemental logging attribute all column exists,
SQL ALTER TABLE "AXTECH"."TB_FUND_MATCHING" ADD SUPPLEMENTAL LOG DATA (ALL) COLUMNS /* GOLDENGATE_DDL_REPLICATION */], error code [32588],
operation [ALTER TABLE "AXTECH"."TB_FUND_MATCHING" ADD SUPPLEMENTAL LOG DATA (ALL) COLUMNS /* GOLDENGATE_DDL_REPLICATION */ (size 113)].
问题分析:
因为表已经开启了补充日志(附加日志),而对表做DDL操作时,参数“DDLOPTIONS ADDTRANDATA”会对表重新开启补充日志(附加日子),但如果该表超过32个字段,并且该表没有唯一索引时会出现上面的异常;
问题处理:
方法1、去掉参数“DDLOPTIONS ADDTRANDATA”。
方法2、DELETE TRANDATA 用户.表
方法3、登录数据库执行: ALTER TABLE AXHT.BMBM2002 DROP SUPPLEMENTAL LOG DATA (ALL) COLUMNS
18 数据库补充日志(附加日志)没有打开
GGS ERROR 190 Oracle GoldenGate Capture for Oracle, ECRMGGS.prm: No minimum supplemental logging is enabled.
This may cause extract process to handle key update incorrectly if key column is not in first row piece.
GGS ERROR 190 Oracle GoldenGate Capture for Oracle, ECRMGGS.prm: PROCESS ABENDING.
问题分析:
根据分析日志可以确定是源端oracle补充日志没有打开导致的故障,如果主键或唯一索引是组合的(复合的),就需要为表配置supplemental log,否则就不必,
也就是说,如果所有表的主键是单列的,那根本就不必去理会它是什么意思,如果更新了主键中的部分字段,那supplemental log的作用就是把该记
录其余的组成部分的数据也传输到目标机,否则目标机就存在不确定性。
问题处理:
登录数据库,使用命令ALTER DATABASE ADD SUPPLEMENTAL LOG DATA打开补充日志。然后重新添加捕获进程和本地队列
19 表补充日志(附加日志)没有打开
GGS WARNING Z1-078 Oracle GoldenGate Capture for Oracle, ECRMGGS.prm: No valid default archive log destination directory found for thread 1.
GGS ERROR 500 Oracle GoldenGate Capture for Oracle, ECRMGGS.prm: Found unsupported in-memory undo record in sequence 2, at RBA 39675920,
with SCN 0.554993 (554993) ... Minimum supplemental logging must be enabled to prevent data loss.
问题分析:
根据分析日志可以确定是源端oracle补充日志没有打开导致的故障。
问题处理:
登录数据库,使用命令ALTER DATABASE ADD SUPPLEMENTAL LOG DATA打开补充日志
20 DDL复制表没找到
GGS ERROR 2008 Oracle GoldenGate Capture for Oracle, ECRMGGS.prm: DDL Replication is enabled but table GGS.GGS_DDL_HIST is not found. Please check DDL installation in the database
问题分析:
根据分析日志可以确定是DDL复制操作已经打开,但没有找到安装复制DDL执行脚本产生的表GGS.GGS_DDL_HIST导致的故障。
问题处理:
因为安装复制DDL是使用用户GGDDL,执行脚本后会在该用户产生跟踪goldengate运行的表,所以要实现支持DDL操作,
在参数文件中登录数据库必须使用GGDLL和对应的密码登录。例如:USERID GGDDL@CRMDB,PASSWORD GGDDL。