Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Oracle_online table redefinition_2

2025-01-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

The online redefinition function is realized through materialized views. When the START_REDEF_TABLE stored procedure is called, a materialized view with the same name as the temporary table is automatically created, and the records of the source table are copied to the temporary table, where the source table can be DML and queried, but not DDL.

The DML modification records generated by the source table during the online redefinition phase will be recorded in the materialized view log. During the SYNC_INTERIM_TABLE and the final FINISH_REDEF_TABLE process, the temporary table is updated according to the records in the materialized view log.

After calling the ABORT_REDEF_TABLE stored procedure, the established materialized view is cleared. If there is already copied data on the temporary table, then the data on the temporary table is not purged after ABORT, and the data on the temporary table should be cleared manually.

Table redefinition is started by the DBA creating an interim table based on the original table. The interim table can have a different structure than the original table, and will eventually take the original table's place in the database. While the table is redefined, DML operations on the original table are captured ina Materialized View Log table (MLOG$_%). These changes are eventually transformed and merged into the interim table. When done, the names of the original and the interim tables are swapped in the data dictionary. At this point all users will be working on the new table and the old table can be dropped.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report