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

Queries include automatic expansion and non-automatic expansion of tablespace usage

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

Share

Shulou(Shulou.com)06/01 Report--

Select tablespace_name

Max_gb

Used_gb

Round (100 * used_gb / max_gb) pct_used

Autoextensible

From (select a.tablespace_name tablespace_name,a.autoextensible

Round ((a.bytes_alloc-nvl (b.bytes_free, 0)) / power (2,30), 2) used_gb

Round (a.maxbytes / power (2,30), 2) max_gb

From (select f.tablespace_name

Sum (f.bytes) bytes_alloc

Sum (decode (f.autoextensible, 'YES',f.maxbytes,' NO',f.bytes)) maxbytes

F.autoextensible

From dba_data_files f

Group by tablespace_name,autoextensible) a

(select f.tablespace_name, sum (f.bytes) bytes_free

From dba_free_space f

Group by tablespace_name) b

Where a.tablespace_name = b.tablespace_name (+)

Union all

Select h.tablespace_name tablespace_name,f.autoextensible

Round (sum (nvl (p.bytes_used, 0)) / power (2,30), 2) used_gb

Round (sum (decode (f.autoextensible, 'YES', f.maxbytes,' NO', f.bytes)) / power (2,30), 2) max_gb

From v$temp_space_header h, v$temp_extent_pool p, dba_temp_files f

Where p.file_id (+) = h.file_id

And p.tablespace_name (+) = h.tablespace_name

And f.file_id = h.file_id

And f.tablespace_name = h.tablespace_name

Group by h.tablespaceroomnameauthorf.autoextensible)

Order by 4

Select tablespace_name

Max_gb

Used_gb

Round (100 * used_gb / max_gb) pct_used

Autoextensible

From (select a.tablespace_name tablespace_name

A.autoextensible

Round ((a.bytes_alloc-nvl (b.bytes_free, 0)) / power (2,30)

2) used_gb

Round (a.maxbytes / power (2,30), 2) max_gb

From (select f.tablespace_name

Sum (f.bytes) bytes_alloc

Sum (decode (f.autoextensible)

'YES'

F.maxbytes

'NO'

F.bytes)) maxbytes

F.autoextensible

From dba_data_files f

Group by tablespace_name, autoextensible) a

(select f.tablespace_name, sum (f.bytes) bytes_free

From dba_free_space f

Group by tablespace_name) b

Where a.tablespace_name = b.tablespace_name (+)

Union all

Select h.tablespace_name tablespace_name

F.autoextensible

Round (sum (nvl (p.bytes_used, 0)) / power (2,30), 2) used_gb

Round (sum (decode (f.autoextensible)

'YES'

F.maxbytes

'NO'

F.bytes) / power (2,30)

2) max_gb

From v$temp_space_header h, v$temp_extent_pool p, dba_temp_files f

Where p.file_id (+) = h.file_id

And p.tablespace_name (+) = h.tablespace_name

And f.file_id = h.file_id

And f.tablespace_name = h.tablespace_name

Group by h.tablespace_name, f.autoextensible)

Order by 4

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

Wechat

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

12
Report