RENAME TABLESPACE statement

The RENAME TABLESPACE statement renames an existing table space.

Invocation

This statement can be embedded in an application program or issued through the use of dynamic SQL statements. It is an executable statement that can be dynamically prepared only if DYNAMICRULES run behavior is in effect for the package (SQLSTATE 42509).

Authorization

The privileges held by the authorization ID of the statement must include either SYSCTRL or SYSADM authority.

Syntax

Read syntax diagramSkip visual syntax diagramRENAMETABLESPACEsource-tablespace-name TOtarget-tablespace-name

Description

source-tablespace-name
Specifies the existing table space that is to be renamed, as a one-part name. It is an SQL identifier (either ordinary or delimited). The table space name must identify a table space that already exists in the catalog (SQLSTATE 42704).
target-tablespace-name
Specifies the new name for the table space, as a one-part name. It is an SQL identifier (either ordinary or delimited). The new table space name must not identify a table space that already exists in the catalog (SQLSTATE 42710), and it cannot start with 'SYS' (SQLSTATE 42939).

Rules

  • The SYSCATSPACE table space cannot be renamed (SQLSTATE 42832).
  • Any table spaces with rollforward pending or rollforward in progress states cannot be renamed (SQLSTATE 55039)

Notes

  • Renaming a table space will update the minimum recovery time of a table space to the point in time when the rename took place. This implies that a roll forward at the table space level must be to at least this point in time.
  • The new table space name must be used when restoring a table space from a backup image, where the rename was done after the backup was created.

Example

Change the name of the table space USERSPACE1 to DATA2000:
   RENAME TABLESPACE USERSPACE1 TO DATA2000