Valid in: SQL, ESQL
The Create Location statement assigns a name to a physical disk and directory location.
To change the characteristics of an existing location, use the alter location statement. To delete an existing location, use the drop location statement. 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
Specifies the name to be assigned to the disk and directory combination. Must be a valid object 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.
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.
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
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.
You must have maintain_locations privileges and be working in a session that is connected to the iidbdb.
The Create Location statement locks pages in the iilocation_info catalog.
Locations can be assigned when creating tables or indexes by using the following statements:
Declare Global Temporary Table
The following are Create Location statement examples:
VMS:
Create a new location for databases; allow all types of files to be stored.
create location accounting_db with area = 'disk1:',
usage = (all);
Create a new location, but prevent any files from being created there.
create location new_db with area = 'disk2:',
nousage;
UNIX:
Create a location using a UNIX path.
create location extraloc
with area = '/usr/ingres_extra',
usage = journal, checkpoint;