The ALTER INDEX was enhanced to support additional types of changes to an index.
For more information on the full ALTER INDEX statements, see the SQL Reference Guide.
The following diagram shows the syntax for the new parameters for the ALTER INDEX statement:
►►─ ALTER INDEX index-name ON ┬────────────────┬ table-identifier ────►
└─ schema-name. ─┘
┌───────────────────────────────────────────┐
►─▼─┬─ INDEX BLOCK CONTAINS key-count KEYS ─┬─┴──────────────────────►◄
├─ DISPLACEMENT IS page-count PAGES ────┤
├─┬───────┬─ UNIQUE ────────────────────┤
│ └─ NOT ─┘ │
└─ IN segment-name.area-name ───────────┘
This section describes the parameters for the ALTER INDEX statement:
Specifies how far away from the index owner the bottom-level index records are stored.
If the value of page-count is zero (0), the bottom-level internal index records are not displaced from the index owner.
Limit: An unsigned integer from 0–32,767.
Specifies that the index-key value in any given row of the table on which the index is defined must be different from the index-key value in all other rows of the table. The table cannot contain any duplicate index-key values.
If you specify UNIQUE and the table contains duplicate index-key values, the alter statement will fail.
Removes the restriction that all values of the index-key within the table must be unique.
When the UNIQUE restriction is used to ensure uniqueness of a referenced key in some constraint, you cannot remove it from an index unless another index or CALC key can be used in its place.
Requests a change in the location of the named index.
Identifies a new area with which the index is to be associated. Area-name must identify an area defined in the dictionary.
Identifies the segment associated with the area.
In this example, the EMP_LNAME index is moved from its current location to the DEMO.EMPAREA area. Each internal index record will have a maximum of 30 keys and the bottom-level index records will be displaced 40 pages from the top of the index.
alter index emp_lname (last_name) on emp.benefits
displacement is 40 pages
index block contains 30 keys
in area demo.emparea;
|
Copyright © 2010 CA.
All rights reserved.
|
|