Databases Reference
In-Depth Information
In step 5, we retrieve information about temporary datafiles; the results of this query are
shown in the next screenshot:
In step 6, we create a temporary tablespace, which we assign to the user
SH
in step 7.
We create it with the extent management local to obtain better performance than using
the dictionary managed tablespaces. Locally managed tablespaces keep track of the free
extents in a bitmap stored in the header of the first datafile of the tablespace, where
each bit is mapped to a free block in the tablespace.
The results of these operations are as follows:
In the last step, restore the
TEMP
tablespace as the default temporary tablespace for the
user
SH
and drop the temporary tablespace created in step 6.
There's more...
For each user of the database, there is a default temporary tablespace to be used to sort
the data when required. If we haven't defined a default temporary tablespace for a user, the
SYSTEM
tablespace is used to store
SORT
SEGMENTS
.
This situation is very critical, because the space in
SORT
SEGMENTS
is frequently allocated
and deallocated. When doing so, the operations become serialized as space management
autoallocates new extents when needed.