Oracle unused column / drop unused column
Dropping unused columns:
und hier das Beispiel von Tom Kyte:
Since someof those 'other' changes can be problematic if done online it is generally advisable to do a thorough analysis to make sure you have identified ALL of the desired changes so you can do then all at once. Often the best solution is to recreate the table and data using CTAS.
1. a normal 'drop unused' rewrites every block. It does NOT move rows to other blocks - it essentially just squeezes the row contents to eliminate any unused column content.
2. a normal 'drop unused', even when using checkpoints, leaves the table 'unusable' until the ENTIRE table has been processed. That means you MUST complete the operation before you can resume normal reuse of that table
3. a normal 'drop unused' will NOT free space that can be used by other objects - the same rows occupy the same blocks - the rows are just 'smaller'. So there is NO space to free.
Creating a new table (e.g. CTAS) allows you to use bulk loading and parallel operations and WILL move rows to new blocks. It can also take care of those 'other' changes I mentioned with little or no additional overhead.
|
Kommentare
Kommentar veröffentlichen