Home  >  Article  >  Database  >  How to query the default tablespace of the database in Oracle

How to query the default tablespace of the database in Oracle

青灯夜游
青灯夜游Original
2022-02-22 18:10:499780browse

In Oracle, you can query the database table space through the select statement to query the data dictionary DBA_USERS. The syntax "select * from dba_tablespaces;" can return description information containing all table spaces in the database.

How to query the default tablespace of the database in Oracle

The operating environment of this tutorial: Windows 7 system, Oracle 11g version, Dell G3 computer.

Oracle table space

Oracle table space is a container for Oracle data objects and data storage. Oracle table space often appears in pairs with data files. , one table space can correspond to multiple data files, and one data file can only be in one table space. When we create a table space, a data file will be created by default. Similarly, when we create a data file, we must specify a table space.

Oracle database storage data is composed of table spaces. Multiple data files are stored in a table space. Oracle data (tables, indexes, etc.) are stored in data files and in table spaces. The logical unit is segment. For example:

When we create an index, we will create an index segment named after the index name in the specified table space, and then create one or more extents in the index segment. (extent), used to store index data. One section can only exist in one data file. Further subdivided, a section can be divided into multiple blocks. Block is the smallest unit of space allocation in Oracle database.

A file is generally not stored continuously in disk space. Therefore, the segments in the table space are composed of segments in different data files.

oracle query the table space of the database

#If you want to view all the default table spaces of the database, you can query it through the data dictionary dba_tablespaces, which can return the database containing Description information of all table spaces in .

select * from dba_tablespaces;

As shown below:

How to query the default tablespace of the database in Oracle

Recommended tutorial: "Oracle Tutorial"

The above is the detailed content of How to query the default tablespace of the database in Oracle. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn