Miscellaneous talk of FlinkCDC series: 2.0 cannot truly be intrusive

Recently, a project called for a synchronization software for various data sources, so I started to do research on the content of CDC. In the major blogs, I accidentally saw that the FlinkCDC2.0 version can achieve "no lock in the whole process" and "users have no perception", so the test was launched.

The test code takes this link:

FlinkSQL CDC implements synchronization of oracle data to mysql

FlinkCDC version number is 2.1.2 > 2.0

The first error reported is: the user cannot see the system form v$database.

After the grant permission, the second error is reported, Use: ALTER DATABASE ADD SUPPLEMENTAL LOG DATA.

According to this post, Supplemental Logging enable conditions for CDC for Oracle

The CDC of the Oracle database has several levels:

  1. Full database, full column logging:
--结果应当为yes
--本地数据库为No
select  supplemental_log_data_all  from v$database;
  1. Minimal logging:
--结果为Yes或者Implicit
--本地数据库为No
select supplemental_log_data_min MIN from v$database;
  1. Table level logging:
--结果为all_column_logging
--本地数据库新建了这张表后符合条件
select * from dba_log_groups where table_name='STUDENT_INFO' ;

That is to say, if the oracle database is to achieve version 2.12 CDC, it really needs to do what the author of the article did:

-- 启用日志归档
alter system set db_recovery_file_dest_size = 10G;
alter system set db_recovery_file_dest = '/home/oracle/oracle-data-test' scope=spfile;
shutdown immediate;
startup mount;
alter database archivelog;
alter database open;

-- 检查日志归档是否开启
archive log list;

-- 为捕获的数据库启用补充日志记录,以便数据更改捕获更改的数据库行之前的状态,下面说明了如何在数据库级别进行配置。
ALTER DATABASE ADD SUPPLEMENTAL LOG DATA;

-- 创建表空间
CREATE TABLESPACE logminer_tbs DATAFILE '/home/oracle/logminer_tbs.dbf' SIZE 25M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED;

-- 创建用户family绑定表空间LOGMINER_TBS
CREATE USER family IDENTIFIED BY zyhcdc DEFAULT TABLESPACE LOGMINER_TBS QUOTA UNLIMITED ON LOGMINER_TBS;

-- 授予family用户dba的权限
 grant connect,resource,dba to family;

-- 并授予权限
  GRANT CREATE SESSION TO family;
  GRANT SELECT ON V_$DATABASE to family;
  GRANT FLASHBACK ANY TABLE TO family;
  GRANT SELECT ANY TABLE TO family;
  GRANT SELECT_CATALOG_ROLE TO family;
  GRANT EXECUTE_CATALOG_ROLE TO family;
  GRANT SELECT ANY TRANSACTION TO family;
  GRANT EXECUTE ON SYS.DBMS_LOGMNR TO family;
  GRANT SELECT ON V_$LOGMNR_CONTENTS TO family;
  GRANT CREATE TABLE TO family;
  GRANT LOCK ANY TABLE TO family;
  GRANT ALTER ANY TABLE TO family;
  GRANT CREATE SEQUENCE TO family;

  GRANT EXECUTE ON DBMS_LOGMNR TO family;
  GRANT EXECUTE ON DBMS_LOGMNR_D TO family;

  GRANT SELECT ON V_$LOG TO family;
  GRANT SELECT ON V_$LOG_HISTORY TO family;
  GRANT SELECT ON V_$LOGMNR_LOGS TO family;
  GRANT SELECT ON V_$LOGMNR_CONTENTS TO family;
  GRANT SELECT ON V_$LOGMNR_PARAMETERS TO family;
  GRANT SELECT ON V_$LOGFILE TO family;
  GRANT SELECT ON V_$ARCHIVED_LOG TO family;
  GRANT SELECT ON V_$ARCHIVE_DEST_STATUS TO family;
————————————————
版权声明:本文为CSDN博主「雾岛与鲸」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/qq_36039236/article/details/124235751

If the above conditions or permissions are not met, the CDC function cannot be enabled.

Guess you like

Origin blog.csdn.net/xiaozoom/article/details/125672911