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!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Table Lock during DML with EXECUTE IMMEDIATE

RVNov 12 2024

Hi There,

I'm working on Oracle 19c. I have the following process in each stored procedure. All DML statements are using EXECUTE IMMEDIATE. There is no Cursors or Transactions in the code. It's merely performing the below in a sequence.

Note: We have a million of records in scope for below DMLs.

  1. DROP INDEXS of the TABLE
  2. DELETE FROM TABLE
  3. INSERT INTO TABLE
  4. MERGE or UPDATE the TABLE
  5. COMMIT
  6. CREATE INDEXES of the TABLE

The Stored Procedure is been called via Client App. The table is getting locked mostly during the MERGE or UPDATE. Can you please let me know

  1. The root cause for the table lock
  2. How can we avoid the table lock

Regards,

RV

Comments
Post Details
Added on Nov 12 2024
6 comments
194 views