Reputation: 53
I am pretty new to azure. I want to copy data from on-premise oracle db to azure blob storage using the copy activity.
I am already using a single copy activity that has a SQL query, but the query return rows in millions. And it takes more than 5 hrs to copy the data
I read some docs suggesting doing the incremental copy. But what steps I need to follow to achieve this ?
Upvotes: 0
Views: 983
Reputation: 7156
CREATE PROCEDURE usp_update_watermark
@LastModifiedtime datetime
AS
BEGIN
UPDATE watermarktable
SET [WatermarkValue] = @LastModifiedtime
WHERE [TableName] = @TableName
END
select * from data_source_table where
LastModifytime > '@{activity('LookupLastWaterMarkActivity').output.firstRow.WatermarkValue}'
and LastModifytime <= '@{activity('LookupCurrentWaterMarkActivity').output.firstRow.NewWatermarkvalue}'
Then take a execute stored procedure activity and include the stored procedure which updates watermark table.
Pass the lookup activity2 output as a parameter to Stored procedure.
Publish and run the pipeline.
In first run all data will be copied and watermark table gets updated with new value.
From next run, data will be copied from new watermark value only.
Reference: Microsoft document Incrementally copy a table using PowerShell - Azure Data Factory | Microsoft Learn
Upvotes: 0