Oracle Database Prerequisites

This page includes the prerequisite Oracle database configuration steps and post-configuration validation steps.

Configure database user privileges

The connector requires a database user with role privileges to use LogMiner and to select from all tables captured by the connector. For this reason, you may need to create a new database user for the connector. Note the following:

  • Create a local user for a non-container database. The username must not start with c## or C##.
  • Create a common user for a multitenant database. The username must start with c## or C##.

Non-container database

To set up a new user with the correct database privileges, log in as SYSDBA and enter the following commands to create a role for the user with the required privileges. You can use any preferred name for the role. Note that CDC_PRIVS is the role name used in the following steps:

  1. As SYSDBA, enter the following SQL commands to create the role and grant privileges to the role.

    CREATE ROLE CDC_PRIVS;
    GRANT CREATE SESSION TO CDC_PRIVS;
    GRANT EXECUTE ON SYS.DBMS_LOGMNR TO CDC_PRIVS;
    GRANT LOGMINING TO CDC_PRIVS;
    GRANT SELECT ON V_$LOGMNR_CONTENTS TO CDC_PRIVS;
    GRANT SELECT ON V_$DATABASE TO CDC_PRIVS;
    GRANT SELECT ON V_$THREAD TO CDC_PRIVS;
    GRANT SELECT ON V_$PARAMETER TO CDC_PRIVS;
    GRANT SELECT ON V_$NLS_PARAMETERS TO CDC_PRIVS;
    GRANT SELECT ON V_$TIMEZONE_NAMES TO CDC_PRIVS;
    GRANT SELECT ON ALL_INDEXES TO CDC_PRIVS;
    GRANT SELECT ON ALL_OBJECTS TO CDC_PRIVS;
    GRANT SELECT ON ALL_USERS TO CDC_PRIVS;
    GRANT SELECT ON ALL_CATALOG TO CDC_PRIVS;
    GRANT SELECT ON ALL_CONSTRAINTS TO CDC_PRIVS;
    GRANT SELECT ON ALL_CONS_COLUMNS TO CDC_PRIVS;
    GRANT SELECT ON ALL_TAB_COLS TO CDC_PRIVS;
    GRANT SELECT ON ALL_IND_COLUMNS TO CDC_PRIVS;
    GRANT SELECT ON ALL_ENCRYPTED_COLUMNS TO CDC_PRIVS;
    GRANT SELECT ON ALL_LOG_GROUPS TO CDC_PRIVS;
    GRANT SELECT ON ALL_TAB_PARTITIONS TO CDC_PRIVS;
    GRANT SELECT ON SYS.DBA_REGISTRY TO CDC_PRIVS;
    GRANT SELECT ON SYS.OBJ$ TO CDC_PRIVS;
    GRANT SELECT ON DBA_TABLESPACES TO CDC_PRIVS;
    GRANT SELECT ON DBA_OBJECTS TO CDC_PRIVS;
    GRANT SELECT ON SYS.ENC$ TO CDC_PRIVS;
    GRANT SELECT ON <schema>.<table> TO CDC_PRIVS;
    
    -- The following privileges are required additionally for 19c compared to 12c.
    GRANT SELECT ON V_$ARCHIVED_LOG TO CDC_PRIVS;
    GRANT SELECT ON V_$LOG TO CDC_PRIVS;
    GRANT SELECT ON V_$LOGFILE TO CDC_PRIVS;
    GRANT SELECT ON V_$INSTANCE to CDC_PRIVS;
    

    If using a Database Vault, enter the following commands:

    GRANT EXECUTE ON SYS.DBMS_LOGMNR TO CDC_PRIVS;
    GRANT EXECUTE ON SYS.DBMS_LOGMNR_D TO CDC_PRIVS;
    GRANT EXECUTE ON SYS.DBMS_LOGMNR_LOGREP_DICT TO CDC_PRIVS;
    GRANT EXECUTE ON SYS.DBMS_LOGMNR_SESSION TO CDC_PRIVS;
    
  2. Create a username and password, and grant privileges for the user (you may use any username and password):

    CREATE USER MYUSER IDENTIFIED BY password DEFAULT TABLESPACE USERS;
    ALTER USER MYUSER QUOTA UNLIMITED ON USERS;
    GRANT SELECT ON <schema>.<table> TO CDC_PRIVS;
    
    GRANT CDC_PRIVS to MYUSER;
    

Multitenant database (CDB)

