Table space usage Query

Source: Internet
Author: User

Select a. file_id file number,
A. tablespace_name tablespace name,
B. file_name physical file name,
B. autoextensible auto scaling,
B. maxbytes/1024/1024/1024 Max space G,
Total/1024/1024 tablespace MB,
Free/1024/1024 MB remaining,
(Total-free)/1024/1024 MB,
Round (total-free)/total, 4) * 100 "usage % ",
'Alter database datafile' | file_name | ''' resize 5120 m; 'SQL statement for extended tablespace
From (select file_id, tablespace_name, sum (bytes) free
From dba_free_space
Group by file_id, tablespace_name),
(Select file_id, tablespace_name, autoextensible, file_name, maxbytes, sum (bytes) Total
From dba_data_files
Group by tablespace_name, file_id, autoextensible, file_name, maxbytes) B
Where a. tablespace_name = B. tablespace_name
And a. file_id = B. file_id
Order by 1;

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.