Oracle View tablespace Usage

Source: Internet
Author: User



View Tablespace usage


Select Upper (F.tablespace_name) "Table space name",
D.TOT_GROOTTE_MB "Table space Size (m)",
D.tot_grootte_mb-f.total_bytes "used Space (m)",
To_char (Round (d.tot_grootte_mb-f.total_bytes)/d.tot_grootte_mb * 100,
2),
' 990.99 ') "Use ratio",
F.total_bytes "spare space (m)",
F.max_bytes "Max Block (m)"
From (select Tablespace_name,
Round (sum (bytes)/(1024x768 * 1024x768), 2) Total_bytes,
Round (max (bytes)/(1024x768), 2) max_bytes
From Sys.dba_free_space
GROUP by Tablespace_name) F,
(Select Dd.tablespace_name,
Round (sum (dd.bytes)/(1024x768 * 1024x768), 2) TOT_GROOTTE_MB
From Sys.dba_data_files DD
Group by Dd.tablespace_name) d
where d.tablespace_name = F.tablespace_name
ORDER BY 4 Desc;


To view the size of each table in a table space

Select Segment_name, Isize | | M
From (select Segment_name, sum (bytes)/1024/1024 isize
From Dba_segments
where tablespace_name = ' snbst_hist '
and Segment_type = ' TABLE '
GROUP by Segment_name)
ORDER BY isize Desc;


View tablespace file Usage size

SELECT b.tablespace_name table Space,
B.file_name Physical file name,
b.bytes/1024/1024 size M,
(B.bytes-sum (NVL (a.bytes, 0))/1024/1024 used M,
SUBSTR ((B.bytes-sum (NVL (a.bytes, 0))/(b.bytes) * 100, 1, 5) utilization
From Dba_free_space A, Dba_data_files B
WHERE a.file_id = b.file_id
GROUP by B.tablespace_name, B.file_name, b.bytes
ORDER by B.tablespace_name;

Oracle View tablespace Usage

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.