Code:select trunc(sysdate -2) from dual;
You can do it in a pl/sql procedure.
Place the delete statement inside the loop. something like
For i in reverse 3..100 Loop
delete from table where date < sysdate-i;
commit;
end loop;
So you are suggesting that it would be faster if you used a constant instead of sysdate-2 or trunc(sysdate-1). How do you know that sysdate-2 isn't a constant? :confused: It seems like a constant to me. That is constant as of the time it is being used. I don't see how your suggestion will change anything.
You should go back and create explain plans for every table that gets deleted from when you delete from the main table. You might also try partitioning those tables by day as well. This way you would go around and drop and recreate partitions from all of your tables.
For what you are doing 45 minutes might not be that bad, but dropping a bunch of partitions would be much faster, IMHO.