To set up a new user with the correct database privileges, log in as SYSDBA and enter the following commands to create a role for the user with the required privileges. You can use any preferred name for the role. Note that C##CDC_PRIVS is the role name used in the following example steps.

  1. As SYSDBA, enter the following SQL commands to create the role and grant privileges to the role.

    CREATE ROLE C##CDC_PRIVS;
    GRANT CREATE SESSION TO C##CDC_PRIVS;
    GRANT EXECUTE ON SYS.DBMS_LOGMNR TO C##CDC_PRIVS;
    GRANT LOGMINING TO C##CDC_PRIVS;
    GRANT SELECT ON V_$LOGMNR_CONTENTS TO C##CDC_PRIVS;
    GRANT SELECT ON V_$DATABASE TO C##CDC_PRIVS;
    GRANT SELECT ON V_$THREAD TO C##CDC_PRIVS;
    GRANT SELECT ON V_$PARAMETER TO C##CDC_PRIVS;
    GRANT SELECT ON V_$NLS_PARAMETERS TO C##CDC_PRIVS;
    GRANT SELECT ON V_$TIMEZONE_NAMES TO C##CDC_PRIVS;
    GRANT SELECT ON ALL_INDEXES TO C##CDC_PRIVS;
    GRANT SELECT ON ALL_OBJECTS TO C##CDC_PRIVS;
    GRANT SELECT ON ALL_USERS TO C##CDC_PRIVS;
    GRANT SELECT ON ALL_CATALOG TO C##CDC_PRIVS;
    GRANT SELECT ON ALL_CONSTRAINTS TO C##CDC_PRIVS;
    GRANT SELECT ON ALL_CONS_COLUMNS TO C##CDC_PRIVS;
    GRANT SELECT ON ALL_TAB_COLS TO C##CDC_PRIVS;
    GRANT SELECT ON ALL_IND_COLUMNS TO C##CDC_PRIVS;
    GRANT SELECT ON ALL_ENCRYPTED_COLUMNS TO C##CDC_PRIVS;
    GRANT SELECT ON ALL_LOG_GROUPS TO C##CDC_PRIVS;
    GRANT SELECT ON ALL_TAB_PARTITIONS TO C##CDC_PRIVS;
    GRANT SELECT ON SYS.DBA_REGISTRY TO C##CDC_PRIVS;
    GRANT SELECT ON SYS.OBJ$ TO C##CDC_PRIVS;
    GRANT SELECT ON DBA_TABLESPACES TO C##CDC_PRIVS;
    GRANT SELECT ON DBA_OBJECTS TO C##CDC_PRIVS;
    GRANT SELECT ON SYS.ENC$ TO C##CDC_PRIVS;
    GRANT SELECT ON <schema>.<table> TO C##CDC_PRIVS;
    
    -- The following privileges are required additionally for 19c compared to 12c.
    GRANT SELECT ON V_$ARCHIVED_LOG TO C##CDC_PRIVS;
    GRANT SELECT ON V_$LOG TO C##CDC_PRIVS;
    GRANT SELECT ON V_$LOGFILE TO C##CDC_PRIVS;
    GRANT SELECT ON V_$INSTANCE to C##CDC_PRIVS;
    

    If using a Database Vault, enter the following commands:

    GRANT EXECUTE ON SYS.DBMS_LOGMNR TO C##CDC_PRIVS;
    GRANT EXECUTE ON SYS.DBMS_LOGMNR_D TO C##CDC_PRIVS;
    GRANT EXECUTE ON SYS.DBMS_LOGMNR_LOGREP_DICT TO C##CDC_PRIVS;
    GRANT EXECUTE ON SYS.DBMS_LOGMNR_SESSION TO C##CDC_PRIVS;
    
  2. Create a username, password, and grant privileges for the user. You can use any username and password.

    CREATE USER C##MYUSER IDENTIFIED BY password DEFAULT TABLESPACE USERS;
    ALTER USER C##MYUSER QUOTA UNLIMITED ON USERS;
    GRANT SELECT ON <schema>.<table> TO C##CDC_PRIVS;
    
    GRANT C##CDC_PRIVS to C##MYUSER;
    

Important

When you configure the connector, use this user account for the JDBC credentials. Use the entire user name, including the c##, as the JDBC user name.

Multitenant database (PDB)

To set up a common user with the correct database privileges, log in as SYSDBA and enter the following SQL commands to create a role for the user with the required privileges (you can use any preferred name for the role):

Note

Common user accounts are created in cdb$root and must use the convention: c##<name> or C##<name>. The user C##MYUSER and the role C##CDC_PRIVS are used in the following example.

ALTER SESSION SET CONTAINER=CDB$ROOT;
CREATE ROLE C##CDC_PRIVS;
CREATE USER C##MYUSER IDENTIFIED BY password CONTAINER=ALL;
ALTER USER C##MYUSER QUOTA UNLIMITED ON USERS;
ALTER USER C##MYUSER SET CONTAINER_DATA = (CDB$ROOT, <pdb-name>) CONTAINER=CURRENT;
GRANT C##CDC_PRIVS to C##MYUSER CONTAINER=ALL;

GRANT CREATE SESSION TO C##CDC_PRIVS CONTAINER=ALL;
GRANT EXECUTE ON SYS.DBMS_LOGMNR TO C##CDC_PRIVS CONTAINER=ALL;
GRANT LOGMINING TO C##CDC_PRIVS CONTAINER=ALL;
GRANT SELECT ON V_$LOGMNR_CONTENTS TO C##CDC_PRIVS CONTAINER=ALL;
GRANT SELECT ON V_$DATABASE TO C##CDC_PRIVS CONTAINER=ALL;
GRANT SELECT ON V_$THREAD TO C##CDC_PRIVS CONTAINER=ALL;
GRANT SELECT ON V_$PARAMETER TO C##CDC_PRIVS CONTAINER=ALL;
GRANT SELECT ON V_$NLS_PARAMETERS TO C##CDC_PRIVS CONTAINER=ALL;
GRANT SELECT ON V_$TIMEZONE_NAMES TO C##CDC_PRIVS CONTAINER=ALL;
GRANT SELECT ON ALL_INDEXES TO C##CDC_PRIVS CONTAINER=ALL;
GRANT SELECT ON ALL_OBJECTS TO C##CDC_PRIVS CONTAINER=ALL;
GRANT SELECT ON ALL_USERS TO C##CDC_PRIVS CONTAINER=ALL;
GRANT SELECT ON ALL_CATALOG TO C##CDC_PRIVS CONTAINER=ALL;
GRANT SELECT ON ALL_CONSTRAINTS TO C##CDC_PRIVS CONTAINER=ALL;
GRANT SELECT ON ALL_CONS_COLUMNS TO C##CDC_PRIVS CONTAINER=ALL;
GRANT SELECT ON ALL_TAB_COLS TO C##CDC_PRIVS CONTAINER=ALL;
GRANT SELECT ON ALL_IND_COLUMNS TO C##CDC_PRIVS CONTAINER=ALL;
GRANT SELECT ON ALL_ENCRYPTED_COLUMNS TO C##CDC_PRIVS CONTAINER=ALL;
GRANT SELECT ON ALL_LOG_GROUPS TO C##CDC_PRIVS CONTAINER=ALL;
GRANT SELECT ON ALL_TAB_PARTITIONS TO C##CDC_PRIVS CONTAINER=ALL;
GRANT SELECT ON SYS.DBA_REGISTRY TO C##CDC_PRIVS CONTAINER=ALL;
GRANT SELECT ON SYS.OBJ$ TO C##CDC_PRIVS CONTAINER=ALL;
GRANT SELECT ON DBA_TABLESPACES TO C##CDC_PRIVS CONTAINER=ALL;
GRANT SELECT ON DBA_OBJECTS TO C##CDC_PRIVS CONTAINER=ALL;
GRANT SELECT ON SYS.ENC$ TO C##CDC_PRIVS CONTAINER=ALL;
GRANT CONNECT TO C##CDC_PRIVS CONTAINER=ALL;
GRANT SELECT ON DBA_PDBS TO C##CDC_PRIVS CONTAINER=ALL;
GRANT SELECT ON CDB_TABLES TO C##CDC_PRIVS CONTAINER=ALL;

