Home >Database >Oracle >How to check which table spaces Oracle has

How to check which table spaces Oracle has

WBOY
WBOYOriginal
2022-05-13 14:48:4826832browse

Method: 1. Use the "select * from user_users" statement to view the table spaces used by the current user; 2. Use the "select * from Dba_Tablespaces" statement to view all table spaces under the database. The result includes the table space name. And the size of the table space, etc.

How to check which table spaces Oracle has

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

How to check the table spaces in Oracle

1. To check the table spaces used by the current user, use the command select * from user_users, where username identifies the user name and default_tablespace represents the default table space.

Examples are as follows:

How to check which table spaces Oracle has

2. To view all table spaces under Oracle, use the command select * from Dba_Tablespaces. The information presented includes the table space name. And the size of the table space, etc.

Examples are as follows:

How to check which table spaces Oracle has

Table space is a very important resource. If we want to check the usage of table space, such as table space utilization and other indicators, First of all, the user we query must have dba permissions. Just use the following command to query.

View the name, location and size information of the table space physical files. Table space files are usually stored with the suffix of dbf.

Some statements querying the table space require high permissions for the user to execute. How to check the role of the current user? Just use the command select * from user_role_privs.

After querying the table space information, we sometimes need to delete the useless table space. Just use the command drop tablespace xxx including contents and datafiles;.

How to check which table spaces Oracle has

Recommended tutorial: "Oracle Video Tutorial"

The above is the detailed content of How to check which table spaces Oracle has. 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