注意事项:
1.flink版本1.13.6,flink版本小于1.1.3不支持oracle cdc。
2.下载flink驱动包放到flink/lib目录,要注意驱动跟flink版本相对应,flink版本1.13.6对应驱动如下。
oracle到mysql ddl
--源表
create table oracletest ( DEPTNO int ,DNAME VARCHAR,
LOC VARCHAR,
PRIMARY KEY (DEPTNO) NOT ENFORCED ) WITH (
'connector' = 'oracle-cdc',
'hostname' = '172.18.11.226',
'port' = '1521',
'username' = 'system',
'password' = '123456',
'database-name' = 'helowin',
'schema-name' = 'SCOTT',
'table-name' = 'DEPT',
'debezium.log.mining.continuous.mine'='true',
'debezium.log.mining.strategy'='online_catalog',
'debezium.database.tablename.case.insensitive'='false',
'scan.startup.mode' = 'initial'
);
--结果表
create table mysqltest ( deptno int,name VARCHAR,loc VARCHAR ,
PRIMARY KEY (deptno) NOT ENFORCED ) WITH (
'connector' = 'jdbc',
'url' = 'jdbc:mysql://172.18.11.224:3306/flinktest',
'table-name' = 'dept',
'username' = 'root',
'password' = 'Dcqc@123456'
);
INSERT INTO mysqltest
SELECT DEPTNO,DNAME,LOC
FROM oracletest ;