delete by rowid, delay incremental
Why is the delay incremental?
Every day the procedure is executed, the first day 20 minutos, the second day 40minutos, and you go on successively.
Restarting the instance, the times are normalized. The table has approximately 2 million records, and approximately 80% of the table is deleted. Inserting in the historical table.
--------------------------------------------------------
-- DDL for Procedure CLEARLOG
--------------------------------------------------------
set define off;
CREATE OR REPLACE PROCEDURE "ODUTO"."CLEARLOG" IS
CURSOR C_LAST_EXTRACT IS
SELECT
MAX( TO_DATE( TO_CHAR( TRUNC(EXT_DATE),'DD-MM-YYYY')||' '||LPAD(TO_CHAR(EXT_TIME),6,'0'), 'DD-MM-YYYY HH24MISS'))
FROM ODUTO.EXT_LOG;
V_LAST_EXTRACT DATE;