REORG TABLE command using the ADMIN_CMD procedure

The REORG TABLE command reorganizes a table by reconstructing the rows to eliminate fragmented data, and by compacting information. On a partitioned table, you can reorganize a single partition.

Scope

This command affects all database partitions in the database partition group.

Authorization

One of the following authorities:
  • SYSADM
  • SYSCTRL
  • SYSMAINT
  • DBADM
  • SQLADM
  • CONTROL privilege on the table.

Required connection

Database

Command Syntax

For command syntax details, see the REORG TABLE command.

Example

Reorganize the tables in a database partition group that consists of database partitions 1, 3 and 4.
CALL SYSPROC.ADMIN_CMD ('REORG TABLE employee 
   INDEX empid ON DBPARTITIONNUM (1,3,4)')

Usage notes

For the full list of usage details, see the REORG TABLE command.

Restrictions:
  • Command execution status is returned in the SQLCA resulting from the CALL statement.
  • The REORG utility issue a COMMIT statement at the beginning of the operation, which with Type 2 connections, causes the procedure to return SQL30090N with reason code 2.
  • For the full list of restrictions, see the REORG TABLE command.