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 database tablespace usage through shell scripts

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

Share

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

This article mainly introduces how to view the use of database tablespaces through shell scripts. It is very detailed and has a certain reference value. Friends who are interested must finish reading it.

The script is as follows:

Sqlplus-s $DB_CONN_STR@$SH_DB_SID = 20 then''else' * 'end) alrt

FROM sys.dba_tablespaces d

(SELECT tablespace_name, SUM (bytes) bytes

FROM dba_temp_files

GROUP BY tablespace_name order by tablespace_name) a

(SELECT tablespace_name, SUM (bytes_used) bytes

FROM v\ $temp_extent_pool

GROUP BY tablespace_name) t

(SELECT tablespace_name, MAX (bytes_cached) large

FROM v\ $temp_extent_pool

GROUP BY tablespace_name order by tablespace_name) l

WHERE d.tablespace_name = a.tablespace_name (+)

AND d.tablespace_name = t.tablespace_name (+)

AND d.tablespace_name = l.tablespace_name (+)

AND d.extent_management LIKE 'LOCAL'

AND d.contents LIKE 'TEMPORARY'

ORDER by 1

/

Prompt

Exit

EOF

The running results are relatively simple and clear.

The above is all the contents of the article "how to view database tablespace usage through shell scripts". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

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