Preparing Oracle source databases
Configuring Oracle for EDB Data Migration Services (EDB DMS) requires sysdba
privileges.
Configure an Oracle source database to:
- Enable archive log mode.
- Enable supplemental logging for the database and table columns of interest.
- Ensure adequate redo log space is available.
- Create a user with limited privileges to carry out the data migration.
Execute SQL statements with sqlplus
or a similar client.
This command propmpts you for the password for <ORA_USER>
:
Where:
<ORA_HOST>
is the Oracle DB hostname.<ORA_PORT>
is the Oracle DB port.<ORA_SID>
is the Oracle System ID for the DB or CDB/PDB combination.<ORA_USER>
is an Oracle DB username with sysdba privileges.
Oracle configuration
To perform Oracle configuration:
- Enable archive log mode.
- Enable database supplemental logging.
- Enable supplemental logging for table columns.
- Verify redo logs for adequate count and size.
- Create a user with limited privileges for data migration.
- Grant
SELECT
on source tables. - Validate configuration.
Enable archive log mode
Oracle databases can operate in ARCHIVELOG
or NOARCHIVELOG
mode. In ARCHIVELOG
mode, filled redo logs are archived rather than put back into log rotation to be overwritten. This mode is needed for the change data capture (CDC) process to use LogMiner and produce a complete history of changes after an initial consistent snapshot.
To see the database mode:
The returned content indicates the database mode:
If ARCHIVELOG
mode is enabled, confirm with your DBA that the size of your recovery file destination is appropriate for your workload.
When enabling archive log mode, you need to enable a fast recovery area. For more information on enabling an Oracle fast recovery area, see Enabling the Fast Recovery Area in the Oracle documentation.
To enable archive logging:
Where:
<YOUR_SID>
is the Oracle DB system ID.<SYSDBA_USER>
is the name of a user with sysdba privileges.<SYSDBA_USER_PWD>
is the password for<SYSDBA_USER>
.<RECOVERY_FILE_DEST_SIZE>
is the size allowed for the recovery behavior, for example,100G
for 100 gigabytes.<RECOVERY_FILE_DEST>
is the file system path for an Oracle fast recovery area. This path can be a directory, file system, or Oracle Automatic Storage Management. Consult your DBA for guidance.
The archive log list
output shows the database is now in archive log mode.
Enable database supplemental logging
Supplemental logging refers to the capture of additional information in Oracle redo logs, such as "before" state. This extra redo log information is needed for some log-based applications, such as EDB DMS, to capture change events. See Supplemental Logging in the Oracle documentation for more information.
You can enable supplemental logging at the database and table level. The following command enables minimal supplemental logging required for LogMiner to function at the database level:
Enable supplemental logging for table columns
For every table you want to migrate, you must enable supplemental logging. To do so for all columns in a table, apply the following statement:
Where <TABLE>
is the identifier for the table to migrate.
Use ALTER
with all table columns you want to migrate.
Verify redo logs for adequate count and size
The migration process involves two phases. The first is a consistent snapshot. The second is continuous streaming of database changes. This stream of database changes is powered by LogMiner and the Oracle DB redo logs.
Database changes have a limited lifetime on the redo logs before the change is no longer present in the log history. This lifetime depends on the size of the redo logs, the number of redo logs, and the change throughput to the database. Also, undersized logs cause frequent log switching and affect migration performance.
To examine the state of the database redo logs:
This example uses three log groups of size 2000MB. Each group has one file member. This might be too small for many production databases. You can safely adjust the redo logs with synchronous commands such as the following:
These commands result in four new 8GB log groups. Each group has a single log file.
Consult your DBA for appropriate production sizing.
Create a user with limited privileges for data migration
Tablespace preparation
Provide a database user with adequate roles to carry out the CDC process.
Then, we recommend creating a tablespace for the CDC user. For container databases, you need to create a pluggable database as well.
This example creates a tablespace and datafiles for CDC migration. Your database settings might vary, but a common configuration with SMALLFILE
tablespaces and an 8kB database block size results in a maximum of 32GB of storage avaiable per MAXSIZE
tablespace datafile. Therefore, you might need to add multiple AUTOEXTEND
datafiles when this limit might be exceeded.
Where:
<TABLESPACE_NAME>
is the tablespace name for the CDC migration user to use.
User creation and access grants
With the tablespace files in place, you can create a user with appropriate access grants for CDC migration.
For a CDB/PDB database setup, note the tablespace default and quota:
For a non-CDB database:
Where:
<MIGRATION_USER>
is the name of the user to create for CDC migration table access.<MIGRATION_USER_PASSWORD>
is the password for the migration user.<TABLESPACE_NAME>
is the tablespace for<MIGRATION_USER>
.
Grant SELECT
on source tables
The new <MIGRATION_USER>
needs SELECT
access to source tables. Oracle doesn't support
granting access to an entire schema, so you need to do this for each table.
Where:
<MIGRATION_USER>
is the name of the user to create for CDC migration table access.<TABLE_NAME>
is the name of an individual table to migrate.
Validate configuration
The EDB DMS Reader installation (packaged as cdcreader
) comes with a helper script that validates the Oracle configuration and helps you identify any issues. After you configure the database, we recommend running the script to ensure all checks pass.
Run the script without arguments to print the usage:
SSL configuration
Ensure you configure your source database server to accept SSL connections to allow the EDB DMS Reader to connect to it. You must create a server certificate and a server private key, for example, with OpenSSL, to enable this configuration.
More information
Your database is ready for CDC migration.
For more information, see the Debezium Oracle Connector documentation.
Could this page be better? Report a problem or suggest an addition!