Hi @Samir Kohli
Thank you for posting your query!
Azure Data Factory (ADF) does not provide a direct Update option when using an ODBC Linked Service in a Copy Activity. However, you can update records in Oracle RDS using the following approaches:
Use a Stored Procedure Activity (Recommended) - If you have a stored procedure in Oracle RDS that handles updates, call it using the Stored Procedure Activity in ADF. This is the most efficient method for bulk updates, as it avoids row-by-row processing.
Use a Staging Table and MERGE
Statement (Best for Bulk Updates) - Copy the data into a staging table in Oracle RDS using a Copy Activity. Then, use a MERGE SQL statement inside a stored procedure to update the target table efficiently. This approach minimizes performance overhead and ensures consistency.
ForEach Activity for Row-by-Row Updates (Not Recommended for Large Datasets) - If batch processing is not an option, you can: Use a Lookup Activity to fetch records that need updating. Use a ForEach Activity to iterate through each record and execute an update via a Stored Procedure Activity or Script Activity. This method performs poorly for large datasets and should be used only as a last resort.
Use Script Activity for Direct SQL Execution - If your ODBC connection allows executing raw SQL, you can use the Script Activity to run an UPDATE
statement directly on Oracle RDS.
Additional Considerations:
- ODBC Driver Support - Ensure your ODBC driver allows
UPDATE
statements (some are read-only). - Permissions - The database user needs sufficient privileges to perform updates.
- Error Handling - Use Try-Catch blocks in ADF to log and manage failures.
Final Recommendation - If updating a large number of records, the Stored Procedure + MERGE method is the most efficient. For small updates, Script Activity can be an alternative. Avoid row-by-row updates unless absolutely necessary.
For additional information, please refer the following Microsoft documentation:
- Copy data from Amazon RDS for Oracle by using Azure Data Factory or Azure Synapse Analytics
- Copy data from and to Oracle by using Azure Data Factory or Azure Synapse Analytics
I hope this information helps. Please do let us know if you have any further queries.
If this answers your query, do click Accept Answer
and Yes
for was this answer helpful. And, if you have any further query do let us know.