Log Miner unable to capture data

137 Views Asked by At

I am using virtual machine in which I have pre-installed Oracle 12c with pluggable database orcl. I need to enable log miner on that oracle in order to capture changed data. I have written a Java utility which reads redo logs of oracle and creates a log miner session and captures data. It usedto capture the data, but now it is unable to capture the data. Here is the set of commands I am using to enable log miner.

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;

Also, it is giving no error in Java utility. Can anyone help in resolving this?

0

There are 0 best solutions below