oracle数sqlplus,sqlplus查询oracle数据库数据容量
登錄sqlplus:
cmd命令行登錄:sqlplus orcl/orcl as sysdba
查詢表空間使用率
select b.file_id 文件ID,
b.tablespace_name 表空間,
b.file_name 物理文件名,
b.bytes 總字節數,
(b.bytes-sum(nvl(a.bytes,0))) 已使用,
sum(nvl(a.bytes,0)) 剩余,
sum(nvl(a.bytes,0))/(b.bytes)*100 剩余百分比
from dba_free_space a,dba_data_files b
where a.file_id=b.file_id
group by b.tablespace_name,b.file_name,b.file_id,b.bytes
order by b.tablespace_name
select tablespace_name, segment_name, bytes / 1024 / 1024??? from user_segments? where segment_type = ‘TABLE‘??? and tablespace_name = ‘VNOX‘? order by bytes desc ;
1, dba_data_files,dba_segments,dba_free_space
得出結論:一般情況下(沒有drop表的時候):dba_data_files bytes = (dba_segments bytes + dba_free_space bytes)
實驗:
SQL> Select sum(bytes)/1024/1024/1024 from dba_segments;
SUM(BYTES)/1024/1024/1024
-------------------------
1.58441162
SQL> select sum(bytes)/1024/1024/1024 from dba_free_space;
SUM(BYTES)/1024/1024/1024
-------------------------
.323669434
SQL> select sum(bytes)/1024/1024/1024 from dba_data_files;
SUM(BYTES)/1024/1024/1024
-------------------------
1.9140625
原文:https://www.cnblogs.com/nieyuqin/p/10622676.html
總結
以上是生活随笔為你收集整理的oracle数sqlplus,sqlplus查询oracle数据库数据容量的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 农行金穗海航联名卡额度是多少?怎么提额
- 下一篇: linux cmake编译源码,linu