OGG安装部署遇到的问题整理

OGG安装部署遇到的问题整理

1、OGG-00768 The MyISAM storage type tables are not supported
2022-05-24 02:39:07 ERROR OGG-00768 The MyISAM storage type tables are not supported for Extraction. Please, create table (cargo.sys_log) with ENGINE=InnoDB. SQL error (0).

2022-05-24 02:39:07 ERROR OGG-01668 PROCESS ABENDING.

OGG不支持MyISAM引擎,过滤MyISAM引擎表,或者把MyISAM引擎修改为INNODB

2、源端启动初始化进程报错OGG-01201 Error reported by MGR : Access denied.
源端init_1日志:
2022-05-24 07:35:34 ERROR OGG-01201 Error reported by MGR : Access denied.

2022-05-24 07:35:34 ERROR OGG-01668 PROCESS ABENDING.
目标端mgr日志:

可以看到是目标端mgr主动拒绝了源端extract启动replicat进程repinit。
后进过查询资料,这是由于GoldenGate 12.2的新特性导致的,要想可以通过远程启动目标端的replicat进程,需要在mgr中增加参数如下:

3、源端时区问题
2022-05-25 15:01:22 ERROR OGG-03523 Failed to set session time zone to source database time zone ‘Etc/UTC’.

OGG-03523 Failed to set session time zone to source database time zone ‘EAT’ (Doc ID 1961948.1)

docker容器默认使用UTC 时间(世界协调时间)
原因:
root@6f1fffa70457:/ogg18# cat /etc/timezone
Etc/UTC

解决方法:
进入容器
root@6f1fffa70457:/ogg18# echo “Asia/Shanghai” > /etc/timezone
root@6f1fffa70457:/ogg18# ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
其中/usr/share/zoneinfo/Asia/Shanghai为我们宿主机上的文件

最后重启容器
[root@dockmysql ~]# docker stop deploy_db_1
[root@dockmysql ~]# docker start deploy_db_1

[root@dockmysql ~]# date
Wed May 25 15:15:11 CST 2022
[root@dockmysql ~]# docker exec -it deploy_db_1 bash
root@b9a9610ef42d:/# date
Wed May 25 15:15:24 CST 2022

4、DDL同步问题
Only the CREATE TABLE, ALTER TABLE, and DROP TABLE operations are supported

1)MySQL 5.7.10 及更高版本支持 DDL 复制。

2)不支持 DDL 复制的双向过滤。

3)远程捕获实现不支持 DDL 复制。

4)Oracle GoldenGate DDL 复制使用两个插件作为共享库ddl_rewriter和ddl_metadata,必须在 Oracle GoldenGate 复制开始之前将其安装在您的 MySQL 服务器上。

5)metadata_server必须运行独立应用程序 Oracle GoldenGate才能捕获 DDL 元数据。

6)history新oggddl数据库下的表 ( ) oggddl.history。此元数据历史表用于存储和检索 DDL 元数据历史。必须忽略历史表记录,以免将其记录到二进制日志中,因此您必须 binlog-ignore-db=oggddl在my.cnf文件中指定。

7)您不应手动删除oggddl数据库或history表,因为在此事件之后运行的所有 DDL 语句都将丢失。

8)您不应停止metadata_server在 DDL 捕获期间,因为在此事件之后运行的所有 DDL 语句都将丢失。

9)您不应在 DDL 捕获期间手动删除ddl_rewriter和ddl_metadata插件,因为在此事件之后运行的所有 DDL 语句都将丢失。

10)不支持在存储过程中执行的 DDL 。例如,不支持如下执行的 DDL。

5、MySQL to Oracle数据类型转换关系

MySQL	Oracle

