Enable CDC for Oracle

Enable Oracle Logminer

As part of the CDC setup for Oracle, a user needs to enable Oracle Logminer.

Oracle Log-Miner is part of the Oracle Database. It enables querying Online and archived redo log files through a SQL interface.

Redo log files contain information about the history of activity on a database.

For setup in Gathr environment, Oracle VM Virtual Box manager is used.

# yum install VirtualBox-6.0
Please install the Linux kernel "header" files matching the current kernel for adding new hardware support to the system. The distribution packages containing the headers are probably:
# /usr/lib/virtualbox/vboxdrv.sh setup

Simply execute the following command to start it from the terminal or use the launcher from the menu to start.

# VirtualBox

Enable_CDC_for_SQL_Server_01

Enable_CDC_for_SQL_Server_02

Identify the container database and the pluggable database in your environment.

Enable_CDC_for_SQL_Server_03

Follow the below steps to configure the Logminer:

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 time-stamp);
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, logĀ¬mining, 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\_TIME-STAMP);
INSERT INTO inventory.customers VALUES (2,'NN','MM','nn@te',CURRENT\_TIME-STAMP);
commit;
DELETE FROM inventory.customers;
commit;

After completing the above steps, go to Gathr UI and configure new Oracle connection.

Enable_CDC_for_SQL_Server_04

Top