Transaction logging is used for recovery. Logging, in certain cases, can introduce performance problems. When you are not concerned about recovery, you can avoid transaction logging. This may introduce additional work when recovery is needed.
The usual scenario for such operations happens when you need to perform an initialization on a table based on external data, using either LOAD
, INSERT
, or db2move
. When the volume is especially large, the gain in performance is worthwhile.
Change logging characteristics on a table. This command disables logging for the current unit or work:
[db2inst1@nodedb21 NODE0000]$ db2 "ALTER TABLE POS.FACTDET ACTIVATE NOT LOGGED INITIALLY" DB20000I The SQL command completed successfully.