0
点赞
收藏
分享

微信扫一扫

MySQL部署OGG

月半小夜曲_ 2022-04-24 阅读 71

环境:

源端:Linux_MySQL 15.6

目标端:Oracle 19c

ext配置:

extract extsm
setenv (MYSQL_HOME="/var/lib/mysql")
setenv(NLS_LANG = "SIMPLIFIED CHINESE_CHINA.ZHS16GBK")
DBOPTIONS HOST 127.0.0.1, CONNECTIONPORT 3306
sourcedb lancet-ane@localhost:3306, userid oggadm, password oggadm
tranlogoptions altlogdest /var/lib/mysql/mysql-bin.index
exttrail ./dirdat/s1
dynamicresolution
gettruncates

table lancet-ane.mbs_visits;

pum配置:

extract pmpsm
setenv(NLS_LANG = "SIMPLIFIED CHINESE_CHINA.ZHS16GBK")
rmthost 192.168.**.*, mgrport 7809
rmttrail ./dirdat/s1
passthru
gettruncates

table lancet-ane.mbs_visits;

sourcesm.def:

DEFSFILE ./dirdef/sourcesm.def CHARSET ZHS16GBK
sourcedb lancet-ane@localhost:3306 USERID oggadm, PASSWORD oggadm

table lancet-ane.mbs_visits;

生成表结构文件:

./defgen paramfile dirprm/sourcesm.prm

ods端rep配置:

replicat repsm
setenv (NLS_LANG="AMERICAN_AMERICA.UTF8")
sourcedefs /data/ogg/dirdef/sourcesm.def
userid ogg@ewellpdb,password oracle
reperror default,discard
discardfile /data/ogg/dirrpt/repsm.dsc,append,megabytes 50
dynamicresolution

map lancet-ane.mbs_visits,                   target sm.mbs_visits;

EXTSM报错:

描述:ERROR   OGG-00146  Call to VAMInitialize returned with error status 600: VAM Client Report <CAUSE OF FAILURE : Failed to 
connect to mysql database
WHEN FAILED : While initializing mysql context
WHERE FAILED : MySQLBinLog Reader Module
CONTEXT OF FAILURE : No Information Available!>.

分析:

[root@LancetServer ~]# mysql -u oggadm -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 405402
Server version: 5.6.17-log MySQL Community Server (GPL)

Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

mysql> show global variables like '%binlog_format%';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| binlog_format | MIXED |
+---------------+-------+
1 row in set (0.00 sec)

mysql> 

show global variables like '%binlog_format%';--查看MYSQL的binlog格式

这个错误是由于MYSQL的binlog格式没有设置成ROW模式,如果使用OGG做数据初始化(数据迁移,不需要后续的同步操作),对binlog没有特殊的要求,使用默认的MIXED模式就可以,如果需要同步数据变化,就必须使用ROW模式。

解决方法:在my.cnf配置文件中,将binlog_format设置的值改成ROW,如果配置文件中没有这个设置,那么添加binlog_format=ROW即可

三种binlog格式:

Row:日志中会记录成每一行数据被修改的形式,然后在slave端再对相同的数据进行修改。

Statement:每一条会修改数据的sql都会记录到 master的bin-log中。slave在复制的时候sql进程会解析成和原来master端执行过的相同的sql来再次执行。

MIXED:智能混合 STATEMENT 和 ROW

ODS报错:

2022-04-15 22:21:24  ERROR   OGG-02622  A catalog name is specified for target table EWELLPDB.sm.mb
s_visits in the TABLE/MAP parameter, but no schema name is specified for source table mbs_visits.

2022-04-15 22:21:24  ERROR   OGG-01668  PROCESS ABENDING. 

原因:repsm配置中,源端表未加用户名

解决:

举报

相关推荐

0 条评论