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!

How to lock set of rows?

dbdanJul 3 2007 — edited Jul 3 2007
Hi All,

I have a very big database having around 30m records in transaction table. I need to issue an update statement on this table. During this updation I want no user should access those records. So intead of updating all records at once I need to update them in a set of batches. Now I want to lock only those batches for which I am issuing updates. This will not lock complete table and other user can also continue working on rest of the rows.

Here before updating I am trying to loack those records by issuing SELECT FOR UPDATE statement. But this statement expects some variable to execute. I can declare variable but for 1m records do I need to open cursor. I don't know how to simply lock a set of records in Oracle and then Issue an update statement for those records.

Please help me with this.

Thanks,
Danish
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 31 2007
Added on Jul 3 2007
16 comments
1,220 views