Alex,
Hold on !
NOLOGGING does not affect the creation of undo (rollback). NOLOGGING affects only the creation of
REDO entries, which are
an entirely separate database structure from UNDO/rollback structures.
REDO entries do not occupy any database tablespace. REDO takes up a small amount of space in memory, then, based upon a variety of triggers, goes directly and serially out to
on-line redo log files, which do not occupy any database tablespace. As on-line redo log files fill, Oracle writes the filled log file to archived redo log files (if the database is in ARCHIVELOG mode), and, whether in ARCHIVELOG mode or NOARCHIVELOG mode, then overwrites the oldest on-line redo log file with new redo entries. REDO entries exist for the purpose of
recovering the database or (more recently) for
"log mining" -- to manually resurrect data that may have been inappropriately lost.
But notice that none of the above behaviour deals with UNDO/Rollback entries, which exist for completely different reasons:
read consistency and for
cancelling a transaction (i.e., rollback).
Alex has a problem with running out of "undo tablespace 'UNDOTBS1'".
First, let's ask "How much UNDO/rollback space does Oracle use for INSERTs?" If you decide to cancel (i.e., UNDO) a massive INSERT, Oracle must revert to what was in the database prior to the INSERT. So,
Q. How much space did INSERTed rows occupy prior to the INSERT?
A.
None!!!
Therefore, Oracle must store
no row data in the UNDO/Rollback tablespace for INSERTed rows...
only the INSERTed rows' ROWIDs.
Q. How much space do ROWIDs occupy?
A. Not much.
If your massive INSERTs occupy only a small amount of UNDO/Rollback space, then what accounts for the hyper-consumption that causes the "ORA-30036: unable to extend segment by 8 in undo tablespace 'UNDOTBS1'" error? The answer is (most likely) "your indexes on the target table".
If indexes exist on a table receiving massive INSERTs, then mostly likely
massive fragmentation/chaining is happening to the index, as well. Massive INDEX-block activity/changes appear in the UNDO/Rollback segments.
Massive fragmentation/chaining that occurs to a table's INDEX(es) causes significant performance degradation as an ongoing problem until you re-build the index.
Therefore, I recommend that you:
1) Do a "DROP INDEX..." command on all of the indexes that exist on the target table prior to the massive INSERTs,
2) Conduct the massive INSERT,
3) Re-"CREATE INDEX..." on all of the indexes for the target table.
I anticipate these benefits:
1) Your "ORA-30036: unable to extend segment by 8 in undo tablespace 'UNDOTBS1'" error will disappear,
2) Your INSERT will be
significantly faster (since Oracle will not be
wasting time by creating, fragmenting and/or chaining index blocks to accommodate newly INSERTed rows,
3) You will have
no fragmentation/chaining as a result of the index rebuilds.
Let us know your findings after following this strategy.
![[santa] [santa] [santa]](/data/assets/smilies/santa.gif)
Mufasa
(aka Dave of Sandy, Utah, USA)
[I provide low-cost, remote Database Administration services:
www.dasages.com]