1 2 Previous Next 19 Replies Latest reply: Apr 16, 2014 12:26 AM by onkar.nath Go to original post RSS
      • 15. Re: How to fast track delete?
        RobbR

        You could chunk the table based on a range of rowids and run the delete statement per chunks in parallel, see the link below:

         

        DBMS_PARALLEL_EXECUTE

        • 16. Re: How to fast track delete?
          Jjun.Tan

          Hi,

           

          If you're certain you want to empty the entire table, the fastest method is probably the truncate method: TRUNCATE TABLE EMP;

          That statement will just shift the pointer to the first row, thereby deleting everything.

           

          Warmest Regards,

          Jjun

          • 17. Re: How to fast track delete?
            rp0428
            If you're certain you want to empty the entire table, the fastest method is probably the truncate method: TRUNCATE TABLE EMP;

            That statement will just shift the pointer to the first row, thereby deleting everything.

            No - that isn't possible.

             

            If the table has been truncated it HAS NO ROWS. So there can NOT be a 'pointer to the first row.

            • 18. Re: How to fast track delete?
              Jjun.Tan

              Yep, i guess i made a mistake there, thanks for the check!

              • 19. Re: How to fast track delete?
                onkar.nath

                Thinking aloud:

                Can it be done:

                1. generate DDL of the current table

                2. create new blank table with the generated ddl (say TRANSACTION_NEW) after making appropriate changes like tablename,constraint names

                3. stop the application

                4. rename current TRANSACTION table to TRANSACTION_OLD

                5. Rename Transaction_New to TRANSACTION

                6. start the application

                 

                After that you can drop the table if you don't want any of the records in the table. But if you need some records then you can insert them in the new table using INSERT...SELECT method.

                 

                P.S: I do not claim it to be the best approach and it must be tested before actually implementing in production environment.

                 

                Onkar

                1 2 Previous Next