Online Refresh
Question
What does HVR Online Refresh do?
Environment
HVR 5
Answer
An Online Refresh is a refresh procedure that can be performed while users are making changes to the source database. It goes as follows:
- Stop integrate jobs. Capture jobs may be left running.
- Choose HVR Refresh in GUI and select the Online option (we also set parallelism and bulk).
- After completion, restart the integration.
- Check that Capture is still running. If it doesn't, restart it.
You can stop the Capture jobs for performance improvement. On the other hand, if the Refresh takes a long time and the Capture job is stopped, then it may take a long time to catch up.
NOTE: Online Refresh comes with two skipping options,
-qrw
(Read/Write) and-qwo
(Write only) and a no-skipping option-qno
. Using skipping on the read (Capture) side of the Refresh only makes sense if the Capture job is stopped. No skipping should be used when not all of the data for a particular table will be refreshed (e.g. due to a Restrict /RefreshCondition).
Background Information
Online Refresh uses control-files to signal the replication jobs that a Refresh for a certain table has taken place. When Read/Write skipping is enabled it instructs the capture job to skip all the changes from before the refresh and it instructs the Integrate job to skip all the changes from before the Refresh and to use resilient integration for changes that happened during the Refresh. We need to be resilient to these changes because we can not be sure whether these changes are already picked up by the Refresh. Resilience means transforming an insert into an update if the row already exists, transforming an update into an insert if the row does not exist and lost-deletes are ignored.
Write-only skipping means that the changes are only skipped on the Integrate side; in this case, also the Integrate job is resilient for changes that happened during the Refresh.
No-skipping means that the Integrate job will be resilient to the changes during the Refresh but no changes will be skipped. The reason that the Integrate job needs to be suspended is that the Refresh writes these control files at the very end of the Refresh. If the Integrate job was left running all the changes would already have been Integrate and the skipping/resilience has no effect.
Before the Refresh starts, hvrinit
can be used to define start-capture moment (which is not the same as running the Capture job): hvrinit
defines the start moment of the Capture, when the Capture job is triggered at a later moment it will go back to the moment of the hvrinit
or to a specific time stamp in the past if hvrinit -i
(Capture rewind) has been used.
Anyway, this step is only really needed if you would like to forcefully skip all changes before this hvrinit
moment (e.g., because the Capture job has been in a failed state for a week and you don't want to process these changes anymore) or if the Capture job has never run before.