暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

Oracle启动CDC配置

原创 dk 2021-09-26
2283

1、查看是否开启归档

SQL> select name,log_mode from v$database;
NAME LOG_MODE


ORCL NOARCHIVELOG
2、如果没有则需要开启归档

SQL> archive log list
Database log mode No Archive Mode
Automatic archival Disabled
Archive destination /u01/app/oracle/product/11.2/db_1/dbs/arch
Oldest online log sequence 2
Current log sequence 4
SQL> alter system set log_archive_dest_1=‘location=/u01/app/oracle/backup/archivelog optional’; //修改目录
System altered.
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.
Total System Global Area 3256942592 bytes
Fixed Size 2257640 bytes
Variable Size 738200856 bytes
Database Buffers 2499805184 bytes
Redo Buffers 16678912 bytes
Database mounted.
SQL> alter database archivelog; //开启归档
Database altered.
SQL> alter database open;
Database altered.
SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /u01/app/oracle/backup/archivelog
Oldest online log sequence 2
Next log sequence to archive 4
Current log sequence 4

开启附加日志(supplemental log)可以指示数据库在日志中添加额外信息到日志流中,用以支持基于日志的工具,注意:条件需要所有字段在开启ALLC为YES

SQL> alter database add supplemental log data(primary key,unique,foreign key,all) columns;
SQL> select supplemental_log_data_min min,supplemental_log_data_pk pk,supplemental_log_data_ui ui,supplemental_log_data_fk fk,supplemental_log_data_all allc from v$database;
MIN PK UI FK ALLC


YES YES YES YES YES
3、创建用户及授权

SQL> create role logmnr_role;
Role created.
SQL> grant create session to logmnr_role;
Grant succeeded.
SQL> grant execute_catalog_role,select any transaction,select any dictionary ,select any table to logmnr_role;
Grant succeeded.
SQL> create user kminer identified by kminerpass;
User created.
SQL> grant logmnr_role to kminer;
Grant succeeded.
SQL> alter user kminer quota unlimited on users;
User altered.
SQL>

「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
1人已赞赏
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论