Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to view tablespace usage in Oracle12c database

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly explains "how to check the use of tablespaces in Oracle12c database". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to check the use of tablespaces in Oracle12c database.

You can view the usage of all tablespaces in the Oracle12c database through the following sql statement:

You can view the usage of all tablespaces in the Oracle12c database with the following statement:

SELECT F.TABLESPACE_NAME

(T.TOTAL_SPACE-F.FREE_SPACE) / 1024 "USED (GB)"

F.FREE_SPACE / 1024 "FREE (GB)"

T.TOTAL_SPACE / 1024 "TOTAL (GB)"

(ROUND ((F.FREE_SPACE / T.TOTAL_SPACE) * 100)) | |'% 'PER_FREE

FROM (SELECT TABLESPACE_NAME

ROUND (SUM (BLOCKS *

(SELECT VALUE / 1024

FROM V$PARAMETER

WHERE NAME = 'db_block_size') / 1024)) FREE_SPACE

FROM CDB_FREE_SPACE

GROUP BY TABLESPACE_NAME) F

(SELECT TABLESPACE_NAME, ROUND (SUM (BYTES / 1048576)) TOTAL_SPACE

FROM CDB_DATA_FILES

GROUP BY TABLESPACE_NAME) T

WHERE F.TABLESPACE_NAME = T.TABLESPACE_NAME

You can view the usage of the specified table space by adding filter criteria, as follows:

SELECT F.TABLESPACE_NAME

(T.TOTAL_SPACE-F.FREE_SPACE) / 1024 "USED (GB)"

F.FREE_SPACE / 1024 "FREE (GB)"

T.TOTAL_SPACE / 1024 "TOTAL (GB)"

(ROUND ((F.FREE_SPACE / T.TOTAL_SPACE) * 100)) | |'% 'PER_FREE

FROM (SELECT TABLESPACE_NAME

ROUND (SUM (BLOCKS *

(SELECT VALUE / 1024

FROM V$PARAMETER

WHERE NAME = 'db_block_size') / 1024)) FREE_SPACE

FROM CDB_FREE_SPACE

GROUP BY TABLESPACE_NAME) F

(SELECT TABLESPACE_NAME, ROUND (SUM (BYTES / 1048576)) TOTAL_SPACE

FROM CDB_DATA_FILES

GROUP BY TABLESPACE_NAME) T

WHERE F.TABLESPACE_NAME = T.TABLESPACE_NAME AND T.TABLESPACE_NAME LIKE 'ABC%'

At this point, I believe that everyone on the "Oracle12c database how to view tablespace usage" have a deeper understanding, might as well to the actual operation of it! Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report