Warning: Import Postponed Because a Long-Runing Transaction Was Active
Issue
Newly added tables are not created in the destination. The following warning appears in Fivetran:
Warning: The import of the following tables has been postponed to the next sync cycle because a long-running transaction <transaction_id> was active at the time of import.
Environment
- Connector: Oracle
- Binary Log Reader
Resolution
To resolve this issue, do the following:
- Identify the long-running transaction using the transaction ID shown in the warning. The transaction ID uses the format
<undo_segment_number>.<slot_number>.<sequence_number>. Run the following query, replacing the placeholders with the corresponding values from your warning:SELECT t.xidusn || '.' || t.xidslot || '.' || t.xidsqn AS transaction_id, s.sid, s.serial#, s.inst_id, s.username, s.osuser, s.machine, s.program, t.start_time FROM gv$transaction t JOIN gv$session s ON s.inst_id = t.inst_id AND s.saddr = t.ses_addr WHERE t.xidusn = <undo_segment_number> AND t.xidslot = <slot_number> AND t.xidsqn = <sequence_number>; - Work with your DBA team to resolve the transaction. Depending on your database requirements, use one of the following methods:
- Commit or roll back the transaction.
- Terminate the session if committing or rolling back is not possible.
After the transaction is resolved, the connection imports the table during the next sync.
Cause
This issue occurs when an uncommitted transaction is active on the source database when a new table is added for syncing.
Oracle Binary Log Reader reads changes from redo logs and must establish a consistent starting point from the oldest open transaction's SCN. We can't determine whether the transaction includes changes for the newly added table, so we postpone the import to avoid missing data. After the transaction is committed or rolled back, we establish the correct baseline and import the table during the next sync.