delete on db2 table
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 46
- Joined: Tue Aug 21, 2007 5:39 am
- Location: Bangalore, India
Hi,
Since delete is very costly statement, one option to solve the issue is,
1. Load the required data(remaining 370 M records) to a TEMP table.
2. Truncate (or) drop the main table. Following command can be used to truncate the table. This is very fastest method.
ALTER TABLE <SCHEMA.TABLENAME> ACTIVATE NOT LOGGED INITIALLY WITH EMPTY TABLE
3. Insert the TEMP table data to main table (or) Rename the TEMP table to main table.
Thanks..
Since delete is very costly statement, one option to solve the issue is,
1. Load the required data(remaining 370 M records) to a TEMP table.
2. Truncate (or) drop the main table. Following command can be used to truncate the table. This is very fastest method.
ALTER TABLE <SCHEMA.TABLENAME> ACTIVATE NOT LOGGED INITIALLY WITH EMPTY TABLE
3. Insert the TEMP table data to main table (or) Rename the TEMP table to main table.
Thanks..