How to lock set of rows?
dbdanJul 3 2007 — edited Jul 3 2007Hi 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