Thursday, December 29, 2011

ALTER TABLE SHRINK operation is very slow with table contains LOB

ALTER TABLE ... SHRINK SPACE CASCADE is taking a very long time on a table with LOB columns.
Here goes some diagnostic analysis.

1. While querying v$session_longops view the Alter Table shrink operation is not listed there.

2. Any other session working on this table seems fine. Delay does not occur for others.

3. The 10046 dump, shows waits reading the datafiles 'db file sequential read' most of them on the the object 31324 which is the LOB:

OBJECT_NAME OBJECT_ID OBJECT_TYPE
---------------------------------------- ---------- -------------------
SYS_LOB0000032195C00001$$ 31324 LOB

This issue of slowness is identified as Oracle bug 5768710 and there is no workaround available. This bug found on Oracle database version 10.2.0.1, 10.2.0.2, 10.2.0.3 and 10.2.0.4. However this bug is fixed in the following releases:

- 10.2.0.3 Patch 13 on Windows Platforms
- 10.2.0.5 (Server Patch Set)
- 11.1.0.6 (Base Release)

So upgrade to any of these version will likely resolve this bug.

No comments: