Oracle SQL technology to avoid journal filling

New for Oracle programming (from Sybase and MS SQL Server). What is the "Oracle path" to avoid populating the log with big updates?

In my particular case, I am updating a potentially very large number of rows. Here is my approach:

UPDATE my_table
SET a_col = null
WHERE my_table_id IN 
(SELECT my_table_id FROM my_table WHERE some_col < some_val and rownum < 1000)

... where I do this inside the loop until the updated row counter is zero,

Is this a better approach?

Thank,

+2
source share
3 answers

The number of updates to redo and undo logs will not be reduced if you decompose UPDATE into several runs, say 1000 entries. In addition, the total query time will most likely be higher than running one large SQL.

UNDO/REDO UPDATE. INSERT CREATE TABLE DIRECT aka APPEND, , .

+1

, . , , . .. 200 . , .

, .

, , . CTAS (Create Table as Select), .

.

.

Reindex, repoint contrainst, , ..

.

+1

UPDATE . , UPDATE, , .

, , - , A_COL, , NOLOGGING, UPDATE. , - , / , .

0

Source: https://habr.com/ru/post/1699672/


All Articles