Changes the read/write mode, changes the size, or extends an existing dbspace.
ALTER DBSPACE dbspace-name { ADD 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 | STRIPING{ ON | OFF } | STRIPESIZEKB size-in-KB ALTER FILE file-name { READONLY | [ FORCE ] READWRITE } | SIZE file-size [ KB | MB | GB | TB ] | ADD file-size [ KB | MB | GB | TB | 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 ] ]
A catalog dbspace may contain only one file, so ADD FILE may not be used on catalog dbspaces.
For an RLV dbspace, use ADD FILE on simplex servers only. You cannot add a file to a multiplex RLV dbspace.
When used in the ALTER FILE clause, extends the size of the file in units of pages, kilobytes (KB), megabytes (MB), gigabytes (GB), or terabytes (TB). The default is MB. You can ADD only if the free list (an allocation map) has sufficient room and if the dbspace has sufficient reserved space.
When used with the ALTER FILE clause, renames the specified file’s logical name to a new name. The new name must be unique in the database.
When used with the ALTER FILE clause, changes the specified file to read-only. The file must be associated with an IQ main dbspace. You cannot change files in IQ_SHARED_TEMP to READONLY status.
When used with the ALTER FILE clause, changes specified IQ main or temporary store dbfile to read-write. The file must be associated with an IQ main or temporary dbspace.
You may not rename the path of a file in IQ_SYSTEM_MAIN, because if the new path were not accessible, the database would be unable to start. If you need to rename the path of a file in IQ_SYSTEM_MAIN, make the file read-only, empty the file, drop the file, and add the file again with the new file path name. Enclose the physical file path to the dbfile in single quotes.
ALTER DBSPACE DspHist READONLY
ALTER DBSPACE DspHist ALTER FILE FileHist3 ADD 500MB
ALTER DBSPACE DspHist ADD FILE FileHist3 '/History1/data/file3' SIZE 500MB, FILE FileHist4 '/History1/data/file4' SIZE 500
ALTER DBSPACE IQ_SYSTEM_TEMP ADD 2 GB
ALTER DBSPACE DspHist DROP FILE FileHist2, FILE FileHist4
ALTER DBSPACE IQ_SYSTEM_MAIN ADD 1000
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.
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.
SQL—Vendor extension to ISO/ANSI SQL grammar.
Sybase—Not supported by Adaptive Server Enterprise.
Requires the MANAGE ANY DBSPACE system privilege.