Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Commit intervals in Merge statement

3391232May 3 2017 — edited May 3 2017

Hi,

I have very big table "Target" which has 70 million records and staging is a daily delta which has 2 to 3 million records depends on the changes (Updates / inserts).

Target = 70 millions

Staging = 2 to 3 millions

MERGE INTO Target

    USING Staging

    ON (Target.Keys=Staging.Keys)

  WHEN MATCHED THEN

    update set Target.values=Staging.Values

  WHEN NOT MATCHED THEN

   Insert() Values()

These queries are being called from the external application.

This query is taking 5 to 10 mins depends on the data volumes and network availability and applying commit in one go which is explicit.

--> Is there any possibility to apply commit interval after each 10,000 records? the reason why I am asking this question is the support team would not know whether the query is running or over running until it gets completed. If we have commit intervals, we have a timestamp field in the target table that helps to check how many records are updated for monitoring purpose and see progress.

Or

--> is there anyway to check the merge statement is active and processing records?

Please share your thoughts or any workarounds for monitoring purpose.

This post has been answered by Gaz in Oz on May 3 2017
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 31 2017
Added on May 3 2017
9 comments
4,042 views