Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

CREATE SPACE - Create space

You use CREATE SPACE to create a new entry for a new user space in the database metadata and to generate the corresponding file at operating system level.

You can define up to 999 user spaces for a database.
A user space can be up to 4 TB in size on pubsets with "large files".
Otherwise it can be up to 64 GB in size.

The current authorization identifier must have the special privilege USAGE for the storage group used.

If the database catalog space is in a DB user ID, preparations must have been made, see section “Database files and job variables on foreign user IDs” in the “ Core manual”.

If the file of the catalog space was created with a password, you must also specify a password for the user space files. The password must be identical to the BS2000 password for the catalog space file.



CREATE SPACE space

   [AUTHORIZATION authorization_identifier ]

   [ PRIMARY allocation |

     SECONDARY allocation |

     PCTFREE percent |

     [NO] SHARE |

     [NO] DESTROY |

     NO LOG ] ...

   [USING STOGROUP stogroup ]




space

Name of the space. The first 12 characters of the unqualified space name must be unique within the database. You can qualify the space name with the database name.


AUTHORIZATION authorization_identifier

Name of the authorization identifier to be entered as the owner of the space.

AUTHORIZATION authorization_identifier omitted:
The current authorization identifier is entered as the owner.


You may only specify each of the following parameters once: PRIMARY, SECONDARY, PCTFREE, [NO] SHARE, [NO] DESTROY, or NO LOG.


PRIMARY allocation

Primary allocation of the space file in units of 2K (BS2000 halfpage). allocation must be an unsigned integer between 1 and 2 147 483 640.

PRIMARY allocation omitted:
PRIMARY 24 is used.


SECONDARY allocation

Secondary allocation of the space file in units of 2K (BS2000 halfpage). allocation must be an unsigned integer between 1 and 32767.

SECONDARY allocation omitted:
SECONDARY 24 is used.


PCTFREE percent

Free space reservation in the space file expressed as a percentage. percent must be an unsigned integer between 0 and 70.

PCTFREE percent omitted:
PCTFREE 20 is used.


[NO] SHARE

SHARE indicates that the space file is sharable, i.e. that the space file can be accessed from more than one BS2000 user ID of the DBH.
NO SHARE indicates that the space file is not sharable.

NO SHARE is recommended for security reasons.

[NO] SHARE omitted:
NO SHARE is used.


[NO] DESTROY

DESTROY indicates that when the space file is deleted the storage space is to be overwritten with binary zeros.
NO DESTROY means that when the space file is deleted, just the storage space is released.

[NO] DESTROY omitted:
DESTROY is used.


NO LOG

No logging.

NO LOG omitted:
The logging setting for the database is used.


USING STOGROUP stogroup

Name of the storage group containing the volumes to be used for creating the space file.

If you specify the unqualified name of the storage group, the name is automatically qualified with the database name of the schema. If you qualify the name of the storage group with a database name, this name must be the same as the database name of the space.

USING STOGROUP stogroup omitted:
The default storage group D0STOGROUP is used.

Space file at operating system level

The space file is created either under the BS2000 user ID of the DBH or of the database with the following name:

:catid:$bk.catalog.unqual_space_name

Only the first 12 characters of the unqualified space name are used for the file name.

Example

Create the space files TABLESPACE and INDEXSPCE with a primary and secondary allocation of 192 2K-entities each. Both files are to have a free space reservation of 10%. They must be sharable and are to be overwritten with binary zeros when deleted.

INDEXSPACE is to be used exclusively to store indexes. Since indexes can be restored from the primary data as part of a media recovery process. Logging is not required and is disabled with NO LOG.


CREATE SPACE tablespace PRIMARY 192 SECONDARY 192

PCTFREE 10 SHARE DESTROY USING STOGROUP stogoup1


CREATE SPACE indexspace PRIMARY 192 SECONDARY 192

PCTFREE 10 SHARE DESTROY NO LOG USING STOGOUP stogroup1

See also

ALTER SPACE, CREATE STOGROUP