Purging lots of data in UDB

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)

Problem:

Need to delete 2-3 million rows from a table in UDB. Attempting to use one statement causes table locks and heavy log usage.

Solution:

Solution that we used is to break up delete statement into several chunks of 100 K rows each and use ALTER TABLE to disable logging in UDB.

ALTER TABLE ps_zz_jrnl_int_tbl ACTIVATE NOT LOGGED INITIALLY;
DELETE FROM PS_YOUR_TABLE_NAME WHERE_CLAUSE;
COMMIT;

I really want to know what you think