2012年7月19日星期四

move table/index/lob column/partiton table/partiton index

-- purge recyclebin
purge user_recyclebin ;
-- move table to dest_data
select 'alter table '||segment_name||' move tablespace
dest_data ;' from user_segments where segment_type='TABLE';
-- move index to
dest_data
select 'alter index '||segment_name||' rebuild tablespace dest_data ;' from user_segments where segment_type='INDEX';
-- move lob column
select 'alter table '||table_name||' move lob ('||column_name||') store as (tablespace
dest_data) ;' from user_lobs ;
-- move partition table
select 'alter table '||table_name||' move partition '||partition_name||' tablespace
dest_data ;' from user_tab_partitions ;
-- move partiton index
select 'alter index '||index_name||' rebuild partition '||partition_name||' tablespace
dest_data ;' from user_ind_partitions ;

没有评论:

发表评论