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 does mysql query tablespace usage

2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

This article mainly explains "how to query the use of tablespaces in mysql". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Next let the editor to take you to learn "mysql how to query tablespace usage" bar!

SELECT a.tablespace_name

Round (a.total_size, 1) "total (M)"

Round (a.max_size, 1) "max (M)"

Round (a.total_size)-round (nvl (b.free_size, 0), 1) "used (M)"

Round (nvl (b.free_size, 0), 1) "free (M)"

Round (nvl (b.free_size, 0) / total_size * 100,1) "free rate (%)"

Round (nvl (a.max_size-

(round (a.total_size)-round (nvl (b.free_size, 0), 1))

0) / max_size * 100

1) "free rate2 (%)"

FROM (SELECT tablespace_name

SUM (bytes) / 1024 / 1024 total_size

SUM (CASE

WHEN autoextensible = 'NO' THEN

Bytes

ELSE

Maxbytes

END) / 1024 / 1024 max_size

FROM dba_data_files

GROUP BY tablespace_name) a

(SELECT tablespace_name, SUM (bytes) / 1024 / 1024 free_size

FROM dba_free_space

GROUP BY tablespace_name) b

WHERE a.tablespace_name = b.tablespace_name (+)

At this point, I believe you have a deeper understanding of "mysql how to query tablespace usage". You might as well do it in practice. 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