Firstly, don't use pl/sql if it can be avoided. Use SQL instead. Size your rollback segments accordingly and run the delete statements. It shouldn't take that long depending on resources available, other processes running etc; 3 million records is not that much really.
Actually it may depend on how much records you plan to leave. It expected amount is far less than 3 mln, you may consider storing them into temporary table (by CREATE TABLE AS SELECT), truncating original table and then moving them back. In any case it would be nice to drop indexes not suitable for searching records to delete (recreate them later) and ALTER TABLE NOLOGGING. Don't forget to choose proper RBS, because expanding it during DELETE processing is one of the most time-consuming operations.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.