以下实验测试OGG FOR mysql 同步DDL,
OGG 21.3
MYSQL 8.0.27
--创建测试数据
create table oggddl_20241201 (oid int primary key ,oname varchar(10));
create table oggddl_20241202 (oid int primary key ,oname varchar(10));
create table oggddl_20241203 (oid int primary key ,oname varchar(10));
create table oggddl_20241204 (oid int primary key ,oname varchar(10));
insert into oggddl_20241201 values (1,'ogddl1');
--MGR进程配置
port 7920
dynamicportlist 7920-7925
AUTORESTART EXTRACT *,RETRIES 5,WAITMINUTES 3
PURGEOLDEXTRACTS ./dirdat/*, USECHECKPOINTS,MINKEEPDAYS 3
ACCESSRULE, PROG *, IPADDR 10.10.*.*, ALLOW
LAGREPORTHOURS 1
LAGINFOMINUTES 30
LAGCRITICALMINUTES 45
--源端配置,如果sock文件不在默认的/tmp目录
setenv (MYSQL_UNIX_PORT=/data/mysql/tmp/mysql.sock)
edit param exm8
extract exm8
setenv (MYSQL_UNIX_PORT=/data/mysql/tmp/mysql.sock)
sourcedb testdb@10.xx.xx.xx:3306, userid root, password Sjztdb#2023
TRANLOGOPTIONS ALTLOGDEST REMOTE
ddl include mapped
exttrail ./dirdat/m8
table testdb.*;
add ext exm8, tranlog, begin now
add exttrail ./dirdat/m8, ext exm8
edit param re57
replicat re57
targetdb testdb@10.xx.xx.xx:3306, userid root, password Sjztdb#2023
map testdb.*, target testdb.*;
add rep re57, exttrail ./dirdat/m8, nodbcheckpoint
--启动抽取进程错误
2024-12-14 19:58:20 ERROR OGG-00146 Call to VAMInitialize returned with error status 600: VAM Client Report <CAUSE OF FAILURE :
MySQL server variable 'binlog_row_metadata' is not set to 'FULL'. Please set the variable to 'FULL' and restart the MySQL server
WHEN FAILED : While checking the value of MySQL server variable 'binlog_row_metadata'
WHERE FAILED : MySQLBinLog Reader Module
CONTEXT OF FAILURE : No Information Available!>.
2024-12-14 19:58:20 ERROR OGG-01668 PROCESS ABENDING.
--解决方法
SET GLOBAL BINLOG_ROW_METADATA = FULL;
测试成功。
拓展:如果需要同步某一类型的表测试使用通配符不行,比如数据库有一类表tab_20241201,tab_20241202,tab_20241203,程序自动每天会创建以天为单位的表,尝试使用参数
tab_*,同步失败,但是进程状态是正常的。