|
The SQL ALTER INDEX statement is used to alters the definition of an index.
A instrução SQL ALTER INDEX é usada para alterar a definição de um índice.
Following is the index alteration syntax.
A seguir está a sintaxe de alteração do índice.
ALTER INDEX index-name
[REGENERATE]
[ADD COLUMN (column-name ASC/DESC)]
[CLUSTER | NOT CLUSTER]
[PADDED | NOT PADDED]
[using-specification]
[free-specification]
[COMPRESS YES | NO]
[ALTER partition-element
using-specification
free-specification]
[BUFFERPOOL bp-name]
[CLOSE YES | NO]
[PIECESIZE integer]
[COPY YES | NO]
|
Explanation:
- REGENERATE: Specifies that the index will be regenerated.
- ADD COLUMN: Adds column-name to the index.
- ALTER PARTITION: Identifies the partition of the index to be altered.
Explicação:
- REGENERATE: Especifica que o índice será regenerado.
- ADICIONE COLUNA: Adiciona o nome da coluna ao índice.
- ALTER PARTITION: Identifica a partição do índice a ser alterado.
Example 1 - Exemplo 1:
Alter the index DSN8910.IX_EMP.
Indicate that DB2 is not to close the data sets that support the index when there are no current users of the index.
Altere o índice DSN8910.IX_EMP.
Indique que o DB2 não deve fechar os conjuntos de dados que suportam o índice quando não há usuários atuais do índice.
ALTER INDEX DSN8910.IX_EMP
CLOSE NO;
|
Alter partitioned index DSN8910.IX_DEPT.
For partition 3, leave one page of free space for every 13 pages and 13 percent of free space per page.
For partition 5, leave one page for every 25 pages and 25 percent of free space.
For all the other partitions, leave one page of free space for every 6 pages and 11 percent of free space.
Alterar o índice particionado DSN8910.IX_DEPT.
Para a partição 3, deixe uma página de espaço livre para cada 13 páginas e 13 por cento de espaço livre por página.
Para a partição 5, deixe uma página para cada 25 páginas e 25 por cento de espaço livre.
Para todas as outras partições, deixe uma página de espaço livre para cada 6 páginas e 11 por cento de espaço livre.
ALTER INDEX DSN8910.IX_DEPT
USING
VCAT CATLGG
FREEPAGE 6
PCTFREE 11
ALTER PARTITION 3
USING VCAT CATLGG
FREEPAGE 13
PCTFREE 13,
ALTER PARTITION 5
USING VCAT CATLGG
FREEPAGE 25
PCTFREE 25;
|
Example 2 - Exemplo 2:
Alter the index DSN8910.IX_PROJ.
Use BP1 as the buffer pool that is to be associated with the index, indicate that full image or concurrent copies on the index are allowed, and change the
maximum size of each data set to 8 megabytes.
Altere o índice DSN8910.IX_PROJ.
Use BP1 como o conjunto de buffers que deve ser associado ao índice, indique que a imagem completa ou cópias simultâneas no índice são permitidas e altere o
tamanho máximo de cada conjunto de dados para 8 megabytes.
ALTER INDEX DSN8910.IX_PROJ
BUFFERPOOL BP1
COPY YES
PIECESIZE 8M;
|
Example 3 - Exemplo 3:
Assume that index IX_X1 contains a least one varying-length column and is a padded index.
Alter the index to an index that is not padded.
Suponha que o índice IX_X1 contenha pelo menos uma coluna de comprimento variável e seja um índice preenchido.
Altere o índice para um índice que não seja preenchido.
ALTER INDEX IX_X1 NOT PADDED;
|
|