View Oracle tablespace usage

Source: Internet
Author: User

The view SYS. dba_free_space and SYS. dba_data_files must be granted the query permission on these two view objects.

-- Connect as sysdba

Grant select on SYS. dba_free_space to Forrest;

Grant select on SYS. dba_data_files to Forrest;

View Oracle tablespace usage

-- Connect as Forrest

Select upper (F. tablespace_name) "tablespace name", D. tot_grootte_mb "tablespace 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), '2017. 99 ') "usage ratio", F. total_bytes "Free Space (m)", F. max_bytes "maximum block (m)" from (select tablespace_name, round (sum (bytes)/(1024*1024), 2) total_bytes, round (max (bytes) // (1024*1024), 2) max_bytes from sys. dba_free_space group by tablespace_name) F, (select DD. tablespace_name, round (sum (DD. bytes)/(1024*1024), 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 F. tablespace_name;

Related Article

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.