ALLBASE/SQL Reference Manual (36216-90216)

366 Chapter10
SQL Statements A - D
CREATE TEMPSPACE
file) should fit within the space available in the partition where the TempSpace is
located. Use the HP-UX bdf command to determine the space available in a partition.
The location and characteristics of the TempSpace are stored in the system catalog.
TempSpace files are physically created only when needed. When the TempSpace is no
longer needed (the present task completes), the temporary file or files are deleted and
the space is available for use again.
The directory specified must be accessible to the DBEnvironment. The directory must
be accessible to hpdb for both read and write operations. If this read-write (rw)
capability is not granted or if the directory does not exist when a TempSpace is created,
errors are returned.
If the TempSpace cannot be accessed when a statement requiring temporary space is
issued, a system error is returned due to failure in opening the temporary file.
To delete the definition of a TempSpace, use the DROP TEMPSPACE statement.
Authorization
You must have DBA authority to use this statement. hpdb must have write permission in
the directory where the TempSpace files will reside.
Example
TempSpace temporary files are created in the /sort/PurchDB directory when SQL
Statements require sorting.
CREATE TEMPSPACE ThisTempSpace WITH MAXFILEPAGES = 360,
LOCATION = '/sort/PurchDB'
TempSpace temporary files are no longer available in the /sort/PurchDB, directory but can
be allocated under /tmp as needed.
DROP TEMPSPACE ThisTempSpace