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.
The operating environment of this tutorial: Windows 10 system, Oracle 11g version, Dell G3 computer.
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:
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:
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;.
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!