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

Determining the Number of Rows in the Fragment

You can place as many rows into a fragment as the available space in the partition, dbspace, or dbslice allows.

To find out how many rows are in a fragment
  1. Run the UPDATE STATISTICS statement on the table. This step fills the sysfragments system catalog table with the current table information.
  2. Query the sysfragments system catalog table to examine the npused and nrows values. The npused column shows the number of data pages used in the fragment, and the nrows column shows the number of rows in the fragment.

ATTACH Clause

Use the ATTACH clause of the ALTER FRAGMENT ON TABLE statement to combine tables that have identical structures into a fragmentation strategy.

Read syntax diagramSkip visual syntax diagramATTACH Clause:
 
|--ATTACH------------------------------------------------------->
 
   .-,-----------------------------------------------------------------------------------------------------------.
   V    (1)                                                                                                      |
>----+--------surviving_table-+--+-----------------------------------------------------------------------------+-+--|
     '-consumed_table---------'  |                                                                      (3)    |
                                 '-AS--+----------------------------+--+-expr--+----------------------+------+-'
                                       |  (2)                       |  |       | .-AFTER--.           |      |
                                       '--------PARTITION--new_frag-'  |       '-+--------+--old_frag-'      |
                                                                       |         '-BEFORE-'                  |
                                                                       |  (1)    (2)                         |
                                                                       '---------------REMAINDER-------------'
 

Notes:
  1. Use path no more than once
  2. Dynamic Server only; required if another surviving_table fragment has same name as dbspace
  3. Required for fragmentation by expression; optional for round-robin fragmentation

Element Description Restrictions Syntax
consumed
_table
Table that loses its identity to be merged with surviving_table Must exist. Cannot include serial columns nor unique, referential, or primary key constraints. See also General Restrictions for the ATTACH Clause. Database Object Name
expr Expression defining which rows are stored in a fragment of a fragmented-by-expression table Can include only columns from the current table and only data values from a single row. See also General Restrictions for the ATTACH Clause. Condition ;
Expression
new_frag Name declared here for consumed_table fragment. Default is the dbspace name. Must be unique among the names of partitions and of dbspaces that store fragments of surviving_table Identifier
old_frag Partition or dbspace where a surviving_table fragment exists Must exist. See also Altering Hybrid-Fragmented Tables (XPS). Identifier
surviving
_table
Table on which to modify the distribution or storage location Must exist. Cannot have any constraints. See also Restrictions on the ALTER FRAGMENT Statement. Database Object Name

To use this clause, you must have the DBA privilege or else be the owner of the specified tables. The ATTACH clause supports the following tasks:

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