Reorganization of a Tablespace 

SAPDBA actions to reorganize a tablespace (without data file reorganization) (script name):

Preparation Phase

  1. Generates the <timestamp> subdirectory in the working directory and the log <timestamp>.rtc .
  2. Generates the SQL and shell scripts and the restart file restart.rtc in the < timestamp > subdirectory (see Restart File for Reorganizations).
  3. Checks whether the extents to be reorganized fit in the data file(s) of the tablespace; see Freespace Check During Reorganization of a Tablespace
  4. SAPDBA: Reorganization Menu

Main Phase

1. If necessary, temporarily renames the tables to be reorganized or to be affected by the reorganization ( nam<TSP>.sql , see HideTab option in the SAPDBA: Reorganization Menu).

2. Only when exporting to tape (due to interactive export mode):
Deletes all the index statistics (
alt<TSP>.sql ) as well as any constraints ( drc<TSP>.sql ).

3. Exports all tables and indexes of the tablespace ( exp<TSP>.sh or unl<TSP>.sh and if necessary exc<TSP>.sh ; not with Create table ... as select); see also Parallel Export/Import.

4. If necessary, performs a test import to check the readability of the export dump files ( imx<TSP>.sh , see CheckExp option in the SAPDBA: Reorganization Menu).

5. Deletes the tables and indexes ( dro<TSP>.sql ); not with Create table ... as select.

6. Merges all the remaining adjoining freespace fragments of the entire database using Oracle functions.

7. Recovery of the tables, if necessary with 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 ).

8. Imports the table files, indexes, grants, comments and constraints ( imp<TSP>.sh or ldr<TSP>.sh and if necessary imp<TSP>.sh , ind<TSP>.sql , con<TSP>.sql , grants.sql ).

9. If necessary, sets back the names of the tables temporarily renamed (under step 1) for data protection ( ren<TSP>.sql , see HideTab option).