1、启动start psydb001 失败:报错:ERROR: Cannot create process '/data/u01/app/oracle/product/ogg_src/extract'. Child process is no longer alive
GGSCI (ORACLEOGG1) 2> start mgr
Manager started.
GGSCI (ORACLEOGG1) 3> start esydb001
Sending START request to MANAGER ...
ERROR: Cannot create process '/data/u01/app/oracle/product/ogg_src/extract'. Child process is no longer alive
2019-06-19 11:05:57 WARNING OGG-01742 Command sent to MGR MGR returned with an ERROR response.
2、发现需要注册:
GGSCI (ORACLEOGG1) 11> dblogin userid ogg_src,password ogg_src
Successfully logged into database.
GGSCI (ORACLEOGG1 as ogg_src@orclogg1) 12> register extract esydb001 database
2019-06-19 11:15:25 ERROR OGG-02058 The Oracle source database is not configured properly to support integrated capture.
The following configuration error must be fixed: ARCHIVELOG mode must be enabled on this Oracle database.
3、发现仍然报错:ARCHIVELOG mode must be enabled on this Oracle database,需要开启archivelog
SQL> shutdown immediate ;
SQL> startup mount;
SQL> alter database archivelog;
SQL> alter database open;
SQL> archive log list;
4、继续注册,仍然报错:" enable_goldengate_replication is not set to true."
GGSCI (ORACLEOGG1 as ogg_src@orclogg1) 3> register extract esydb001 database
2019-06-19 11:26:46 ERROR OGG-02060 The Oracle mining database is not configured properly to support integrated capture. The following configuration error must be fixed: Operation not supported because enable_goldengate_replication is not set to true.
SQL> alter system set enable_goldengate_replication=true scope=both; --(源端和目标daunt都要enable)
SQL> alter system switch logfile;
5、继续注册,成功,启动也成功
GGSCI (ORACLEOGG1 as ogg_src@orclogg1) 3> register extract esydb001 database
GGSCI (ORACLEOGG1 as ogg_src@orclogg1) 9> start esydb001
Sending START request to MANAGER ...
EXTRACT ESYDB001 starting
GGSCI (ORACLEOGG1 as ogg_src@orclogg1) 10> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
EXTRACT RUNNING ESYDB001 04:23:04 00:00:10
EXTRACT STOPPED PSYDB001 00:00:00 04:01:16
6、 启动PSYDB001一直报错,还是需要enable_goldengate_replication=true并注册,
7、PSYDB001删除重建操作
GGSCI (ORACLEOGG1 as ogg_src@orclogg1) 6> delete PSYDB001
GGSCI (ORACLEOGG1) 14> ADD EXTRACT PSYDB001, EXTTRAILSOURCE /data/u01/app/oracle/product/ogg_src/dirdat/es
GGSCI (ORACLEOGG1) 15> ADD RMTTRAIL /data/u01/app/oracle/product/ogg_trg/dirdat/ps, EXTRACT PSYDB001
8、DML操作后,查看更新状态stats esydb001,提示"No active extraction maps."
查看view params esydb001 ,参数“table ogg_src.togg;”写的是“table ogg_src.*",无法捕捉DML动作,需要查看问题
查看trandata,是否开启了日志提取:info trandata ogg_src.*(或某张表)
2019-07-18 14:36:58 INFO OGG-10471 ***** Oracle Goldengate support information on table OGG_SRC.GGS_DDL_PRIMARY_KEYS *****
Oracle Goldengate support native capture on table OGG_SRC.GGS_DDL_PRIMARY_KEYS.
Oracle Goldengate marked following column as key columns on table OGG_SRC.GGS_DDL_PRIMARY_KEYS: SEQNO, COLUMN_NAME
No unique key is defined for table OGG_SRC.GGS_DDL_PRIMARY_KEYS.
9、 Cannot create process '/data/u01/app/oracle/product/ogg_src/extract'. Child process is no longer alive,在ggserror.log的错误
2019-07-19T10:14:28.393+0800 ERROR OGG-00303 Oracle GoldenGate Capture for Oracle, esydb001.prm: Unable to connect to database using user ogg_src. Ensure that the necessary privileges are granted to the user.
Login to the database as user ogg_src failed because of error ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3701
Additional information: 1851999539
Process ID: 0
Session ID: 0 Serial number: 0.
2019-07-19T10:14:28.393+0800 ERROR OGG-01668 Oracle GoldenGate Capture for Oracle, esydb001.prm: PROCESS ABENDING.
解决:发现是edit params esydb001中的ORACLE_SID写错了,所以连不上。SETENV(ORACLE_SID="sorclogg1")改为SETENV(ORACLE_SID="orclogg1")空了
10.DDL问题:
报错:2019-07-26T09:05:05.393+0800 ERROR OGG-00519 Oracle GoldenGate Delivery for Oracle, rsydb001.prm: Fatal error executing DDL replication: error [Error code [1435], ORA-01435: user does not exist], no error handler present.
环境:
源端:ogg_src
目标端:ogg_trg
解决方法:
由于源端使用ogg_src用户执行“create tablespace tbs_test datafile '/data/u01/app/oracle/oradata/ORCLOGG1/datafile/tbs_test.dbf' size 10m;”操作,在目标端没有这个用户,需要session schema进行转换。解决办法使用:
DDLOPTIONS MAPSESSIONSCHEMA source_schema TARGET target_schema
例如:DDLOPTIONS MAPSESSIONSCHEMA ogg_src target ogg_trg
11.DDL问题:解决上述问题后,又出现如下问题:
2019-07-26T09:37:27.435+0800 ERROR OGG-00519 Oracle GoldenGate Delivery for Oracle, rsydb001.prm: Fatal error executing DDL replication: error [Error code [1119], ORA-01119: error in creating database file '/data/u01/app/oracle/oradata/ORCLOGG1/datafile/tbs_test.dbf' ORA-27040: file create error, unable to create file Linux-x86_64 Error: 2: No such file or directory Additional information: 1 ], no error handler present.
原因:在目标端没有路径“/data/u01/app/oracle/oradata/ORCLOGG1/datafile/”,只有”/data/u01/app/oracle/oradata/ORCLOGG2/datafile/“,临时创建ORCLOGG1路径
12.DDL问题:在OGG同步过程中,经常会碰上有创建表或表空间的同步,往往因为源和目标的平台不同,如aix->linux or linux->windows,这两个平台的表空间也经常不同,在目标端执行DDL时,可能会报错:
OGG-00495 Oracle GoldenGate Delivery for Oracle, erep5.prm: DDL error ignore for next retry: error code [DEFAULT], filter [include all (default)], error text [Error code [959], ORA-00959: tablespace 'D_724ACCESS' does not exist, SQL CREATE INDEX "OGGADM"."CUSTMER_PK" ON CUSTMER (CUST_ID) TABLESPACE D_724ACCESS /* GOLDENGATE_DDL_REPLICATION */]
针对这种情况,一般是使用DDLSUBST进行源和目标端的表空间名称替换,即在目标端先建立好目标端需要的表空间,然后在rep参数文件中添加如下语句:
DDLSUBST 'src-tablespace-name' WITH 'target-tablespace-name' INCLUDE ALL
13.双向复制出现无限循环情况(转)
一、双向复制避免数据循环复制的参数
首先说明一下循环复制,官网上的描述:
In a bidirectional configuration, SQL change s that are replicated from one system to
another must be prevented from being replicat ed back to the first system. Otherwise, it
moves back and forth in an endless loop, as in this example:
1. A user application updates a row on system A.
2. Extract extracts the row on system A and sends it to system B.
3. Replicat updates the row on system B.
4. Extract extracts the row on system B and sends it back to system A.
5. The row is applied on system A (for the second time).
6. This loop continues endlessly.
To prevent data loopback, you may need to provide instructions that:
● prevent the capture of SQL operations that are generated by Replicat, but enable the
capture of SQL operations that are generated by business applications if they contain
objects that are specified in the Extract parameter file.
● identify local Replicat transactions, in or der for the Extract process to ignore them.
意译:主端对数据的修改,被应用到了备端。但是备端在执行这个主端传递过来的数据改变时,又被备端的extract 进程
扑获到,并且又反给主端。然后主端又给备端,这样形成了循环复制,会一直循环下去。
一定要理解原因:主端执行修改数据的用户是和业务应用对应的用户(不是ogg用户),但是备端在执行主端传递过来的
对数据修改的用户是ogg复制用户,也就是我前面配置的ogg 用户。(ogg schema)而实际上这个用户发起的对数据的修改
只是对主端的应用,只是复制主端的事务。而不能再被作为对数据的修改,返回给主端。所以在参数文件中加入参数
过滤掉这个用户发起的对数据的修改。
以oralce 数据库为例,说明参数如下:
Do either of the following to specify the Replicat database us er. All transactions generated
by this user will be excluded from being captured. This information is available to Extract
in the transaction record.
● Identify the Replicat database user by name with the following parameter statement
in the Extract parameter file.
TRANLOGOPTIONS EXCLUDEUSER <user name>
该参数加到主端和备端的extract 参数文件中。
例如:
USERID ogg, PASSWORD AACAAAAAAAAAAADAHBLDCCIIOIRFNEPB, ENCRYPTKEY default
TRANLOGOPTIONS EXCLUDEUSER ogg
文章评论