微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

OGG-21.3 报错 OGG-00768 Failed to Map database character to ULibCharSet

因为没有直接在官网和其它地方找到答案, 所以记录一下.

场景

源端: MysqL 8.0.29

目标端 MysqL 5.7.38

工具 : OGG 21.3

报错现象

启动抽取进程 Extract的时候报的错

2022-06-21 16:22:26  INFO    OGG-01680  Please ensure the environment variable TZ is set to match the database time zone as timestamp in MysqL depends upon correct setting of TZ.

Source Context :
  SourceModule            : [ggdb.MysqL.util]
  SourceID                : [../gglib/ggdbMysqL/MysqLutil.c]
  SourceMethod            : [MysqLUTIL_check_err]
  SourceLine              : [560]
  ThreadBacktrace         : [15] elements
                          : [/root/ogg/libgglog.so(cmessageContext::Addthreadcontext())]
                          : [/root/ogg/libgglog.so(cmessageFactory::CreateMessage(CSourceContext*, unsigned int, ...))]
                          : [/root/ogg/libgglog.so(_MSG_String_UInt32_String(CSourceContext*, int, char const*, unsigned int, char const*, cmessageFactory::Messagedisposition))]
                          : [/root/ogg/extract(MysqLUTIL_check_err(short, char const*, ...))]
                          : [/root/ogg/extract(MysqLUTIL_get_database_charset())]
                          : [/root/ogg/extract(DBUTIL_getDatabaseMetadata(ggs::gglib::ggunicode::UString const*, ggs::gglib::ggapp::CDatabaseMetadata const**, ggs::gglib::ggunicode::UString&))]
                          : [/root/ogg/extract(gl_odbc_param(char const*, char const*, char (&) [2048]))]
                          : [/root/ogg/extract(get_infile_params(ggs::gglib::ggapp::ReplicationContextParams&, ggs::gglib::ggdatasource::DataSourceParams&, ggs::gglib::ggdatatarget::DataTargetParams&, ggs::gglib::ggMetadata::MetadataContext&))]
                          : [/root/ogg/extract()]
                          : [/root/ogg/extract(ggs::gglib::MultiThreading::MainThread::ExecMain())]
                          : [/root/ogg/extract(ggs::gglib::MultiThreading::Thread::RunThread(ggs::gglib::MultiThreading::Thread::ThreadArgs*))]
                          : [/root/ogg/extract(ggs::gglib::MultiThreading::MainThread::Run(int, char**))]
                          : [/root/ogg/extract(main)]
                          : [/lib64/libc.so.6(__libc_start_main)]
                          : [/root/ogg/extract()]

2022-06-21 16:22:26  ERROR   OGG-00768  Failed to Map database character to ULibCharSet. sql error (0).

2022-06-21 16:22:26  ERROR   OGG-01668  PROCESS ABENDING

分析

咋一看以为是字符集的问题, 于是查询官网错误码

OGG-00768: {0}. sql error ({1,number,0}). {2}

Cause: This is a generic error message and there can be multiple reasons for it. One reason Could be that a query to set the session timeout Failed. Ignoring this message results in the session being disconnected after a default time period if the connection has been idle. This error message also is used when an operation against the database fails, such as a query.

Action: To resolve this error, verify in the database why the query or other operation would fail. For example, verify that the user that executed the operation has the correct privileges to do so.

官网的意思就是连接的时候的问题, 比如超时之类的.

本次环境和超时没有关系, 超时参数设置都很大.

那就是连接的问题了, 比如密码插件之类的(很遗憾插件改为MysqL_native_password还是相同的报错)

解决问题

源端数据库版本换成 5.7.38之后正常了.

严格来说不算解决问题, 因为已经换了数据库版本了. 具体原因得等各位大佬来解决(^_^)

额外记录下 ogg-MysqL设置SSL.

Extract 和 Replicat 的 配置文件都加上如下内容

这几个文件都是MysqL服务器上的, 修改下路径就行, 当然也可以自己重新用openssl生成, 官网也是有教程的

SETENV (OGG_MysqL_OPT_SSL_CA='/var/lib/MysqL.pem') 
SETENV (OGG_MysqL_OPT_SSL_CERT='/var/lib/MysqL/client-cert.pem') 
SETENV (OGG_MysqL_OPT_SSL_KEY='/var/lib/MysqL/client-key.pem')

原文地址:https://cloud.tencent.com/developer/article/2027449

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