Classifying Tablespaces
Classifying Tablespaces#
The tablespaces provided in Altibase can be classified into three kinds based on the three following criteria. A single type of tablespace can have more than one of the properties listed below:
-
Where the Data are Stored
-
By What Data are Stored
-
By Who the Creator is
By Where the Data are Stored#
Altibase tablespaces can be classified depending on where the data are stored as follows:
-
Memory-Resident Tablespace
-
Disk Tablespace
Memory-Resident Tablespace#
Memory-resident tablespaces are classified as either memory tablespace or volatile tablespace based on whether logging is performed and on whether disk image files exist.
Memory tablespaces are tablespaces for storing objects in memory. Because all objects stored in memory tablespaces use memory-based database technology, the user can access data in real time. However, the size of memory tablespaces is limited by the amount of physical memory space that is available in the system.
Volatile tablespaces are tablespaces for storing objects in memory without disk I/O operations. Because all objects stored in volatile tablespaces use memory-based database technology and additional technologies, the user can access data in real time. However, the size of the volatile tablespace cannot exceed the available physical memory space of the system, and all volatile data objects will be lost when the database server shuts down.
Disk Tablespace#
A disk tablespace is a tablespace for storing disk-based objects. It is intended for the management of large amounts of data rather than for rapid data access. Accessing objects that are stored in disk tablespaces entails disk I/O. Because this disk I/O expense accounts for most of the data access time, disk tablespaces use memory buffers to reduce disk I/O expenses.
By What Data are stored#
Altibase tablespaces can also be classified depending on what data are stored in them as follows:
- Dictionary Tablespace
- Undo Tablespace
- Temporary Tablespace
- Data Tablespace
The Dictionary Tablespace#
The dictionary tablespace is the tablespace for storing the meta data that are required for system operation. A database can have only one dictionary tablespace, which is automatically created by the system when a database is created. Users cannot create objects in dictionary tablespace; only the system can create system objects for managing meta data. In order to ensure fast access to meta data, the dictionary tablespace exists in memory. If the dictionary tablespace crashes, the entire database becomes inoperable, in which case the database will need to be restored through backup andmediarecovery.
The Undo Tablespace#
The undo tablespace is for storing undo images that remain after operations are conducted on disk objects. Since Altibase uses Multi-Version Concurrency Control, it requires space in which to store images that show the state of data before changes were made. These so-called "before images" are stored in the undo tablespace.
Only one undo tablespace can exist in the database, and it is shared by all disk tablespaces in the database. This makes the undo tablespace essential for system operation, like the dictionary tablespace. It can be backed up, but the entire tablespace must be backed up at one time.
Temporary Tablespace#
A temporary tablespace is a tablespace for storing temporary results generated during query execution. As a result, all data in the temporary tablespace pertaining to the query disappear when the associated transaction is completed.
With this type of tablespace, concurrency control, logging for recovery and the like are not conducted, enabling fast read and write speeds. There can be more than one temporary tablespace in the database, and users can create user-defined temporary tablespaces as desired. Note that temporary tablespaces cannot be backed up.
Data Tablespace#
Data tablespaces are for storing user-defined objects. There can be more than one data tablespace in the database, and the user can create a data tablespace as a disk, memory, or volatile tablespace based on the characteristics of the data to be stored therein.
By Who the Creator Is#
Additionally, Altibase tablespaces can be classified by who created them as follows:
-
System Tablespace
-
User-defined Tablespace
System Tablespace#
A system tablespace is a tablespace for storing data required for the operation system. The system tablespaces include the system dictionary tablespace, system undo tablespace, system data tablespace, and system temporary tablespace. System tablespaces are created when the database is created, and cannot be deleted or renamed by users. Backup andmediarecovery can be performed for system tablespaces.
User-defined Tablespace#
A user-defined tablespace is a tablespace for storing the content of user-defined objects. The meta data pertaining to objects defined in user-defined tablespaces are stored in the dictionary tablespace. User-defined tablespaces can be explicitly deleted or renamed by users. Additionally, backup andmediarecovery can be performed for entire tablespaces.
Tablespace List#
Multiple tablespaces are created when a database is created.
As shown in the below table, these include the system tablespaces, temporary tablespaces, and basic memory and disk tablespaces for direct use by users.
In addition, users can add more tablespaces using the 'CREATE TABLESPACE' statement.
[Table 6-2] Tablespace List
ID | Tablespace Type | Data Storage Location | Tablespace Name | Time of Creation |
---|---|---|---|---|
0 | SYSTEM DICTIONARY TABLESPACE | Memory | SYS_TBS_MEM_DIC | CREATE DATABASE |
1 | SYSTEM MEMORY DEFAULT TABLESPACE | Memory | SYS_TBS_MEM_DATA | CREATE DATABASE |
2 | SYSTEM DISK DEFAULT TABLESPACE | Disk | SYS_TBS_DISK_DATA | CREATE DATABASE |
3 | SYSTEM UNDO TABLESPACE | Disk | SYS_TBS_DISK_UNDO | CREATE DATABASE |
4 | SYSTEM DISK TEMPORARY TABLESPACE | Disk | SYS_TBS_DISK_TEMP | CREATE DATABASE |
>=5 | USER MEMORY DATA TABLESPACE | Memory | User-Defined | CREATE MEMORY DATA TABLESPACE |
>=5 | USER DISK DATA TABLESPACE | Disk | User-Defined | CREATE DISK DATA TABLESPACE |
>=5 | USER DISK TEMPORARY TABLESPACE | Disk | User-Defined | CREATE DISK TEMPORARY TABLESPACE |
>=5 | USER VOLATILE DATA TABLESPACE | Memory | User-Defined | CREATE VOLATILE DATA TABLESPACE |