Oracle DB , 計算各個用戶/schema 的磁盤占用空間


http://www.dba-oracle.com/t_find_size_schema.htm

Question:  How do I find the size of a schema in my database?

Answer: It depends on how you define "size".  If you want the total disk space consumed by the schema (including indexes, tablespace free space), then the SQL query is quite simple:

select 
   owner,
   sum(bytes)/1024/1024/1024 schema_size_gig
from 
   dba_segments 
group by 
   owner;

 

If you just want the size of the schema in terms of the space consumed by table rows, you would use a different query to calculate the schema size:

select 
   sum(bytes)/1024/1024/1024 as size_in_gig, 
   segment_type
from 
   dba_segments
where 
   owner='SCOTT' 
group by 
   segment_type;

 

Drop Table 之后,如果空間不能回收,需要執行西面語句

  清除當前用戶的回收站:purge recyclebin;

  清除所有用戶的回收站:purge dba_recyclebin;


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM