Database Reference
In-Depth Information
Managing Temporary Tablespaces in CDB and PDBs
A temporary tablespace is used to improve the performance of sort operations. You can't cre-
ate a permanent schema object in a temporary tablespace, and when your session is over, any
data that was stored in the temporary tablespace for your use goes away. Also, the underlying
file type for temporary tablespaces is a temp file, which is different from a common database
data file used for permanent tablespaces.
The default configuration for a CDB is to have a single default temporary tablespace
named TEMP that is used by each PDB. You must be connected to the root to create a default
temporary tablespace for the CDB. There is one default temporary tablespace for a CDB.
Additional temporary tablespaces can be created in the root, and users can be assigned to
the additional temporary tablespaces.
For a PDB, you may create a local temporary tablespace and then set it as the default.
Additional temporary tablespaces can be created in a PDB, and users in that PDB can be
assigned to the additional temporary tablespaces. When you unplug a PDB from a CDB,
its temporary tablespaces are also unplugged.
Changing the Default Temporary Tablespace for the Root
To use a different default temporary tablespace, enter the following command:
SQL> ALTER DATABASE DEFAULT TEMPORARY TABLESPACE temp_tablespace;
System altered.
The tablespace or tablespace group specified must exist in the root. This tablespace or
tablespace group is also the default temporary tablespace for PDBs, unless you have explicitly
assigned a default temporary tablespace for a PDB, for example:
SQL> ALTER SESSION SET CONTAINER = pdb1;
Session altered.
SQL> ALTER PLUGGABLE DATABASE pdb1 DEFAULT TEMPORARY TABLESPACE temp_
tablespace_19681201;
System altered.
Search WWH ::




Custom Search