NOT Logged Initially in DB2

xiaoxiao2021-03-05  30

Recently, when delete from deleting more records, the system error cannot be deleted due to the small log file. So I want to seek a way to delete the log file.

Check it online, Oracle provides a function called TRANCATE and can empty a log file without writing log files. DB2 provides an NLI (Not Logged Initial "mode, but you need to add the not logged initially attribute when you build a table. If INSERT, UPDATE or DELETE operation does not want to write log files, first alter table activate not logged initially, then execute the SQL statement, it is best to commit, restore the original settings.

But this is a shortcoming (taken to the IBM website):

1. If there is a statement failure, then this table will be marked as irreparable and need to be deleted. This is combined with other recovery issues (see SQL Reference About CREATE TABLE), which makes NLI to become a feasible method in many cases.

2, in the final submission of the work unit, must wait until all the dirties involved in this work unit can be written after the disk is written. This means that this submission should take a lot of time. In fact, Test 6 and 7 have shown that if there is no positive page clearance, then in the case of using NLI, INSERT adds a total time consuming to make a longer. However, Test 8 indicates that when NLI is used with a positive page, it can be greatly reduced. If you use NLI, you should focus on your eyes;

转载请注明原文地址:https://www.9cbs.com/read-33515.html

New Post(0)