Oracle indexes are moved to different partitions

Source: Internet
Author: User

Recent system space is not enough, to do database cleanup, truncate data, found that the data is not continuous, resulting in this table space occupies a huge, think of using shrink, move. But shrink efficiency is slow, choose move. The statement probably does this:

SELECT 'ALTER TABLE SDMP.' ||C.table_name|| 'Move Partition' ||C.partition_name|| 'tablespace sdmp_s update indexes;'   fromall_tab_statistics CINNER JOINall_tab_partitions S onS.partition_name=C.partition_name andS.tablespace_name='sdmp_s_201502' WHEREC.owner= 'sdmp'    andC.object_type<> 'INDEX';

Find that some indexes are not moving (mostly partitioned): Use Select to find the corresponding statement and move

   SELECT 'alter index SDMP.' ||A.segment_name||'Rebuild Partition'||A.partition_name||'tablespace sdmp_s;'   fromdba_segments A Left JOINdba_indexes B onA.segment_name=B.index_nameWHEREA.tablespace_name= 'sdmp_s_201302';

Delete Table space

Drop  and Datafiles;

Oracle indexes are moved to different partitions

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.