Restarting data capture
You can restart data capture where the last data capture session ended.
Before you begin
About this task
Procedure
- Determine the restart position.To preserve transactional integrity:
- Find all captured transactions that did not return a CDC_REC_COMMTX or CDC_REC_RBTX record.
- Compare the sequence numbers of the CDC_REC_BEGINTX records for the incomplete transactions. The lowest sequence number is the restart position.
- Open a new capture session by running the cdc_opensess() function.
- Run the cdc_startcapture() function for the table on which you want to restart capturing data.
- Active the session by running the cdc_activatesess() function.
Pass the appropriate sequence number as the position argument.
Data capture restarts for the table at the last transaction that was processed.
- Discard any transactions whose CDC_REC_COMMTX sequence number is less than that of the CDC_REC_COMMTX record with the largest sequence number that you processed in the previous data capture session.