1 BIGINT 64-bit integer NUMBER(19)
2 BINARY(n) Fixed-length byte string, 1 ⇐ n ⇐ 255 RAW(n)
3 BIT(n) Fixed-length bit string, 1 ⇐ n ⇐ 64 RAW(n/8)
4 BLOB(n) Binary large object, ⇐ 64K BLOB
5 BOOLEAN, BOOL 0 or 1 value; NULL is not allowed CHAR(1)
6 CHAR(n), CHARACTER(n) Fixed-length string, 1 ⇐ n ⇐ 255 CHAR(n), CHARACTER(n)
7 CHARACTER VARYING(n) Variable-length string, 1 ⇐ n ⇐ 65535 VARCHAR2(n)
8 DATE Date (year, month and day) DATE Also includes time part
9 DATETIME§ Date and time data with fraction TIMESTAMP§
10 DECIMAL(p,s), DEC(p,s) Fixed-point number NUMBER(p,s)
11 DOUBLE [PRECISION] Double-precision floating-point number BINARY_DOUBLE
12 FIXED(p,s) Fixed-point number NUMBER(p,s)
13 FLOAT§ Floating-point number BINARY_DOUBLE
14 FLOAT4§ Floating-point number BINARY_DOUBLE
15 FLOAT8 Double-precision floating-point number BINARY_DOUBLE
16 INT, INTEGER 32-bit integer NUMBER(10)
17 INT1 8-bit integer NUMBER(3)
18 INT2 16-bit integer NUMBER(5)
19 INT3 24-bit integer NUMBER(7)
20 INT4 32-bit integer NUMBER(10)
21 INT8 64-bit integer NUMBER(19)
22 LONGBLOB Binary large object, ⇐ 4G BLOB
23 LONGTEXT Character large object, ⇐ 4G CLOB
24 LONG VARBINARY Binary large object, ⇐ 16M BLOB
25 LONG, LONG VARCHAR Character large object, ⇐ 16M CLOB
26 MEDIUMBLOB Binary large object, ⇐ 16M BLOB
27 MEDIUMINT 24-bit integer NUMBER(7)
28 MEDIUMTEXT Character large object, ⇐ 16M CLOB
29 MIDDLEINT 24-bit integer NUMBER(7)
30 NCHAR(n) Fixed-length UTF-8 string, 1 ⇐ n ⇐ 255 NCHAR(n)
31 NVARCHAR(n) Varying-length UTF-8 string, 1 ⇐ n ⇐ 65535 NVARCHAR2(n)
32 NUMERIC(p,s) Fixed-point number NUMBER(p,s)
33 REAL Double-precision floating-point number BINARY_DOUBLE
34 SERIAL 64-bit autoincrementing integer Sequence and trigger
35 SMALLINT 16-bit integer NUMBER(5)
36 TEXT Character large object, ⇐ 64K CLOB
37 TIME§ Time (Hour, minute, second and fraction) TIMESTAMP§
38 TIMESTAMP§ Auto-updated datetime TIMESTAMP§
39 TINYBLOB Binary data, ⇐ 255 bytes RAW(255)
40 TINYINT 8-bit integer NUMBER(3)
41 TINYTEXT Character data, ⇐ 255 bytes VARCHAR2(255)
42 VARBINARY(n) Variable-length byte string, 1 ⇐ n ⇐ 65535 RAW(n)
43 VARCHAR(n) Variable-length string, 1 ⇐ n ⇐ 65535 VARCHAR2(n)
44 YEAR[(2 | 4)] Year in 2-digit or 4-digit format NUMBER(4)