ALTER SESSION SET CONTAINER=<pdb-name>;
GRANT SELECT ON <schema>.<table> TO C##CDC_PRIVS;

ALTER SESSION SET CONTAINER=CDB$ROOT;
-- The following privileges are required additionally for 19c compared to 12c.
GRANT SELECT ON V_$ARCHIVED_LOG TO C##CDC_PRIVS CONTAINER=ALL;
GRANT SELECT ON V_$LOG TO C##CDC_PRIVS CONTAINER=ALL;
GRANT SELECT ON V_$LOGFILE TO C##CDC_PRIVS CONTAINER=ALL;
GRANT SELECT ON V_$INSTANCE to C##CDC_PRIVS CONTAINER=ALL;

Important

When you configure the connector, use this user account for the JDBC credentials. Use the entire user name, including the c##, as the JDBC user name.

Amazon RDS

Important

The Oracle CDC Source connector does not work with an Oracle read-only replica for Amazon RDS. The connector uses the Oracle-recommended Online Catalog, which requires the database to be open for write access. For related details, see Working with an Oracle read-only replica for Amazon RDS.

Amazon RDS doesn’t allow users to log in as SYSDBA, so it is impossible to create a role–first, you must create a user and then grant the necessary privileges by completing the following steps:

  1. Create a user by entering the following commands:

    CREATE USER DB_USER IDENTIFIED BY PASSWORD DEFAULT TABLESPACE USERS;
    ALTER USER DB_USER QUOTA UNLIMITED ON USERS;
    
    GRANT CREATE SESSION TO DB_USER;
    GRANT SELECT ON DBA_TABLESPACES TO DB_USER;
    GRANT LOGMINING TO DB_USER;
    
    GRANT SELECT ON <schema>.<table> TO DB_USER;
    
  2. Enter the following command to grant SELECT and EXECUTE permissions on SYS objects using the Amazon RDS procedure:

    exec rdsadmin.rdsadmin_util.grant_sys_object('ALL_VIEWS', 'DB_USER', 'SELECT');
    exec rdsadmin.rdsadmin_util.grant_sys_object('ALL_TAB_PARTITIONS', 'DB_USER', 'SELECT');
    exec rdsadmin.rdsadmin_util.grant_sys_object('ALL_INDEXES', 'DB_USER', 'SELECT');
    exec rdsadmin.rdsadmin_util.grant_sys_object('ALL_OBJECTS', 'DB_USER', 'SELECT');
    exec rdsadmin.rdsadmin_util.grant_sys_object('ALL_TABLES', 'DB_USER', 'SELECT');
    exec rdsadmin.rdsadmin_util.grant_sys_object('ALL_USERS', 'DB_USER', 'SELECT');
    exec rdsadmin.rdsadmin_util.grant_sys_object('ALL_CATALOG', 'DB_USER', 'SELECT');
    exec rdsadmin.rdsadmin_util.grant_sys_object('ALL_CONSTRAINTS', 'DB_USER', 'SELECT');
    exec rdsadmin.rdsadmin_util.grant_sys_object('ALL_CONS_COLUMNS', 'DB_USER', 'SELECT');
    exec rdsadmin.rdsadmin_util.grant_sys_object('ALL_TAB_COLS', 'DB_USER', 'SELECT');
    exec rdsadmin.rdsadmin_util.grant_sys_object('ALL_IND_COLUMNS', 'DB_USER', 'SELECT');
    exec rdsadmin.rdsadmin_util.grant_sys_object('ALL_LOG_GROUPS', 'DB_USER', 'SELECT');
    exec rdsadmin.rdsadmin_util.grant_sys_object('V_$ARCHIVED_LOG', 'DB_USER', 'SELECT');
    exec rdsadmin.rdsadmin_util.grant_sys_object('V_$LOG', 'DB_USER', 'SELECT');
    exec rdsadmin.rdsadmin_util.grant_sys_object('V_$LOGFILE', 'DB_USER', 'SELECT');
    exec rdsadmin.rdsadmin_util.grant_sys_object('V_$DATABASE', 'DB_USER', 'SELECT');
    exec rdsadmin.rdsadmin_util.grant_sys_object('V_$THREAD', 'DB_USER', 'SELECT');
    exec rdsadmin.rdsadmin_util.grant_sys_object('V_$PARAMETER', 'DB_USER', 'SELECT');
    exec rdsadmin.rdsadmin_util.grant_sys_object('V_$NLS_PARAMETERS', 'DB_USER', 'SELECT');
    exec rdsadmin.rdsadmin_util.grant_sys_object('V_$TIMEZONE_NAMES', 'DB_USER', 'SELECT');
    exec rdsadmin.rdsadmin_util.grant_sys_object('V_$TRANSACTION', 'DB_USER', 'SELECT');
    exec rdsadmin.rdsadmin_util.grant_sys_object('DBA_REGISTRY', 'DB_USER', 'SELECT');
    exec rdsadmin.rdsadmin_util.grant_sys_object('OBJ$', 'DB_USER', 'SELECT');
    exec rdsadmin.rdsadmin_util.grant_sys_object('ALL_ENCRYPTED_COLUMNS', 'DB_USER', 'SELECT');
    exec rdsadmin.rdsadmin_util.grant_sys_object('V_$LOGMNR_LOGS', 'DB_USER', 'SELECT');
    exec rdsadmin.rdsadmin_util.grant_sys_object('V_$LOGMNR_CONTENTS','DB_USER','SELECT');
    exec rdsadmin.rdsadmin_util.grant_sys_object('DBMS_LOGMNR', 'DB_USER', 'EXECUTE');
    
    -- The following privileges are required additionally for 19c compared to 12c
    exec rdsadmin.rdsadmin_util.grant_sys_object('DBA_TABLESPACES', 'DB_USER', 'SELECT');
    exec rdsadmin.rdsadmin_util.grant_sys_object('V_$INSTANCE', 'DB_USER', 'SELECT');
    

Turn on ARCHIVELOG mode

To extract a LogMiner dictionary to the redo log files, the database must be open and in ARCHIVELOG mode. Note that you shut down the database when completing the following steps:

Note

You can skip the following steps if ARCHIVELOG mode is already enabled for the database. ARCHIVELOG mode is enabled by default for AWS RDS Oracle instances.

  1. Connect as a user with SYSDBA privileges. Check the database ARCHIVELOG mode. If the LOG_MODE shows ARCHIVELOG, you can skip the Turn on ARCHIVELOG mode section.

    SELECT LOG_MODE FROM V$DATABASE;
    
    LOG_MODE
    ------------
    NOARCHIVELOG
    
  2. Shut down the database instance using the command SHUTDOWN IMMEDIATE.

    SHUTDOWN IMMEDIATE;
    
  3. Create a full database backup including all data and control files. You can use operating system commands or RMAN to perform this operation. This backup can be used in the future for recovery with archived redo log files created once the database is in ARCHIVELOG mode.

  4. Start the instance and mount the database using the command STARTUP MOUNT.

    STARTUP MOUNT;
    
  5. Place the database in ARCHIVELOG mode using the command ALTER DATABASE ARCHIVELOG and open the database using the command ALTER DATABASE OPEN.

    ALTER DATABASE ARCHIVELOG;
    ALTER DATABASE OPEN;
    
  6. Check the database ARCHIVELOG mode.

    SELECT LOG_MODE FROM V$DATABASE;
    
    LOG_MODE
    ------------
    ARCHIVELOG
    

Enable supplemental logging for all columns

This section includes the commands to enable supplemental logging for all columns.

Non-container and multitenant databases

Enter the following commands to specify that when a row is updated, all columns of that row (except for LOBs, LONGS, and ADTs) are placed in the redo log file ( you must have correct privileges to execute the command):

  1. Set the session container:

    ALTER SESSION SET CONTAINER=cdb$root;
    
  2. To enable full supplemental logging for all tables, enter the following commands:

    ALTER DATABASE ADD SUPPLEMENTAL LOG DATA (ALL) COLUMNS;
    

    To enable full supplemental logging for specific tables, run the following commands:

    ALTER DATABASE ADD SUPPLEMENTAL LOG DATA;
    ALTER SESSION SET CONTAINER=<pdb-name>; -- ONLY FOR PDB
    ALTER TABLE <schema name>.<table name> ADD SUPPLEMENTAL LOG DATA (ALL) COLUMNS;
    

Note

At minimum for a PDB database, minimal supplemental logging must be enabled for CDB$ROOT, then full supplemental logging can be enabled at the PDB level. Alternatively, full supplemental logging can be enabled on CDB$ROOT and applied across the CDB.

Amazon RDS Oracle 19c/12c instance

Important

The Oracle CDC Source connector does not work with an Oracle read-only replica for Amazon RDS. The connector uses the Oracle-recommended Online Catalog, which requires the database to be open for write access. For related details, see Working with an Oracle read-only replica for Amazon RDS.

Run the following exec command:

exec rdsadmin.rdsadmin_util.set_configuration('archivelog retention hours',24);

To enable full supplemental logging for all tables, run this command:

exec rdsadmin.rdsadmin_util.alter_supplemental_logging('ADD','ALL');

To enable full supplemental logging for individual tables, run these commands:

exec rdsadmin.rdsadmin_util.alter_supplemental_logging('ADD');
ALTER TABLE <table_name> ADD SUPPLEMENTAL LOG DATA (ALL) COLUMNS;

Grant the User Flashback Query Privileges

To perform snapshots on captured tables, the connector requires the user to have privileges to perform Flashback queries (that is, SELECT AS OF) on the captured tables. Enter the following command to grant the user privileges to perform Flashback queries on the database:

GRANT FLASHBACK ANY TABLE TO myuser;

To enable FLASHBACK query for specific tables:

GRANT FLASHBACK ON <schema>.<table> TO myuser;

Note

This command is not required if you want to capture the redo log (without generating change events) or generate change events starting from a known System Change Number (SCN) or timestamp using start.from.

For example, you enter the following commands to grant the example role created previously FLASHBACK privileges for a non-container database:

GRANT FLASHBACK ON <schema>.<table> TO CDC_PRIVS

For example, you enter the following commands to grant the example role created above FLASHBACK privileges for a container database or multitenant database:

ALTER SESSION SET CONTAINER=<pdb-name>;
GRANT FLASHBACK ON <schema>.<table> TO C##CDC_PRIVS

Amazon RDS for Oracle 19c/12c instance

GRANT FLASHBACK ON <schema>.<table> TO DB_USER;

Validate start-up configuration and prerequisite completion

This section includes steps to take to ensure that all prerequisites are met. The following sample values are used:

  • Role name: CDB_PRIVS and C##CDC_PRIVS
  • Usernames: MYUSER, C##MYUSER and DB_USER
  • Table name: CUSTOMERS. The CUSTOMERS table is created under one of the following schema:
    • ANOTHERUSER: for Non-container database including 11g, 12c, 18c, and 19c
    • C##ANOTHERUSER: for Container Database (CDB) and Multitenant Database (PDB) including Oracle 12c, 18c, and 19c
    • ADMIN: for Amazon RDS for Oracle

Note

Numeric values used in the following subsections may be different from the values you see when you run through the validation example.

