Introduction
In this article, fine out how to avoid truncation of table data in target from the previous sliced refresh job by the current sliced refresh job.
Description:
This article describes the workaround to avoid the truncation of the data. This article assumes that the table is not present in the Target database.
Below is the table that we want to perform a sliced refresh on and sample data for the primary key in it.
4041139230
4041139231
4041139232
4041139233
4041139234
4041139235
4041139236
4041139237
4041139238
4041139239
4041139240
4041139241
4041139242
4041139243
The current channel definition is as below
Schedule the refresh job as shown below
Step 1
Right-click on the channel and select the HVR refresh option. Select the appropriate options.
Step 2
Go to Scheduling Tab. Slice Column should be the stable column. In our case li_ccf_id is the primary column. When Job Quota is set to 1 only a single job will run at a time.
Step 3
Click on schedule to create the jobs. This will create 4 jobs
Job testsliceref-refr0-ora-olx will refresh data till 4041139230
Job testsliceref-refr1-ora-olx will refresh data between 4041139231 and 4041139233
Job testsliceref-refr2-ora-olx will refresh data between 4041139234 and 4041139237
Job testsliceref-refr3-ora-olx will refresh data between 4041139238 and 4041139243
Issue: On the Target we see data only for the last job testsliceref-refr3-ora-olx (or which is run last out of the 4)
Resolution:
To avoid this there are 2 possible resolutions
Option 1 assumes that there is empty table on the target.
Step 1) Add below action to the channel. (Note: If the data is being loaded for the first time)
testsliceref TD_TARGET test_slice_tab * Restrict /RefreshCondition="0=1" /Context=slice
Step 2) Initialize the channel with Scripts and Jobs
Step 3) Recreate the refresh jobs using below steps
A) Right Click on the channel and select HVR Refresh
B) In the Scheduling tab select below options
C) Under the Contexts Tab check box for slice.
The final channel configuration looks like below
Note: This will make sure that the data from previous job is not deleted
Option 2 assumes that there is old data in the target db
Step 1) Change the Restrict RefreshCondition so that it is applicable to both source and target group
testsliceref * test_slice_tab * Restrict /RefreshCondition={hvr_var_slice_condition} /Context=slice
Step 2) Initialize the channel with Scripts and Jobs
Step 3) Create refresh job using the steps A) B) and C) in Option 1
The final channel configuration will look like below