Reorganization of a Single Object 

SAPDBA actions to reorganize a table or index (script name):

Preparation Phase

1. Generates the < timestamp > subdirectory in the working directory and the log <timestamp>.rsi .

2. Generates the SQL and shell scripts and the restart file restart.rsi in the < timestamp > subdirectory (see Restart File for Reorganizations).

3. Checks whether the object for reorganization will fit in the freespace that will be available once the object has been deleted.

See Freespace Check During Reorganization of a Single Object.

SAPDBA: Reorganization Menu

Main Phase

  1. If necessary, temporarily renames the table to be reorganized or the table affected by the reorganization in order to save the data ( nam<TSP>.sql , see HideTab option in SAPDBA: Reorganization Menu).
  2. Exports the table ( exp<TSP>.sh or unl<TSP>.sh and if necessary exc<TSP>.sh ); not in the case of an index reorganization or when using Create table... as select).
  3. If necessary, performs a test import to check the readability of the export dump files ( imx<TSP>.sh , see CheckExp option).
  4. Deletes the object ( dro<TSP>.sql ); not with Create table... as select; not in Deferred mode, here it renames the table temporarily instead.
  5. Merges all the remaining adjoining freespace fragments of the entire database using Oracle functions.
  6. Recovery of the table, with any comments; with Create table ... as select the old table is deleted in this step and the new table is renamed with the old name ( tab<TSP>.sql ).
  7. Imports the table data (with any indexes, constraints and grants) ( imp<TSP>.sh or ldr<TSP>.sh and maybe imc<TSP>.sh , ind<TSP>.sql , con<TSP>.sql , grants.sql ); in an index reorganization only the index and maybe the constraint are recovered ( ind<TSP>.sql , con<TSP>.sql ).
  8. Delete the renamed table, if it is in Deferred mode (see the option DropTab in SAPDBA: Reorganization Menu).
  9. If necessary, sets back the name of the table which was temporarily renamed for data protection (see step 4) ( ren<TSP>.sql , see HideTab option in SAPDBA: Reorganization Menu).