Background information
obcdc has supported synchronizing data only from the primary database. However, some customers need to consume data from a standby database by using obcdc for the following reasons:
Consumption of local data: The applications that consume obcdc data are deployed remotely from the primary database site, and business priorities require consuming incremental transaction data from the local standby database.
Data consumption after a primary/standby switchover: obcdc can synchronize data only from the primary database, and one obcdc instance can synchronize data from only one cluster. If the primary and standby databases are not in the same cluster and a switchover occurs, the data link is interrupted.
Reduced impact on the primary database: Although running obcdc has little impact on the primary database, some customers still prefer to synchronize data from a standby database to reduce the potential impact on the primary database.
To address these issues, obcdc allows you to directly consume data from a standby database.
Features
In online mode, you must configure tb_white_list by adding the current name of the tenant to be synchronized to the synchronization allowlist. This restriction does not apply in offline mode (where meta_data_refresh_mode=data_dict and archive metadata such as archive_dest are configured).
Start timestamp limitations:
At startup, the source tenant of obcdc must be in the
NORMALstate.The source tenant must also be in the
NORMALstate at the start timestamp.A start timestamp that is less than or equal to the tenant's
RESTORE_SCN(a user-specified restore timestamp, which can be queried in the CDB_OB_RESTORE_HISTORY view from the sys tenant) is not supported.A start timestamp greater than
RECOVERY_UNTIL_SCN(the maximum restore timestamp of the current tenant, which can be queried in the DBA_OB_TENANTS view) is not supported.If the start timestamp is greater than the tenant's
REPLAYABLE_SCN(the latest replayable snapshot version of the current tenant, which can be queried in the DBA_OB_TENANTS view), obcdc retries until the tenant'sREPLAYABLE_SCNis greater than the start timestamp before it can start successfully. If the retry times out, the process exits.If the start timestamp is greater than
READABLE_SCN(the earliest readable snapshot version of the current tenant, which can be queried in the DBA_OB_TENANTS view), obcdc retries until the tenant'sREADABLE_SCNis greater than the start timestamp before it can start successfully. If the retry times out, the process exits.In data dictionary mode, obcdc obtains the generation time of the latest baseline (
SNAPSHOT_SCN, which can be queried in the CDB_OB_DATA_DICTIONARY_IN_LOG view from the sys tenant or in the DBA_OB_DATA_DICTIONARY_IN_LOG view in a user tenant). The obtainedSNAPSHOT_SCNmust also comply with all the preceding start timestamp constraints; otherwise, the process exits.If the start timestamp falls in the middle of a transaction, obcdc must pull all clog logs of that transaction before the start timestamp. The earliest clog log of the transaction must also meet all the preceding constraints.
FAQ
This section describes common questions about the standby database synchronization feature of obcdc. General obcdc issues are not covered here.
obcdc fails to start and exits the process
Key symptoms:
The obcdc process exits, and the critical startup log
init obcdc succcannot be found in the obcdc logs if they have not been recycled.Any of the following critical logs exists:
The critical log
[ADD_TENANT][FAIL][clog_NOT_SERVE], indicating that clog logs are not served at the start timestamp.The critical log
[ADD_TENANT][FAIL][NOT_READABLE], indicating that the start timestamp is unreadable.The critical log
[ADD_TENANT][DATA_DICT][REFRESH_BASELINE][FAIL][clog_NOT_SERVE][LOG_AT_DICT_SNAPSHOT], indicating that theSNAPSHOT_SCNof the data dictionary is not within the service scope.
Cause: The start timestamp of obcdc does not meet the constraints described in the Features section.
Solution: Adjust the start timestamp to comply with the constraints, or synchronize data from the primary database instead.
obcdc starts successfully but exits the process after running for a while
Key symptoms:
obcdc is initialized successfully. This is indicated by the critical startup log
init obcdc succstill being present in the obcdc logs, or by the periodicHEARTBEATkeyword logs in theTLOG.COMMITTERmodule.The
[MISS_LOG][HANDLE_DONE]log exists, and the subsequentretis notOB_SUCCESS.
Cause: The start timestamp falls in the middle of a long-running transaction. obcdc must pull the entire transaction. If the earliest log timestamp in the transaction is earlier than RESTORE_SCN, obcdc cannot obtain those logs and exits the process after retrying for a period.
Solution: Reset (shift backward) the start timestamp, or synchronize data from the primary database instead.