About indexes and primary keys put into different table spaces

Source: Internet
Author: User

Oracel The default is that both the table and the index are placed in the same table space. In the case of small amounts of data. The same table space is not a problem, once the amount of data is large or open.

For disk IO operations. Improve overall IO performance;

If the index file is missing, it can be rebuilt directly;

To move the index table space:

Alter INDEX idx_***** REBUILD tablespace * * * (new index table space);

The following statement can be used to obtain the movement of the index under a table space

Select ' Alter index ' | | owner| '. ' | | index_name| | ' Rebuild tablespace * * * (new index Tablespace) '

From Dba_indexes

where table_owner= ' schema_name '

Order BY Index_name;

It is important to note that once the table and index are placed in different table spaces, when a new table is created, if there is a primary key or a unique constraint, the table space specified to the index is recorded,

The statements are as follows:

CREATE TABLE tmp (Mon varchar (6),

Indo VARCHAR2 (10),

Constraint Pk_name primary KEY (Mon,idno)

Using index tablespace index_tabs (index space)

About indexes and primary keys put into different table spaces

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.