PLSQL_批量压缩表Table Compress(案例)

2015-04-01 Created By BaoXinjian

一、摘要


表空间迁移并压缩案例 

 

二、案例


Step1. 并发转移表空间

set timing on; alter session set parallel_degree_limit=192; alter session enable parallel ddl; alter session enable parallel dml; alter table inv.mtl_material_transactions move partition plegacy tablespace large_journal_legacy compress for archive low;

Step2. 并发重建主键

set timing on; alter session set parallel_degree_limit=192; alter session enable parallel ddl; alter session enable parallel dml; alter table inv.mtl_material_transactions drop constraint inventory_item_pk cascade; drop index mtl.inventory_item_pk; create unique index mtl.inventory_item_pk on inv.mtl_material_transactions(inventory_item_id) tablespace mtl_large_index; alter table inv.mtl_material_transactions add constraint inventory_item_pk primary key inventory_item_id using index inv.inventory_item_pk; exit;

Step3. 并发重建索引

set timing on; alter session set parallel_degree_limit=192; alter session enable parallel ddl; alter session enable parallel dml; drop index inv.material_item_index01; create index inv.materil_item_index01 on inv.mtl_material_transaction(inventory_item_id) tablespace mtl_large_index; exit;

 

Thanks and Regards

 

你可能感兴趣的:(compress)