Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: TRUNCATE TABLE acquire rollback segment?
In article <Y9EG6.658205$f36.18728321_at_news20.bellglobal.com>, Tom
<cmc3232_at_yahoo.com> writes:
>I always thinking TRUNCATE TABLE is fast because no rollback is generated
>for the operation. Suddenly, I found foolowing in COUCHMAN's DBA
>certifaction book:
>
>"Despite your inability to rollback a table truncation, Oracle does acquire
>a rollback segment for the job. Why? Because if you terminate the truncate
>table command, or some failure occurs, the rollback segments stores the
>changes made for the duration of the truncate operation to enable crash
>recovery."
>
>I do not quite understand what information is put in the rollback for the
>TRUNCATE operation. Your help is appreciated.
>
>Tom
>
When you truncate a table then by default you free all extents past the
initial extent for the table and all indexes, if any. The free space changes
involve changes to the dictionary or with 8.1 with the tablespace bitmap.
These changes have to be recoverable and are written to the rbs segments and
redo logs. If the database were to die in the middle of the truncate
operation Oracle would need for the space management tables to be
consistent.
I hope this provides enough information for what you read to make sense of what you read.
![]() |
![]() |