Techniques are provided for allowing the reorganization and/or redefinition
of data in a relational database with minimal or no downtime by allowing "online"
reorganization/redefinition of the data. According to one aspect of the invention,
an empty revised table is created in the same schema as the target table. The revised
table is created with the attributes that are desired for the reorganization/redefinition
of the target table. Triggers, constraints, grants and indexes that are associated
with the target table are replicated for the revised table. The reorganization/redefinition
is performed by using an underlying mechanism that involves using incrementally
maintainable materialized views.
According to one feature, the revised table is initialized and periodically
synchronized with the target table. After the reorganization and/or redefinition
is complete on the revised table, the revised table and the target table switch
identities such that the revised table is now the target table and the target table
becomes the revised table.