Reorganizing Tables at the Database Level

Reorganize a table at the database level to improve performance.

Prerequisites

You must be a system administrator, or have reorg any table permissions when granular permissions is enabled.

Task
You can reorganize only one database at a time.
  1. In the left pane of the Administration Console, expand ASE Servers > Schema Objects > Database , then choose one of the following:
    • User Databases
    • System Databases
    • Temporary Databases
    • Proxy Databases
  2. Click the Name field of the database, then click the drop-down arrow and select Reorganize Tables.
  3. On the Select tables screen, choose all tables, exclude system tables, or search for a table.
    • To reorganize all tables in the database, click Select all tables.
    • To search for a table by name, click Use search criteria, select Name contains, enter the table name, and click Search. Select one or more tables from the list.
    • To search for a table by space utilization, click Use search criteria, select Space utilization <=, enter the value, and click Search. Select one or more tables from the list.
    • Choose whether to select Exclude system tables.
  4. On the Commands screen, select the type and level of reorganization.
    Option Description Restrictions
    Compact Reclaim space and remove row forwarding. Not supported with all-pages-locked tables.
    Defragmentation Reorganize data and allow concurrent reads or writes. Not supported with:
    • Tables without an index (tables must have at least one index)
    • System tables
    • All-pages-locked tables
    Forwarded rows Remove row forwarding. Not supported with all-pages-locked tables.
    Rebuild
    • Remove row forwarding and reclaim unused page space.
    • Rewrite all rows to accord with a clustered index for a table, if it has one.
    • Write rows to data pages to accord with any changes made in space management settings through sp_chgattribute.
    • Drop and re-create all indexes belonging to the table.

    Requires that the select into database option to be true.

    Not supported with system tables.

    Reclaim space Reclaim unused page space resulting from deletions and row-shortening updates. Not supported with all-pages-locked tables.
  5. On the Options screen, select your reorganization options.
    Option Description Restrictions
    Compress Compress the rows affected by the reorganization. Available only when one of these reorganization types is selected:
    • Compact
    • Forwarded rows
    • Reclaim space

    Not available on SAP ASE versions earlier than 15.7.

    Resume Start reorganization at the point in a table where the previous reorganization left off. Available only when one of these reorganization types is selected:
    • Compact
    • Forwarded rows
    • Reclaim space
    • Defragmentation, and resuming reorganization on a single table is feasible.
    Time Specify the length of time allowed for running reorganization. Available only when one of these reorganization types is selected:
    • Compact
    • Forwarded rows
    • Reclaim space
    • Defragmentation
    Skip compact extents Specify the occupancy threshold of the extent. SAP ASE reorganizes only the extents for which compactness falls below the occupancy threshold; extents with a compactness higher than the threshold are not reorganized.

    The compactness of an extent is measured as the percentage range (1 – 100) occupancy in that extent (80 is the default).

    Compactness = (Total space occupied in an extent / Total space in an extent) x 100.

    Available only when Defragmentation is selected.
  6. Review the Summary page and click Finish.
Related concepts
Enabling Granular Permissions