Sonntag, September 04, 2011

used_urec

Jonathan Lewis erläutert in seinem Blog, wie die Spalte used_urec in V$TRANSACTION gedeutet werden kann, und dass der Zusammenhang zwischen der used_unrec-Angabe und der Anzahl geänderter Zeilen eher arbiträr ist und von diversen Faktoren beeinflusst wird:
when you insert a row, you typically generate one undo record (used_urec) for the row, but when you insert many rows using an array insert Oracle has an optimisation mechanism on undo record creation that allows it to create one used_urec to cover all the changes you have made simultaneously to an individual block - so used_urec could be much smaller than the number of rows processed.
However, if you have indexes in place and are doing normal index maintenance on import, then each table row would require each index to be updated, so you would go back to one used_urec per table row plus one used_urec per index maintained per table row.
So, when you look at the “big picture” there’s no obvious correlation between rows inserted and undo generated — until you look at the fine detail of exactly what you’re doing, and whether any optimisations apply. (The details of the optimisation strategies available vary with the chosen insert mechanisms and with version of Oracle).
Außerdem verweist er auf einen älteren Artikel zum Thema Session Undo und darin dann wiederum auf ein Script von Steve Adams, mit dessen Hilfe sich die Restlaufzeit eines Rollback-Vorgangs bestimmen lässt (sofern man Zugriff auf die erforderlichen v$- und x$-Objekte besitzt).

Keine Kommentare:

Kommentar veröffentlichen