Get the App
SLTechnology News&Howtos  ›  Database  › 

How to view the remaining tablespaces in Oracle database

Shulou Source: shulou.com Published: 2022-05-31 15:19:41 10月04日 Update

This article is about how to view the rest of the Oracle database tablespaces. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

1) View the name and size of the tablespace physical file

SELECT tablespace_name

File_id

File_name

Round (bytes/ (1024 / 1024 / 1024), 2) | | 'GB' total_space

FROM dba_data_files

ORDER BY tablespace_name

2) View the use of tablespaces

SELECT round (SUM (bytes) / (1024 / 1024 / 1024), 2) | 'GB' AS free_space, tablespace_name

FROM dba_free_space

GROUP BY tablespace_name

3) View the use of tablespaces

SELECT a.tablespace_name

Round (a.bytes/ (1024 / 1024 / 1024), 2) | | 'GB' total

Round (b.bytes/ (1024 / 1024 / 1024), 2) | | 'GB' used

Round (c.bytes/ (1024 / 1024 / 1024), 2) | | 'GB' free

Round ((b.bytes * 100) / a.bytes) | |'%'"% USED'

Round ((c.bytes * 100) / a.bytes) | |'%'"% FREE'

FROM sys.sm$ts_avail a, sys.sm$ts_used b, sys.sm$ts_free c

WHERE a.tablespace_name = b.tablespace_name

AND a.tablespace_name = c.tablespace_name

Thank you for reading! This is the end of the article on "how to view the remaining tablespaces in Oracle database". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it out for more people to see!

Tags: Space data database remaining content situation more articles good practical name size files articles physics look knowledge reference help related Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Linux Shulou Information Shulou Tech Info vpn OPPO Reno