Enterprise Edition Home | Express Edition Home | Previous Page | Next Page   SQL Statements >

ALTER FRAGMENT

Use the ALTER FRAGMENT statement to change the distribution strategy or the storage location of an existing table or index.

This statement is an extension to the ANSI/ISO standard for SQL.

Syntax

Read syntax diagramSkip visual syntax diagram>>-ALTER FRAGMENT ON-------------------------------------------->
 
                                                 (1)
>--+-TABLE--surviving_table--+-| ATTACH Clause |---------------+-+-><
   |                         |                   (2)           | |
   |                         +-| DETACH Clause |---------------+ |
   |                         |                 (3)             | |
   |                         +-| INIT Clause |-----------------+ |
   |                         |                (4)              | |
   |                         +-| ADD Clause |------------------+ |
   |                         |  (5)                   (6)      | |
   |                         '------+-| DROP Clause |--------+-' |
   |                                |                   (7)  |   |
   |                                '-| MODIFY Clause |------'   |
   |  (5)                                             (3)        |
   '--------INDEX--surviving_index--+-| INIT Clause |--------+---'
                                    |                (4)     |
                                    +-| ADD Clause |---------+
                                    |                 (6)    |
                                    +-| DROP Clause |--------+
                                    |                   (7)  |
                                    '-| MODIFY Clause |------'
 
Notes:
  1. See ATTACH Clause
  2. See DETACH Clause
  3. See INIT Clause
  4. See ADD Clause
  5. Dynamic Server only
  6. See DROP Clause (IDS)
  7. See MODIFY Clause (IDS)

Element Description Restrictions Syntax
surviving
_index
Index on which to modify the distribution or storage Must exist when the statement executes Database Object Name
surviving
_table
Table on which to modify the distribution or storage Must exist. See Restrictions on the ALTER FRAGMENT Statement. Database Object Name

Usage

The ALTER FRAGMENT statement applies only to table fragments or index fragments that are located at the current site (or the current cluster, for Extended Parallel Server). No remote information is accessed or updated.

You must have the Alter or the DBA privilege to change the fragmentation strategy of a table. You must have the Index or the DBA privilege to alter the fragmentation strategy of an index.

Attention:
This statement can cause indexes to be dropped and rebuilt. Before undertaking alter operations, check corresponding sections in your IBM Informix Performance Guide to review effects and strategies.

Clauses of the ALTER FRAGMENT statement support the following tasks.

Clause
Effect
ATTACH
Combines two or more tables that have the same schema into a single fragmented table
DETACH
Detaches a table fragment (or in Extended Parallel Server, a slice) from a fragmentation strategy, and places it in a new table
INIT
Provides the following options:
  • Defines and initializes a fragmentation strategy on a table
  • Creates a fragmentation strategy for tables
  • Changes the order of evaluation of fragment expressions
  • Alters the fragmentation strategy of a table or index
  • Changes the storage location of an existing table
ADD
Adds an additional fragment to an existing fragmentation list
DROP
Drops an existing fragment from a fragmentation list
MODIFY
Changes an existing fragmentation expression

Use the CREATE TABLE statement or the INIT clause of the ALTER FRAGMENT statement to create fragmented tables.

After a dbspace has been renamed successfully by the onspaces utility, only the new name can reference the renamed dbspace. Existing fragmentation strategies for tables or indexes are automatically updated, however, by the database server to replace the old dbspace name with the new name. You do not need to take any additional action to update a distribution strategy or storage location that was defined using the old dbspace name, but you must use the new name if you reference the dbspace in an ALTER FRAGMENT or ALTER TABLE statement.

Enterprise Edition Home | Express Edition Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]