Re: Update 100 rows and sleep for 60 sec

  • From: "Powell, Mark" <mark.powell2@xxxxxxx>
  • To: ORACLE-L <oracle-l@xxxxxxxxxxxxx>, "balwanthdba@xxxxxxxxx" <balwanthdba@xxxxxxxxx>
  • Date: Tue, 28 Mar 2017 16:59:46 +0000

See DBMS_LOCK.SLEEP(n)


where N is how many seconds you want the process to sleep.  Though what is the 
point of sleeping.

________________________________
From: oracle-l-bounce@xxxxxxxxxxxxx <oracle-l-bounce@xxxxxxxxxxxxx> on behalf 
of Balwanth B <balwanthdba@xxxxxxxxx>
Sent: Tuesday, March 28, 2017 12:16:07 PM
To: ORACLE-L
Subject: Update 100 rows and sleep for 60 sec

I am looking for script which will update


Update 100 rows
commit
sleep
then next update 100 rows
follow the same pattern

I have something like below but how do I make sure it sleeps for mentioned time 
and does the next 100 rows.

declare
CURSOR REC_CUR IS
select statement;
TYPE ROWID_T IS TABLE OF VARCHAR2(50);
ROWID_TAB ROWID_T;
BEGIN
OPEN REC_CUR;
LOOP
FETCH REC_CUR BULK COLLECT INTO ROWID_TAB LIMIT 5000;
EXIT WHEN REC_CUR%NOTFOUND;
FORALL I IN 1.. ROWID_TAB.COUNT
update statement
COMMIT;
END LOOP;
CLOSE REC_CUR;
END;

Other related posts: