With the correct channel definition in place, you will now promote the Definition into a run time environment. After that, you will perform the initial data load and start the jobs to synchronize the databases.
The step to deploy the Channel Definition in a runtime replication environment is called HVR Initialize. This step is always required for a new Channel Definition, but also after changes have been made to an already existing Channel Definition and are ready to be implemented in the runtime environment.
1. Below your Channel Definition in the tree on the left side of your window, right click on TARGET in order to show the context menu.
2. Select HVR Initialize.
3. Since this is the first time you will initialize the channel, all options are checked.
1. Click Initialize with all defaults checked.
2. Wait for the initialization to complete.
3. When Initialize finishes, a pop-up shows that three jobs have been created and how they could be started through the command line should that be desired. Later you will start the jobs through the GUI.
4. Click OK on the pop-up.
5. Click Close on the Initialize dialog. (Or read more about this topic in the section below before closing the dialog).
Before closing the HVR Initialize dialog, notice how in the status bar HVR shows the equivalent command hvrinit that could be executed on the hub to achieve the same result. As you check/uncheck options, HVR will change the command to help operators who prefer to operationalize their environment through scripts to learn the commands.
At this point Change Data Capture has been initialized, and HVR will capture any changes in the transaction log that are relevant to the channel from this point forward, irrespective of whether they occur as part of a new transaction or are in the middle of an ongoing transaction. In this trial environment the source system runs a quite typical OLTP (On-Line Transaction Processing) workload that consists of only short-running transactions.
In a production environment with long-running transactions you must consider that HVR will only capture new changes from the initialization point forward. However, also bear in mind that HVR will not be able to successfully capture changes on tables that don’t yet have supplemental logging enabled. This could mean – especially on a database like Oracle where it is fine to have very long—running transactions in the database—that you must enable supplemental logging on the tables some time before doing the initial load of the data to ensure you don’t lose any transactions.
Production systems, as well as this trial environment, don’t keep the archive log files around forever. Hence, as a best practice, start the capture job following the initialize so that HVR can capture any changes of interest and start queuing these on the hub for integrate to pick up following the initial load.
HVR retrieves information from the Channel Definition to make assumptions about what location should be source and target for the Refresh. These can be changed if needed for a scenario where, for example, one target is used to populate another target.
For a Channel that has been already initialized, HVR will, by default, not include any tables to safeguard you from accidentally refreshing tables that may already be in sync.
Also, by default, HVR will Refresh Data (as opposed to just the table definition) as part of the Refresh. The default method to refresh the data is through a bulk method using a fast, database-specific, direct path loading approach into the target.
Row-wise mode is equivalent to Repair because it first computes and then applies the difference between source and target table.
The bulk Refresh method is often faster than row-wise mode, because no difference has to be computed and the direct load is fast. However, the bulk mode is more intrusive on systems that already had data in the target table.
6. Leave the default option Bulk Granularity selected.
7. To the right, there are options for parallelism to speed up the load. Select Parallelism for Locations value 2, and Parallelism for Tables value 3.
8. By default, HVR will align the initial load and ongoing replication. The option, Online Refresh, controls this behavior and is generally correctly populated by default.
9. Make sure Online Refresh is checked, with the option Only Skip Previous Integration selected.
This is because you have two targets that are populated independently, and skipping on the capture may result in data loss.
On the far right the Refresh dialog shows options to manipulate Foreign Key Constraints which we leave default, as well as Select Moment, which you will leave untouched.
Select Moment is useful for scenarios when an exact moment in time for the select from the source is important for example when doing an initial load into a filesystem-based data lake (like S3, Azure Data Lake Store or Blob Storage, or HDFS). Select Moment on Oracle leverages Oracle’s flashback capability.
10. Toward the bottom of the dialog, check the box for Create Absent Tables. This option instructs HVR to discover any existing table definitions on the target system(s), and adjust them as needed.
11. Leave the default option With Index checked, resulting in a primary/unique index on the key column(s), or a non-unique index on tables without a unique key on the source, in order to speed up data integration.
Again, note that the status bar at the bottom of the dialog has been populated with a command that can be executed on the hub to achieve the same result.
HVR Refresh provides additional capabilities to assist with refreshing table definitions and data:
12. Leave all options on the tabs Scheduling and Contexts default.
13. Click Refresh to run create the tables and load the data interactively.
14. Once the Refresh is done, close the pop-up and the Refresh dialog.
Starting from the previous checkpoint with a complete configuration, you should now have replication running.
1. In the HVR GUI, select the node Scheduler for your hub, and look at the state on the right-hand side. You should have three jobs running and regularly see data flowing.
2. If this is not the case, go back through the last few sections. If something went wrong during Initialize or Refresh, you can go back and redo the steps to get to a working setup at this stage.