Was this helpful?
CREATE LOCATION
Valid in: SQL, ESQL, OpenAPI, ODBC, JDBC, .NET
The CREATE LOCATION statement assigns a name to a physical disk and directory location.
For detailed information about locations, see the Database Administrator Guide. To specify the work (sorting) locations for a session, use the SET WORK LOCATIONS statement.
The CREATE LOCATION statement has the following format:
[EXEC SQL] CREATE LOCATION location_name
WITH AREA = area_name,
USAGE = (usage_type {, usage_type}) | NOUSAGE
RAWPCT = n
location_name
Specifies the name to be assigned to the disk and directory combination. Must be a valid object name.
area_name
Specifies the disk and directory location to which the location is mapped. Must be a valid operating-system specification. This parameter can be specified using a quoted string or an unquoted string that does not include special (non-alphanumeric) characters.
Limits: Path name must not exceed 126 characters.
usage_type
Specifies the types of file that can be stored at this location. Valid values are:
DATABASE
WORK
JOURNAL
CHECKPOINT
DUMP
ALL
NOUSAGE
To prevent any files from being stored at the location, specify WITH NOUSAGE.
RAWPCT=n
Defines the relative amount of the area to be allocated to the location. RAWPCT=0 is equivalent to omitting the parameter, resulting in a cooked definition. When RAWPCT is greater than zero, the only valid usage is DATABASE.
Limits: 1 to 100
Embedded Usage
In an embedded CREATE LOCATION statement, the WITH clause can be specified using a host string variable (with :hostvar). Usage_type and area_name can be specified using host string variables.
Permissions
You must have the MAINTAIN_LOCATIONS privilege and be connected to the iidbdb.
Locking
The CREATE LOCATION statement locks pages in the iilocation_info catalog.
Related Statements
ALTER LOCATION
DROP LOCATION
GRANT (privilege)
MODIFY
Locations can be assigned when creating tables or indexes by using the following statements:
CREATE INDEX
CREATE TABLE
DECLARE GLOBAL TEMPORARY TABLE
MODIFY TO RELOCATE
SET WORK LOCATIONS
Last modified date: 08/29/2024