Mass delete actions and SQL
Log Master
cannot generate UNDO SQL to reverse the database changes that result from a mass delete action (such as a TRUNCATE statement or a DELETE statement with no WHERE clause) when all of the following conditions exist:
- The mass delete affects a table that is defined with Data Capture None (DCN).
- The table is stored in a segmented or a universal table space.
Because of the way Db2 logs the mass delete, Log Master cannot generate UNDO SQL. To prevent this situation, define the table with Data Capture Changes (DCC). This definition causes Db2 to log individual delete actions for each record in the table, and enables Log Master to generate UNDO SQL to reverse the delete actions.
Similarly, the log records that Db2 creates for a LOAD REPLACE LOG NO action also prevent Log Master from generating UNDO SQL. You can also use the GENERATE MASSDELETE keyword of the OPTION statement to direct Log Master to ignore the log records that result from a LOAD REPLACE LOG NO action, but depending on your situation, the generated SQL might not meet your needs.
Log Master can generate MIGRATE or REDO SQL to represent a mass delete action. Also, Log Master generates a TRUNCATE statement for the selected table.
Related topic