6、配置DDL错误解决- pgrep: not found
root@b9a9610ef42d:/ogg18# ./ddl_install.sh install root q1w2e3r4 3306
5.7.35-log
checking MySQL version
./ddl_install.sh: 192: [: 5.7.35-log: unexpected operator
DDL is supported for your installed MySQL version.
./ddl_install.sh: 214: [: /usr/lib/mysql/plugin/: unexpected operator
plugin_dir: /usr/lib/mysql/plugin/

./ddl_install.sh: 223: [: install: unexpected operator
./ddl_install.sh: 38: ./ddl_install.sh: pgrep: not found
The metadata_server could not be started. See ddlmetadataserver.log for details.
root@b9a9610ef42d:/ogg18# nohup: appending output to ‘nohup.out’

ERROR: An error occurred when reading from this client: msgrcv

解决方法:
进入容器并安装

apt-get install procps

1、libnnz12.so: cannot open shared object file
[oracle@ora11g ogg]$ ./ggsci
./ggsci: error while loading shared libraries: libnnz12.so: cannot open shared object file: No such file or directory

Check if the correct env variable $LD_LIBRARY_PATH is set

解决方法:重新安装支持11g数据库的ogg

2、ERROR: Unable to connect to database using user ogg. Please check privileges.

GGSCI (ora11g) 12> dblogin userid ogg,password ogg
ERROR: Unable to connect to database using user ogg. Please check privileges.
Unable to initialize database connection because of error ORA-00942: table or view does not exist.

解决方法 :
授权
exec dbms_goldengate_auth.grant_admin_privilege(‘ogg’);

3、ERROR: No checkpoint table specified for ADD REPLICAT.

GGSCI (ora11g as ogg@orcl/ORCL) 17> add replicat rep_1,exttrail ./dirdat/e2
ERROR: No checkpoint table specified for ADD REPLICAT.

解决方法:增加checkpoint table
GGSCI (ora11g) 1> dblogin userid ogg@orcl,password ogg
Successfully logged into database.

GGSCI (ora11g as ogg@orcl) 2> add checkpointtable ogg.checkpoint

Successfully created checkpoint table ogg.checkpoint.

4、ERROR: No checkpoint table specified for ADD REPLICAT.

GGSCI (ora11g as ogg@orcl) 11> add replicat rep_1, exttrail ./dirdat/e2
ERROR: No checkpoint table specified for ADD REPLICAT.

解决方法; 指定checkpoint table
GGSCI (ora11g as ogg@orcl) 12> add replicat rep_1,exttrail ./dirdat/e2,checkpointtable ogg.checkpoint
REPLICAT added.

5、目标端创建表结构-字段自增长属性问题
Oracle数据库中没有AUTO_INCREMENT属性。

6、目标端创建表结构-数据类型问题
oracle本来就没有int类型,为了与别的数据库兼容,新增了int类型作为number类型的子集。int相当于number(22),存储总长度为22的整数。

Oracle没有tinyint类型。

Oracle没有unsigned 。

Oracle在创建表的时候字段不需要指定CHARACTER SET utf8

Oracle创建索引的时候不需要指定USING BTREE

Oracle中的时间类型
mysql数据库既有date类型也有datetime类型。 Oracle数据库的date类型和mysql的date类型是不一样的,Oracle的date类型为YYYY-MM-DD hh:mm:ss和mysql中的datetime类型匹配, 而 mysql 的date类型为 yyyy-mm-dd。

Oracle中没有KEY属性
KEY idx_sub_tracking_no_entry_num (sub_tracking_no,entry_num)

Oracle中没有text数据类型,无法通过“remark text,”创建字段,对应的Oracle字段类型是“CLOB 超长文本字符串”
CREATE TABLE cargo_abnormal (
id varchar(36) NOT NULL,
create_by varchar(50) DEFAULT NULL,
create_time date DEFAULT NULL,
update_by varchar(50) DEFAULT NULL,
update_time date DEFAULT NULL,
sub_tracking_no varchar(32) DEFAULT NULL,
type number(1) DEFAULT NULL,
left_angle_url varchar(255) DEFAULT NULL,
right_angle_url varchar(255) DEFAULT NULL,
top_angle_url varchar(255) DEFAULT NULL,
remark text,
PRIMARY KEY (id)
)

7、目标端不支持DDL操作

2022-05-29 21:03:09 ERROR OGG-00406 DDL replication is not compatible with SOURCEDEFS/TARGETDEFS parameter.

2022-05-29 21:03:09 ERROR OGG-01668 PROCESS ABENDING.

2022-05-29T21:23:29.621+0800 WARNING OGG-06321 Oracle GoldenGate Delivery for Oracle, rep_1.prm: DDL Replication is not supported when the source and target databases are from different vendors.

  • 26
    点赞
  • 18
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值