Non-container database

  1. Log in as SYSDBA and enter the following commands:

    -- Use the following SQL statement if privileges granted to a role (``CDC_PRIVS``) and the role granted to a user (``MYUSER``).
    
    SELECT GRANTEE, OWNER, TABLE_NAME
    FROM DBA_TAB_PRIVS
    WHERE GRANTEE IN (SELECT granted_role
                      FROM DBA_ROLE_PRIVS
                      WHERE GRANTEE = 'MYUSER')
    AND (TABLE_NAME='DBMS_LOGMNR' OR TABLE_NAME='V_$LOGMNR_CONTENTS');
    
    GRANTEE           OWNER          TABLE_NAME
    -------------------------------------------
    CDC_PRIVS         SYS            DBMS_LOGMNR
    
    CDC_PRIVS         SYS            V_$LOGMNR_CONTENTS
    
    -- Use the following SQL statement if privileges granted directly to a user (``MYUSER``).
    
    SELECT GRANTEE, OWNER, TABLE_NAME
    FROM DBA_TAB_PRIVS
    WHERE GRANTEE = 'MYUSER'
    AND (TABLE_NAME='DBMS_LOGMNR' OR TABLE_NAME='V_$LOGMNR_CONTENTS');
    
    GRANTEE           OWNER          TABLE_NAME
    -------------------------------------------
    MYUSER            SYS            DBMS_LOGMNR
    
    MYUSER            SYS            V_$LOGMNR_CONTENTS
    
  2. Create check_prerequisites.sql with the following commands.

    SELECT * FROM SESSION_PRIVS;
    SELECT LOG_MODE FROM V$DATABASE;
    SELECT COUNT(*) FROM V$DATABASE;
    SELECT COUNT(*) FROM V$THREAD;
    SELECT COUNT(*) FROM V$PARAMETER;
    SELECT COUNT(*) FROM V$NLS_PARAMETERS;
    SELECT COUNT(*) FROM V$TIMEZONE_NAMES;
    SELECT COUNT(*) FROM ALL_INDEXES;
    SELECT COUNT(*) FROM ALL_OBJECTS;
    SELECT COUNT(*) FROM ALL_USERS;
    SELECT COUNT(*) FROM ALL_CATALOG;
    SELECT COUNT(*) FROM ALL_CONSTRAINTS;
    SELECT COUNT(*) FROM ALL_CONS_COLUMNS;
    SELECT COUNT(*) FROM ALL_TAB_COLS;
    SELECT COUNT(*) FROM ALL_IND_COLUMNS;
    SELECT COUNT(*) FROM ALL_ENCRYPTED_COLUMNS;
    SELECT COUNT(*) FROM ALL_LOG_GROUPS;
    SELECT COUNT(*) FROM ALL_TAB_PARTITIONS;
    SELECT COUNT(*) FROM SYS.DBA_REGISTRY;
    SELECT COUNT(*) FROM SYS.OBJ$;
    SELECT COUNT(*) FROM DBA_TABLESPACES;
    SELECT COUNT(*) FROM DBA_OBJECTS;
    SELECT COUNT(*) FROM SYS.ENC$;
    SELECT COUNT(*) FROM ANOTHERUSER.CUSTOMERS;
    -- Flashback query privilege
    SELECT COUNT(*) FROM ANOTHERUSER.CUSTOMERS AS OF TIMESTAMP SYSDATE;
    
    -- Added for 19C
    SELECT count(*) FROM V$ARCHIVED_LOG;
    SELECT count(*) FROM V$LOG;
    SELECT count(*) FROM V$LOGFILE;
    SELECT count(*) FROM V$INSTANCE;
    
  3. Log in using MYUSER (created previously) and then enter the following:

    SQL> @check_prerequisites.sql
    
    PRIVILEGE
    ----------------------------------------
    CREATE SESSION
    LOGMINING
    
    LOG_MODE
    ------------
    ARCHIVELOG
    
      COUNT(*)
    ----------
        1
    
      COUNT(*)
    ----------
        1
    
      COUNT(*)
    ----------
            344
    
      COUNT(*)
    ----------
        19
    
      COUNT(*)
    ----------
          2164
    
      COUNT(*)
    ----------
        88
    
      COUNT(*)
    ----------
          7261
    
      COUNT(*)
    ----------
        14
    
      COUNT(*)
    ----------
          5656
    
      COUNT(*)
    ----------
            197
    
      COUNT(*)
    ----------
            266
    
      COUNT(*)
    ----------
          20926
    
      COUNT(*)
    ----------
            142
    
      COUNT(*)
    ----------
        0
    
      COUNT(*)
    ----------
        2
    
      COUNT(*)
    ----------
        0
    
      COUNT(*)
    ----------
        5
    
      COUNT(*)
    ----------
          19512
    
      COUNT(*)
    ----------
        5
    
      COUNT(*)
    ----------
          18658
    
      COUNT(*)
    ----------
        0
    
      COUNT(*)
    ----------
        10
    
      COUNT(*)
    ----------
        10
    
      COUNT(*)
    ----------
        2
    
      COUNT(*)
    ----------
        3
    
      COUNT(*)
    ----------
        3
    
      COUNT(*)
    ----------
        1
    
  4. Log in using MYUSER (created previously) and then enter the following commands:

    SELECT SUPPLEMENTAL_LOG_DATA_MIN, SUPPLEMENTAL_LOG_DATA_PK, SUPPLEMENTAL_LOG_DATA_ALL FROM V$DATABASE;
    
    -- If full supplemental logging is enabled for all tables, the following is returned.
    
    SUPPLEME SUP SUP
    -------- --- ----
    YES      NO  YES
    
    
    -- If full supplemental logging is enabled for specific tables, the following is returned.
    
    SUPPLEME SUP SUP
    -------- --- ----
    YES      NO  NO
    
    
    -- If full supplemental logging is enabled for specific tables, enter the following command.
    
    SELECT * FROM ALL_LOG_GROUPS WHERE LOG_GROUP_TYPE='ALL COLUMN LOGGING' and OWNER='ANOTHERUSER' and TABLE_NAME='CUSTOMERS';
    
    OWNER          LOG_GROUP_NAME          TABLE_NAME           LOG_GROUP_TYPE          ALWAYS            GENERATED
    -------------- ----------------------- -------------------- ----------------------- ----------------- -------------------------
    ANOTHERUSER SYS_C007542             CUSTOMERS            ALL COLUMN LOGGING      ALWAYS            GENERATED NAME
    

