I have the following routine I found runnig on my database (see current code). I came up with alternate code (see alternate code) to capture the desired rows and remove the costly delete. Mine tested fine and the run time is okay but I was just curious to see any more options that someone could come up with. Especially since coding is not my thing.
---- current code (this creates approx. 400K rows and then deletes all but approx. 10K!!!!)
truncate table temp_dir_history;
insert into temp_dir_history
select *
from dir_history
where trunc(record_date) = trunc(sysdate) and directory_file Not like '%adminpc%';