DBMS_REDEFINITION sucks if you have CLOBs

This a great article for Oracle DBA's attempting to perform an on-line reorg of a table with CLOB's. Although it's old, it still applies to latest versions of the Oracle Database. I am experiencing the same on an Oracle 19.9 database. A session is now hanging for more than 160 hours and Oracle Support cannot identify the cause

DBMS_REDEFINITION is a well-known, built-in package of Oracle, which can be used to reorganize tables. It works well most of the times, but recently I have found myself working out a custom solution to reorg a large table for a customer.

For the impatient: if your table you are going to reorg contains CLOB data, you might have to consider using an alternative method such as CTAS(Problem appeared on 11.2.0.2, I did not test it on other Oracle versions).

In this case our customer had a trace table which occupied approximately 27GB (20GB of that belonged to LOB segments!). In order to sort the problem out, the proposed solution was that we would re-create it as a partitioned table and Oracle's secure file feature with compression would be used to help cut down on required space.

For some reason the execution of DBMS_REDEFINITION.SYNC_INTERIM_TABLE(...) has never finished and the whole process got stuck in this step. As the name of the procedure suggests this ought to synchronize inserted/updated/deleted records from the original table to the new one. Internally DBMS_REDEFINITION uses a materialized view and a materialized view log on the source table to do this job.

https://lcsontos.blogspot.com/2012/04/dbmsredefinition-sucks-if-you-have.html

Jayson Magnus

Principal Oracle Database Administrator at athenahealth

1 年

if you add indexes to the destination table then the synch works better

回复

Materialized views when using fast refresh are seen to have a performance problem if you do not collect statistics on the MLOG tables in the empty state, and then freeze them (the statistics) . Perhaps this is the problem you were facing...

要查看或添加评论,请登录

Ravin Maharaj的更多文章

社区洞察

其他会员也浏览了