Re-build the failed index and the invalid Index

Source: Internet
Author: User

Re-build the failed index and the invalid Index

If an index is invalid in the database, a large number of full table scans occur for the operations on the table where the index is located because of the index. This consumes a lot of resources, therefore, these invalid indexes must be reconstructed online. Follow these steps to recreate an invalid index:

1. check whether there are any invalid indexes in the database.

Select owner, table_name, index_name, status, last_analyzed from dba_indexes where status = 'unsable ';
2. If an invalid index exists, it must be rebuilt online.
Alter index mw_app.ind_t_id rebuild online;
3. Check whether the index is rebuilt.

Note: If the index status is 'valid', the index has been rebuilt.

Select owner, table_name, index_name, status, last_analyzed from dba_indexes where index_name = 'ind _ T_ID ';
4. query the database again for any invalid Index

Note: The query has no records, indicating that the database has no invalid indexes. At this point, all invalid indexes have been rebuilt.

Select owner, table_name, index_name, status, last_analyzed from dba_indexes where status = 'unsable ';



Related Article

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.