View the user's default table space

Source: Internet
Author: User

View the. SQL of the user's default table space.

Select Username,default_tablespace from Dba_users;

View the disk footprint of each table space. sql:

Select
b.file_id file ID number,
B.tablespace_name table space Name,
b.bytes/1024/1024| | ' M ' byte number,
(B.bytes-sum (NVL (a.bytes,0))/1024/1024| | ' M ' has been used,
Sum (NVL (a.bytes,0))/1024/1024| | ' M ' remaining space,
100-sum (NVL (a.bytes,0))/(b.bytes) *100 percent occupancy
From Dba_free_space A,dba_data_files b
where a.file_id=b.file_id
GROUP BY B.tablespace_name,b.file_id,b.bytes
ORDER BY b.file_id

The above 2 associations are the SQL statements that view user default table space usage:

Select *
From
(select Username,default_tablespace from dba_users) UT,
(SELECT
--b.file_id file ID number,
B.tablespace_name table space Name,
b.bytes/1024/1024| | ' M ' byte number,
(B.bytes-sum (NVL (a.bytes,0))/1024/1024| | ' M ' has been used,
Sum (NVL (a.bytes,0))/1024/1024| | ' M ' remaining space,
100-sum (NVL (a.bytes,0))/(b.bytes) *100 percent occupancy
From Dba_free_space A,dba_data_files b
where a.file_id=b.file_id
GROUP BY B.tablespace_name,b.file_id,b.bytes
ORDER by b.file_id) Tsu
Where ut.default_tablespace = tsu. Table space Name
ORDER BY Ut.username

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.