Multitenant Database (CDB)

  1. Log in as SYSDBA and enter the following commands:

    -- Use the following SQL statement if privileges granted to a role (``C##CDC_PRIVS``) and the role granted to a user (``C##MYUSER``).
    
        SELECT GRANTEE, OWNER, TABLE_NAME
        FROM DBA_TAB_PRIVS
        WHERE GRANTEE IN (SELECT granted_role
                          FROM DBA_ROLE_PRIVS
                          WHERE GRANTEE = 'C##MYUSER')
        AND (TABLE_NAME='DBMS_LOGMNR' OR TABLE_NAME='V_$LOGMNR_CONTENTS');
    
        GRANTEE           OWNER          TABLE_NAME
        -------------------------------------------
        C##CDC_PRIVS      SYS            DBMS_LOGMNR
    
        C##CDC_PRIVS      SYS            V_$LOGMNR_CONTENTS
    
    
        -- Use the following SQL statement if privileges granted directly to a user (``C##MYUSER``).
    
        SELECT GRANTEE, OWNER, TABLE_NAME
        FROM DBA_TAB_PRIVS
        WHERE GRANTEE = 'C##MYUSER'
        AND (TABLE_NAME='DBMS_LOGMNR' OR TABLE_NAME='V_$LOGMNR_CONTENTS');
    
        GRANTEE           OWNER          TABLE_NAME
        -------------------------------------------
        C##MYUSER      SYS            DBMS_LOGMNR
    
        C##MYUSER      SYS            V_$LOGMNR_CONTENTS
    
  2. Create check_prerequisites.sql with the following commands:

    SELECT * FROM SESSION_PRIVS;
    SELECT LOG_MODE FROM V$DATABASE;
    SELECT COUNT(*) FROM V$DATABASE;
    SELECT COUNT(*) FROM V$THREAD;
    SELECT COUNT(*) FROM V$PARAMETER;
    SELECT COUNT(*) FROM V$NLS_PARAMETERS;
    SELECT COUNT(*) FROM V$TIMEZONE_NAMES;
    SELECT COUNT(*) FROM ALL_INDEXES;
    SELECT COUNT(*) FROM ALL_OBJECTS;
    SELECT COUNT(*) FROM ALL_USERS;
    SELECT COUNT(*) FROM ALL_CATALOG;
    SELECT COUNT(*) FROM ALL_CONSTRAINTS;
    SELECT COUNT(*) FROM ALL_CONS_COLUMNS;
    SELECT COUNT(*) FROM ALL_TAB_COLS;
    SELECT COUNT(*) FROM ALL_IND_COLUMNS;
    SELECT COUNT(*) FROM ALL_ENCRYPTED_COLUMNS;
    SELECT COUNT(*) FROM ALL_LOG_GROUPS;
    SELECT COUNT(*) FROM ALL_TAB_PARTITIONS;
    SELECT COUNT(*) FROM SYS.DBA_REGISTRY;
    SELECT COUNT(*) FROM SYS.OBJ$;
    SELECT COUNT(*) FROM DBA_TABLESPACES;
    SELECT COUNT(*) FROM DBA_OBJECTS;
    SELECT COUNT(*) FROM SYS.ENC$;
    SELECT COUNT(*) FROM C##ANOTHERUSER.CUSTOMERS;
    -- Flashback query privilege
    SELECT COUNT(*) FROM C##ANOTHERUSER.CUSTOMERS AS OF TIMESTAMP SYSDATE;
    
    -- Added for 19C
    SELECT count(*) FROM V$ARCHIVED_LOG;
    SELECT count(*) FROM V$LOG;
    SELECT count(*) FROM V$LOGFILE;
    SELECT count(*) FROM V$INSTANCE;
    
  3. Log in using C##MYUSER (created previously) and then enter the following:

    SQL> @check_prerequisites.sql
    
    PRIVILEGE
    ----------------------------------------
    CREATE SESSION
    LOGMINING
    
    LOG_MODE
    ------------
    ARCHIVELOG
    
      COUNT(*)
    ----------
        1
    
      COUNT(*)
    ----------
        1
    
      COUNT(*)
    ----------
          344
    
      COUNT(*)
    ----------
      19
    
      COUNT(*)
    ----------
          2164
    
      COUNT(*)
    ----------
      88
    
      COUNT(*)
    ----------
          7261
    
      COUNT(*)
    ----------
      14
    
      COUNT(*)
    ----------
          5656
    
      COUNT(*)
    ----------
          197
    
      COUNT(*)
    ----------
          266
    
      COUNT(*)
    ----------
        20926
    
      COUNT(*)
    ----------
          142
    
      COUNT(*)
    ----------
        0
    
      COUNT(*)
    ----------
        2
    
      COUNT(*)
    ----------
        0
    
      COUNT(*)
    ----------
        5
    
      COUNT(*)
    ----------
        19512
    
      COUNT(*)
    ----------
        5
    
      COUNT(*)
    ----------
        18658
    
      COUNT(*)
    ----------
        0
    
      COUNT(*)
    ----------
      10
    
      COUNT(*)
    ----------
      10
    
      COUNT(*)
    ----------
      2
    
      COUNT(*)
    ----------
      3
    
      COUNT(*)
    ----------
      3
    
      COUNT(*)
    ----------
      1
    
  4. Log in using C##MYUSER (created previously) and then enter the following commands:

    SELECT SUPPLEMENTAL_LOG_DATA_MIN, SUPPLEMENTAL_LOG_DATA_PK, SUPPLEMENTAL_LOG_DATA_ALL FROM V$DATABASE;
    
    -- If full supplemental logging is enabled for all tables, the following is returned.
    
    SUPPLEME SUP SUP
    -------- --- ----
    YES      NO  YES
    
    
    -- If full supplemental logging is enabled for specific tables, the following is returned.
    
    SUPPLEME SUP SUP
    -------- --- ----
    YES      NO  NO
    
    
    -- If full supplemental logging is enabled for specific tables, enter the following command.
    
    SELECT * FROM ALL_LOG_GROUPS WHERE LOG_GROUP_TYPE='ALL COLUMN LOGGING' and OWNER='C##ANOTHERUSER' and TABLE_NAME='CUSTOMERS';
    
    OWNER          LOG_GROUP_NAME          TABLE_NAME           LOG_GROUP_TYPE          ALWAYS            GENERATED
    -------------- ----------------------- -------------------- ----------------------- ----------------- -------------------------
    C##ANOTHERUSER SYS_C007542             CUSTOMERS            ALL COLUMN LOGGING      ALWAYS            GENERATED NAME
    

Multitenant database (PDB)

  1. Log in as SYSDBA and enter the following commands:

    ALTER SESSION SET CONTAINER=CDB$ROOT;
    
    -- Use the following SQL statement if privileges granted to a role (``C##CDC_PRIVS``) and the role granted to a user (``C##MYUSER``).
    
    SELECT GRANTEE, OWNER, TABLE_NAME
    FROM DBA_TAB_PRIVS
    WHERE GRANTEE IN (SELECT granted_role
                      FROM DBA_ROLE_PRIVS
                      WHERE GRANTEE = 'C##MYUSER')
    AND (TABLE_NAME='DBMS_LOGMNR' OR TABLE_NAME='V_$LOGMNR_CONTENTS');
    
    GRANTEE           OWNER          TABLE_NAME
    -------------------------------------------
    C##CDC_PRIVS      SYS            DBMS_LOGMNR
    
    C##CDC_PRIVS      SYS            V_$LOGMNR_CONTENTS
    
    -- Use the following SQL statement if privileges granted directly to a user (``C##MYUSER``).
    
    SELECT GRANTEE, OWNER, TABLE_NAME
    FROM DBA_TAB_PRIVS
    WHERE GRANTEE = 'C##MYUSER'
    AND (TABLE_NAME='DBMS_LOGMNR' OR TABLE_NAME='V_$LOGMNR_CONTENTS');
    
    GRANTEE           OWNER          TABLE_NAME
    -------------------------------------------
    C##MYUSER      SYS            DBMS_LOGMNR
    
    C##MYUSER      SYS            V_$LOGMNR_CONTENTS
    
  2. Create check_prerequisites.sql with the following commands.

    ALTER SESSION SET CONTAINER=CDB$ROOT;
    SELECT * FROM SESSION_PRIVS;
    SELECT LOG_MODE FROM V$DATABASE;
    SELECT COUNT(*) FROM V$DATABASE;
    SELECT COUNT(*) FROM V$THREAD;
    SELECT COUNT(*) FROM V$PARAMETER;
    SELECT COUNT(*) FROM V$NLS_PARAMETERS;
    SELECT COUNT(*) FROM V$TIMEZONE_NAMES;
    SELECT COUNT(*) FROM ALL_INDEXES;
    SELECT COUNT(*) FROM ALL_OBJECTS;
    SELECT COUNT(*) FROM ALL_USERS;
    SELECT COUNT(*) FROM ALL_CATALOG;
    SELECT COUNT(*) FROM ALL_CONSTRAINTS;
    SELECT COUNT(*) FROM ALL_CONS_COLUMNS;
    SELECT COUNT(*) FROM ALL_TAB_COLS;
    SELECT COUNT(*) FROM ALL_IND_COLUMNS;
    SELECT COUNT(*) FROM ALL_ENCRYPTED_COLUMNS;
    SELECT COUNT(*) FROM ALL_LOG_GROUPS;
    SELECT COUNT(*) FROM ALL_TAB_PARTITIONS;
    SELECT COUNT(*) FROM SYS.DBA_REGISTRY;
    SELECT COUNT(*) FROM SYS.OBJ$;
    SELECT COUNT(*) FROM DBA_TABLESPACES;
    SELECT COUNT(*) FROM DBA_OBJECTS;
    SELECT COUNT(*) FROM SYS.ENC$;
    SELECT COUNT(*) FROM DBA_PDBS;
    SELECT COUNT(*) FROM CDB_TABLES;
    
    ALTER SESSION SET CONTAINER=<pdb-name>;
    SELECT COUNT(*) FROM C##ANOTHERUSER.CUSTOMERS;
    -- Flashback query privilege
    SELECT COUNT(*) FROM C##ANOTHERUSER.CUSTOMERS AS OF TIMESTAMP SYSDATE;
    
    -- Added for 19C
    SELECT count(*) FROM V$ARCHIVED_LOG;
    SELECT count(*) FROM V$LOG;
    SELECT count(*) FROM V$LOGFILE;
    SELECT count(*) FROM V$INSTANCE
    
  3. Log in using C##MYUSER (created previously) and then enter the following:

    SQL> @check_prerequisites.sql
    
    SQL> @check_prerequisites.sql
    
    Session altered.
    
    PRIVILEGE
    ----------------------------------------
    CREATE SESSION
    LOGMINING
    SET CONTAINER
    
    LOG_MODE
    ------------
    ARCHIVELOG
    
    
      COUNT(*)
    ----------
        1
    
      COUNT(*)
    ----------
        1
    
      COUNT(*)
    ----------
            344
    
      COUNT(*)
    ----------
        19
    
      COUNT(*)
    ----------
          2164
    
      COUNT(*)
    ----------
        88
    
      COUNT(*)
    ----------
          7261
    
      COUNT(*)
    ----------
        14
    
      COUNT(*)
    ----------
          5656
    
      COUNT(*)
    ----------
            197
    
      COUNT(*)
    ----------
            266
    
      COUNT(*)
    ----------
          20926
    
      COUNT(*)
    ----------
            142
    
      COUNT(*)
    ----------
        0
    
      COUNT(*)
    ----------
        2
    
      COUNT(*)
    ----------
        0
    
      COUNT(*)
    ----------
        5
    
      COUNT(*)
    ----------
          19512
    
      COUNT(*)
    ----------
        5
    
      COUNT(*)
    ----------
          18658
    
      COUNT(*)
    ----------
        0
    
      COUNT(*)
    ----------
              1
    
      COUNT(*)
    ----------
          4213
    
    Session altered.
    
      COUNT(*)
    ----------
              15
    
      COUNT(*)
    ----------
        15
    
      COUNT(*)
    ----------
        0
    
      COUNT(*)
    ----------
        3
    
      COUNT(*)
    ----------
        3
    
      COUNT(*)
    ----------
        1
    
  4. Log in using C##MYUSER (created previously) and then enter the following commands:

    SELECT SUPPLEMENTAL_LOG_DATA_MIN, SUPPLEMENTAL_LOG_DATA_PK, SUPPLEMENTAL_LOG_DATA_ALL FROM V$DATABASE;
    
    -- If full supplemental logging is enabled for all tables, the following is returned.
    
    SUPPLEME SUP SUP
    -------- --- ----
    YES      NO  YES
    
    -- If full supplemental logging is enabled for specific tables, the following is returned.
    
    SUPPLEME SUP SUP
    -------- --- ----
    YES      NO  NO
    
    -- If full supplemental logging is enabled for specific tables, enter the following command.
    ALTER SESSION SET CONTAINER=ORCLPDB1;
    SELECT * FROM ALL_LOG_GROUPS WHERE LOG_GROUP_TYPE='ALL COLUMN LOGGING' and OWNER='C##ANOTHERUSER' and TABLE_NAME='CUSTOMERS';
    
    OWNER          LOG_GROUP_NAME          TABLE_NAME           LOG_GROUP_TYPE          ALWAYS            GENERATED
    -------------- ----------------------- -------------------- ----------------------- ----------------- -------------------------
    C##ANOTHERUSER SYS_C007542             CUSTOMERS            ALL COLUMN LOGGING      ALWAYS            GENERATED NAME
    

Amazon RDS

  1. Log in as ADMIN and enter the following:

    -- Use the following SQL statement if privileges granted directly to a user (``DB_USER``).
    
    SELECT GRANTEE, OWNER, TABLE_NAME
    FROM DBA_TAB_PRIVS
    WHERE GRANTEE = 'DB_USER'
    AND (TABLE_NAME='DBMS_LOGMNR' OR TABLE_NAME='V_$LOGMNR_CONTENTS' OR TABLE_NAME='OBJ$');
    
    GRANTEE           OWNER          TABLE_NAME
    -------------------------------------------
    DB_USER          SYS            DBMS_LOGMNR
    
    DB_USER          SYS            V_$LOGMNR_CONTENTS
    
    DB_USER          SYS            OBJ$
    
  2. Create check_prerequisites.sql with the following commands:

    SELECT COUNT(*) FROM DBA_TABLESPACES;
    SELECT * FROM SESSION_PRIVS;
    SELECT LOG_MODE FROM V$DATABASE;
    SELECT COUNT(*) FROM ALL_VIEWS;
    SELECT COUNT(*) FROM ALL_TAB_PARTITIONS;
    SELECT COUNT(*) FROM ALL_INDEXES;
    SELECT COUNT(*) FROM ALL_OBJECTS;
    SELECT COUNT(*) FROM ALL_TABLES;
    SELECT COUNT(*) FROM ALL_USERS;
    SELECT COUNT(*) FROM ALL_CATALOG;
    SELECT COUNT(*) FROM ALL_CONSTRAINTS;
    SELECT COUNT(*) FROM ALL_CONS_COLUMNS;
    SELECT COUNT(*) FROM ALL_TAB_COLS;
    SELECT COUNT(*) FROM ALL_IND_COLUMNS;
    SELECT COUNT(*) FROM ALL_LOG_GROUPS;
    SELECT COUNT(*) FROM V$ARCHIVED_LOG;
    SELECT COUNT(*) FROM V$LOG;
    SELECT COUNT(*) FROM V$LOGFILE;
    SELECT COUNT(*) FROM V$DATABASE;
    SELECT COUNT(*) FROM V$THREAD;
    SELECT COUNT(*) FROM V$PARAMETER;
    SELECT COUNT(*) FROM V$NLS_PARAMETERS;
    SELECT COUNT(*) FROM V$TIMEZONE_NAMES;
    SELECT COUNT(*) FROM V$TRANSACTION;
    SELECT COUNT(*) FROM SYS.DBA_REGISTRY;
    SELECT COUNT(*) FROM ALL_ENCRYPTED_COLUMNS;
    SELECT COUNT(*) FROM V$LOGMNR_LOGS;
    SELECT COUNT(*) FROM ADMIN.CUSTOMERS;
    -- Flashback query privilege
    SELECT COUNT(*) FROM ADMIN.CUSTOMERS AS OF TIMESTAMP SYSDATE;
    SELECT count(*) FROM V$INSTANCE;
    
  3. Log in using DB_USER (created previously) and then enter the following:

    SQL> @check_prerequisites.sql
    
      COUNT(*)
    ----------
      6
    
    
    PRIVILEGE
    ----------------------------------------
    LOGMINING
    CREATE SESSION
    
    LOG_MODE
    ------------
    ARCHIVELOG
    
      COUNT(*)
    ----------
          1765
    
    
      COUNT(*)
    ----------
      0
    
    
      COUNT(*)
    ----------
      57
    
    
      COUNT(*)
    ----------
          9368
    
    
      COUNT(*)
    ----------
      53
    
    
      COUNT(*)
    ----------
      25
    
    
      COUNT(*)
    ----------
          7700
    
    
      COUNT(*)
    ----------
      80
    
    
      COUNT(*)
    ----------
      73
    
    
      COUNT(*)
    ----------
        22606
    
    
      COUNT(*)
    ----------
          101
    
    
      COUNT(*)
    ----------
      1
    
    
      COUNT(*)
    ----------
      57
    
    
      COUNT(*)
    ----------
      4
    
    
      COUNT(*)
    ----------
      4
    
    
      COUNT(*)
    ----------
      1
    
    
      COUNT(*)
    ----------
      1
    
    
      COUNT(*)
    ----------
          420
    
    
      COUNT(*)
    ----------
      19
    
    
      COUNT(*)
    ----------
          2408
    
    
      COUNT(*)
    ----------
      0
    
    
      COUNT(*)
    ----------
      4
    
    
      COUNT(*)
    ----------
      0
    
    
      COUNT(*)
    ----------
      0
    
    
      COUNT(*)
    ----------
      8
    
    
      COUNT(*)
    ----------
      8
    
    
      COUNT(*)
    ----------
        1
    
  4. Log in using DB_USER (created previously) and then enter the following commands:

    SELECT SUPPLEMENTAL_LOG_DATA_MIN, SUPPLEMENTAL_LOG_DATA_PK, SUPPLEMENTAL_LOG_DATA_ALL FROM V$DATABASE;
    
    -- If full supplemental logging is enabled for all tables, the following is returned.
    
    SUPPLEME SUP SUP
    -------- --- ----
    YES NO  YES
    
    
    -- If full supplemental logging is enabled for specific tables, the following is returned.
    
    SUPPLEME SUP SUP
    -------- --- ----
    YES      NO  NO
    
    
    -- If full supplemental logging is enabled for specific tables, enter the following command.
    
    SELECT * FROM ALL_LOG_GROUPS WHERE LOG_GROUP_TYPE='ALL COLUMN LOGGING' and OWNER='ADMIN' and TABLE_NAME='CUSTOMERS';
    
    OWNER          LOG_GROUP_NAME          TABLE_NAME           LOG_GROUP_TYPE          ALWAYS            GENERATED
    -------------- ----------------------- -------------------- ----------------------- ----------------- -------------------------
    ADMIN          SYS_C006989             CUSTOMERS            ALL COLUMN LOGGING      ALWAYS            GENERATED NAME