接上一篇文档《Flink connector Oracle CDC 实时同步数据到MySQL(Oracle19c)》上次说的是Oracle19c版的配置方式。在数据同步的过程中遇到了读取数据延迟的情况,需要进行如下配置:
'debezium.log.mining.strategy'='online_catalog',
'debezium.log.mining.continuous.mine'='true'
可是Oracle19c取消了该组件的配置。后面换了Oracle12c版,CDC的配置稍有不同。
不同点在创建用户和授权的地方,需要做一些调整不然在Flink中调用 DBMS_LOGMNR.START_LOGMNR 时出现“用户不存在”的问题。
Error report - ORA-01435: user does not exist ORA-06512: at
“SYS.DBMS_LOGMNR”, line 72 ORA-06512: at line 3
01435. 00000 - “user does not exist”
*Cause:
*Action:
12c的配置如下:
--create C##family user on CDB
CREATE USER C##family IDENTIFIED BY family DEFAULT TABLESPACE LOGMINER_TBS QUOTA UNLIMITED ON LOGMINER_TBS ACCOUNT UNLOCK;
-- allow access to all PDBs to the C##family user
ALTER USER C##family SET CONTAINER_DATA=ALL CONTAINER=CURRENT
-- grant needed permissions
GRANT DBA to C##family ;
GRANT CREATE SESSION TO C##family ;
GRANT CREATE TABLE TO C##family ;
GRANT EXECUTE_CATALOG_ROLE TO C##family ;
GRANT EXECUTE ON DBMS_LOGMNR TO C##family ;
GRANT SELECT ON V_$DATABASE TO C##family ;
GRANT SELECT ON V_$LOGMNR_CONTENTS TO C##family ;
GRANT SELECT ON V_$ARCHIVED_LOG TO C##family ;
GRANT SELECT ON V_$LOG TO C##family ;
GRANT SELECT ON V_$LOGFILE TO C##family ;
GRANT RESOURCE, CONNECT TO C##family ;
12c的坑还挺多,有以下问题:
贴点命令吧:
删除用户和表空间:
SQL> drop user jack cascade;
SQL> drop tablespace school including contents and datafiles;