日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > linux >内容正文

linux

linux 查看当前表空间大小,查看表空间和表的使用率

發布時間:2023/12/9 linux 32 豆豆
生活随笔 收集整理的這篇文章主要介紹了 linux 查看当前表空间大小,查看表空间和表的使用率 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

1.查看表空間使用率

--查詢表空間的總容量

select tablespace_name,sum(bytes) /1024/1024 as MB from dba_data_files group by tablespace_name;

--查詢表空間使用率

select total.tablespace_name,

round(total.MB, 2) as Total_MB,

round(total.MB - free.MB, 2) as Used_MB,

round((1 - free.MB / total.MB) * 100, 2) || '%' as Used_Pct from

(select tablespace_name,sum(bytes) / 1024 / 1024 as MB from dba_free_space group by tablespace_name) free,

(select tablespace_name,sum(bytes) / 1024 / 1024 as MB from dba_data_files group by tablespace_name) total

where free.tablespace_name = total.tablespace_name order by used_pct desc;

--對象類型:表分區表索引分區索引共四種,我們統計一下不同種類對象各多少size

select segment_type,sum(bytes)/1024/1024 total_size from dba_segments where wner='CCARE' group by segment_type;

--SQL計算出某個用戶下所有對象的大小

select owner,segment_name,segment_type,partition_name,bytes from dba_segments where wner='CCARE';

--我們經常使用的LEO1表空間使用情況已經perfect顯示,現在我們需要統計的是LEO1表空間包含對象的大小,由于記錄數較多,只把SQL語句寫在這里了

select o.object_name,o.object_type,o.owner,s.tablespace_name,s.segment_name,s.bytes from dba_objects o,dba_segments s where s.tablespace_name='LEO1' and o.owner=s.owner and o.owner='LEO1' and o.object_type=s.segment_type;

總結

以上是生活随笔為你收集整理的linux 查看当前表空间大小,查看表空间和表的使用率的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。