The reorg rebuild command includes an online
parameter that lets you reorganize data and perform maintenance without taking the data
offline.
For example, to rebuild the indexes on the titles table and keep the data online, enter:
reorg rebuild titles with online
reorg rebuild ...
online includes three phases:
- A blocking phase that takes exclusive table locks for a short duration to set up
new metadata.
- A nonblocking phase that reorganizes the data and synchronizes the concurrent
activity.
- A blocking phase that reacquires exclusive table locks to synchronize the
remaining concurrent activity and install the new metadata.
SAP ASE recommends that you run reorg rebuild ...online when the
table’s transaction load is relatively low.
Running
reorg rebuild ... online takes place in a single transaction.
Recovering the work performed by the online parameter is similar to recovering the work
performed without the online parameter. Consider these issues when rolling back work
performed with the online parameter:
- Runtime rollback of the utility deallocates the pages allocated by the online
parameter.
- Crash recovery clears the allocation status of the extents allocated by the
online parameter, and makes them available for other tasks.
- In a high availability environment during node-failover recovery, if
reorg rebuild ... online attempts to initiate a physical
or logical lock, it waits for the recovery to complete before acquiring the
lock.
reorg rebuild ... online includes these restrictions:
- Tables on which you run reorg rebuild ... online must have a
unique index.
- All DMLs—that is, select (but not select
into), insert, update, and
delete—can operate on a table while reorg
rebuild ... online is running. SAP ASE does not allow inserts that
lead to page splits on tables with all-pages locking scheme while reorg
rebuild ... online is running.
- You cannot run more than one instance of reorg rebuild ...
online simultaneously on a table.
- reorg rebuild ... online does not materialize non-nullable
nonmaterialized default columns.