ogg将Oracle 19C的部分表数据同步到TIDB

为提高效率,提问时请提供以下信息,问题描述清晰可优先响应。

  • 【TiDB 版本】:3.0.12
  • 【问题描述】:我想使用ogg将Oracle 19C的部分表数据同步到TIDB ,
    tidb端是用软件191003_ggs_Linux_x64_MySQL_64bit.zip不知道是否可以。

若提问为性能优化、故障排查类问题,请下载脚本运行。终端输出的打印结果,请务必全选并复制粘贴上传。

如果 ogg 版本 191003_ggs_Linux_x64_MySQL_64bit.zip 支持同步数据至 MySQL 5.7 ,那在 tidb 端使用就没有多大问题。建议直接到 Oracle 官网 查下该 ogg 版本对 MySQL 的支持情况。

GGSCI (tidb) 2> dblogin sourcedb ogg@172.10.0.xxx:4000, userid ogg password ogg

2020-10-20 17:38:35 WARNING OGG-00769 MySQL Login failed: . SQL error (1045). Access denied for user ‘ogg’@‘172.30.0.118’ (using password: NO).
ERROR: Failed to connect to MySQL database engine for HOST 172.10.0.xxx, DATABASE ogg, USER ogg, PORT 4000.

检查下用户和数据库的权限,看下直接在 MySQL 客户端中能否登陆

[quote=“aiaix1211, post:3, topic:62953”]
ERROR: Failed to connect to MySQL database engine fo

可以登录的,本地

[root@tidb ~]# mysql -h 127.0.0.1 -P 4000 -uogg -pogg
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MySQL connection id is 1017339
Server version: 5.7.25-TiDB-v3.0.5 MySQL Community Server (Apache License 2.0)

Copyright © 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

MySQL [(none)]>

MySQL [(none)]> show create user ogg;
±-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
| CREATE USER for ogg@% |
±-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
| CREATE USER ‘ogg’@’%’ IDENTIFIED WITH ‘mysql_native_password’ AS ‘*DDB025A9915C6DADA58CBB002408F9025CDE705B’ REQUIRE NONE PASSWORD EXPIRE DEFAULT ACCOUNT UNLOCK |
±-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

tidb 中数据库 ogg 有创建吗?

创建了

请检查下 tidb 中用户 ogg 有无读写数据库 ogg 的权限,比如是否授予下面的权限:

GRANT ALL PRIVILEGES ON ogg.* to ogg;

[root@tidb ~]# mysql -h 127.0.0.1 -P 4000 -uogg -pogg_passwd
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MySQL connection id is 1019257
Server version: 5.7.25-TiDB-v3.0.5 MySQL Community Server (Apache License 2.0)

Copyright © 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

MySQL [(none)]> show databases;
±-------------------+
| Database |
±-------------------+
| INFORMATION_SCHEMA |
| dbogg |
±-------------------+
2 rows in set (0.01 sec)

MySQL [(none)]>
MySQL [(none)]> show create user ogg;
±-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
| CREATE USER for ogg@% |
±-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
| CREATE USER ‘ogg’@’%’ IDENTIFIED WITH ‘mysql_native_password’ AS ‘*DDB025A9915C6DADA58CBB002408F9025CDE705B’ REQUIRE NONE PASSWORD EXPIRE DEFAULT ACCOUNT UNLOCK |
±-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

MySQL [(none)]> show grants for ogg@’%’;
±---------------------------------------------+
| Grants for ogg@% |
±---------------------------------------------+
| GRANT USAGE ON . TO ‘ogg’@’%’ |
| GRANT ALL PRIVILEGES ON dbogg.* TO ‘ogg’@’%’ |
±---------------------------------------------+

GGSCI (tidb) 1> dblogin sourcedb dbogg@172.30.0.xxx:4000 userid ogg password ogg_passwd

2020-10-21 09:47:14 WARNING OGG-00769 MySQL Login failed: . SQL error (1045). Access denied for user ‘ogg’@‘172.30.0.118’ (using password: NO).
ERROR: Failed to connect to MySQL database engine for HOST 172.30.0.xxx, DATABASE dbogg, USER ogg, PORT 4000.

是要用低版本的oracle goldengate版本吗, 现在Oracle和tidb端都用的是19.1的版本。

[root@tidb ogg]# ./ggsci -v

Oracle GoldenGate Command Interpreter for MySQL
Version 19.1.0.0.3 OGGCORE_19.1.0.0.0_PLATFORMS_190907.0144
Linux, x64, 64bit (optimized), MySQL Enterprise on Sep 7 2019 08:41:32

Copyright © 1995, 2019, Oracle and/or its affiliates. All rights reserved.

[root@tidb ogg]#

有处理方法吗?? 我试了同步到mysql 5.7是可以的登录进去的。

有处理方法吗?? 我试了同步到mysql 5.7是可以的登录进去的。

那麻烦使用低版本的 ogg 再测试下呢?看下是否可以正常同步。

image

我改了这个参数怎么不生效

1.参数 lower_case_table_names 在 tidb 中只能使用默认值 2,无法调整成其他值:


2.token-limit 默认值就是 1000。


但是文档中写的支持修改为1啊, 好支持OGG

我理解你的意思了,确实可以修改这个参数来绕过 ogg 的检测。你上面修改参数没有生效的原因是 tidb 配置文件没有刷新:

1.修改 tidb-ansible/conf/tidb.yml
lower-case-table-names: 1
2.刷新下 tidb 的配置文件

ansible-playbook deploy.yml --tags tidb

3.可以直接重启或滚动重启 tidb

ansible-playbook stop.yml --tags tidb
ansible-playbook start.yml --tags tidb

4.可以验证下参数是否修改成功了

另外,如果使用 tiup cluster edit-config 修改 tidb 参数,修改后需要重新加载配置文件:

tidb cluster reload {cluste-name} -R tidb

ansible-playbook deploy.yml --tags tidb 这个命令不会重新部署TIDB吧?

不会,只是更新下 tidb 节点的配置文件