How to efficiently remove all rows from a table in DB2 How to efficiently remove all rows from a table in DB2 sql sql

How to efficiently remove all rows from a table in DB2


It seems that following command works in newer versions of DB2.

TRUNCATE TABLE someschema.sometable IMMEDIATE  


To truncate a table in DB2, simply write:

alter table schema.table_name activate not logged initially with empty table

From what I was able to read, this will delete the table content without doing any kind of logging which will go much easier on your server's I/O.