ALTER DBSPACE Statement

Changes the read/write mode, changes the size, or extends an existing dbspace.

Syntax

ALTER DBSPACE dbspace-nameADD new-file-spec  [, new-file-spec ... ]
   | DROP FILE logical-file-name [, FILE logical-file-name ... ] 
   | RENAME TO newname |  RENAME 'new-file-pathname' 
   | READONLY |  READWRITE
   |  ONLINE  |  OFFLINE
   | STRIPINGON |  OFF }
   | STRIPESIZEKB size-in-KB
ALTER FILE file-nameREADONLY  |  [ FORCE ] READWRITE }
   | SIZE file-sizeKB | MB | GB | TB ]
   | ADD file-size  [ KB  |  MB  |  GBTB  | PAGES ] }
RENAME PATH  'new-file-pathname'
RENAME TO newname

new-file-spec:
   FILE logical-file-name 'file-path' iq-file-opts

iq-file-opts:
   [ [ SIZE  ] file-size ]
   …[ KB | MB  | GB  | TB ] ]
    [ RESERVE reserve-size [ KB | MB | GB | TB ] ] 

Parameters

Examples

Usage

ALTER DBSPACE changes the read-write mode, changes the online/offline state, alters the file size, renames the dbspace name, file logical name or file path, or sets the dbspace striping parameters. For details about existing dbspaces, run sp_iqdbspace procedure, sp_iqdbspaceinfo procedure, sp_iqfile procedure, sp_iqdbspaceobjectinfo, and sp_iqobjectinfo. Dbspace and dbfile names are always case-insensitive. The physical file paths are case-sensitive, if the database is CASE RESPECT and the operating system supports case-sensitive files. Otherwise, the file paths are case-insensitive.

Enclose dbspace and dbfile names either in no quotes or in double quotes.

In Windows, if you specify a path, any backslash characters (\) must be doubled if they are followed by an n or an x. This prevents them being interpreted as a newline character (\n) or as a hexadecimal number (\x), according to the rules for strings in SQL. It is safer to always double the backslash.

Side effects:
  • Automatic commit

  • Automatic checkpoint

  • A mode change to READONLY causes immediate relocation of the internal database structures on the dbspace to one of the read-write dbspaces.

Standards

  • SQL—Vendor extension to ISO/ANSI SQL grammar.

  • Sybase—Not supported by Adaptive Server Enterprise.

Permissions

Requires the MANAGE ANY DBSPACE system privilege.

Related reference
CREATE DATABASE Statement
CREATE DBSPACE Statement
DROP Statement