Case: How To Clean Up Large Table
2012-12-18 09:41
309 查看
We have a large interface table with more than 12m records, unfortunately, most of them are useless, we’d like to clean it up for performance optimization.
Delete useless data by ‘delete from ’ and subsequently shrink the table to lower the HWM? It’s not a good choice. DBA hates that as delete clause would generate huge log, probably the operation would fail.
Truncate the table? I just can’t do that, some data couldn’t be eliminated now.
Here is the DBA’s suggestion:
Step 1: Select the useful data into a new table table_tmp;
Step 2: rename the large table table_origin to table_old;
Step 3: rename table_tmp to table_origin. Now we have a much smaller table_origin with normal HWM.
Step 4: Take care of the indices and the privileges;
Step 5: ensure the table_origin is healthy and then drop table_old;
Delete useless data by ‘delete from ’ and subsequently shrink the table to lower the HWM? It’s not a good choice. DBA hates that as delete clause would generate huge log, probably the operation would fail.
Truncate the table? I just can’t do that, some data couldn’t be eliminated now.
Here is the DBA’s suggestion:
Step 1: Select the useful data into a new table table_tmp;
Step 2: rename the large table table_origin to table_old;
Step 3: rename table_tmp to table_origin. Now we have a much smaller table_origin with normal HWM.
Step 4: Take care of the indices and the privileges;
Step 5: ensure the table_origin is healthy and then drop table_old;
相关文章推荐
- How to cleanup orphaned Data Pump jobs in DBA_DATAPUMP_JOBS ?
- How to Clean Up Duplicate Objects Owned by SYS and SYSTEM Schema (Doc ID 1030426.6)
- How to clean up disk space on Linux
- How To Cleanup Orphaned DataPump Jobs In DBA_DATAPUMP_JOBS ?
- 10g RAC: How to Clean Up After a Failed CRS Install
- How to clean up BizTalk Message Box
- How To Automate Cleanup Of Dead Connections And INACTIVE 【如何自动清理ORACLE中的死连接和非活动会话】
- How to cleanup ASM installation (RAC and Non-RAC) [ID 311350.1]
- How to cleanup ASM installation (RAC and Non-RAC)
- [转载]How to set up a clean UTF-8 environment in Lin
- How To Automate Cleanup Of Dead Connections And INACTIVE Sessions [ID 206007.1]
- How to cleanup and shrink disk space usage of a Windows KVM virtual machine
- how to clean up a cluster .
- How to Clean Up After a Failed 10g or 11.1 Oracle Clusterware Installation [ID 239998.1]
- How to open a Cisco TAC case
- How to display table and its fields property
- How to Consistently Come Up with Great Ideas
- [howto] General 5.10 - HowTo: Speed up ubuntu boot process - the way you can feel it. - updated
- How to build up the ELDK cross compiler for S3c6410(step1)
- Designing Data Storage Architecture- How to Sync Large SQL Server Databases to SQL Azure