2

我正在使用预装了 Oracle 12c 和可插拔数据库 orcl 的虚拟机。我需要在该 oracle 上启用日志挖掘器以捕获更改的数据。我编写了一个 Java 实用程序,它读取 oracle 的重做日志并创建一个日志挖掘器会话并捕获数据。以前是抓数据的,现在抓不到数据了。这是我用来启用日志挖掘器的一组命令。

sqlplus sys/oracle@orcl12c as sysdba

shutdown immediate;

startup mount;

alter database archivelog;

alter database open;



ALTER SESSION SET CONTAINER=ORCL;

CREATE USER inventory IDENTIFIED BY oracle;

GRANT CONNECT TO inventory;

GRANT CONNECT, RESOURCE, DBA TO inventory;

CREATE TABLE inventory.customers(id number(10),first_name varchar2(20),last_name  varchar2(20),email varchar2(20),modified_date timestamp);

ALTER SESSION SET CONTAINER=cdb$root;

ALTER DATABASE ADD SUPPLEMENTAL LOG DATA;

ALTER DATABASE ADD SUPPLEMENTAL LOG DATA (ALL) COLUMNS;

ALTER SYSTEM SWITCH LOGFILE;

ALTER SYSTEM SET db_recovery_file_dest_size = 50G SCOPE=BOTH SID='*';

CREATE USER c##cdc IDENTIFIED BY oracle CONTAINER=all;

GRANT create session, alter session, set container, select any dictionary, logmining, execute_catalog_role TO c##cdc CONTAINER=all;



ALTER SESSION SET CONTAINER=ORCL;

GRANT select on inventory.customers TO c##cdc;

ALTER SESSION SET CONTAINER=cdb$root;

EXECUTE DBMS_LOGMNR_D.BUILD(OPTIONS=> DBMS_LOGMNR_D.STORE_IN_REDO_LOGS);

sqlplus sys/oracle@orcl as sysdba

INSERT INTO inventory.customers VALUES (1,'NN','MM','nn@te',CURRENT_TIMESTAMP);

INSERT INTO inventory.customers VALUES (2,'NN','MM','nn@te',CURRENT_TIMESTAMP);

commit;

DELETE FROM inventory.customers;

commit;

此外,它在 Java 实用程序中没有给出错误。任何人都可以帮助解决这个问题吗?

4

0 回答 0