表空间大小.txt

来自「有关某表空间大小为多少,已使用多少.用两个脚本比较方便」· 文本 代码 · 共 30 行

TXT
30
字号
有关表空间大小---Oracle初学者 
如果知道某表空间大小为多少,已使用多少? 

Reply:
select 
b.file_id file_id, 
b.tablespace_name tablespace_name , 
b.bytes bytes, 
(b.bytes-sum(nvl(a.bytes,0))) used, 
sum(nvl(a.bytes,0)) last, 
sum(nvl(a.bytes,0))/(b.bytes)*100 last_pct 
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;

Reply:
我觉得用两个脚本比较方便 
1.freespace.sql 
select tablespace_name,sum(bytes),count(*),max(bytes),min(bytes) 
from dba_free_space 
group by tablespace_name; 
2.totalspace.sql 
select tablespace_name,sum(bytes),count(*) from dba_data_files 
group by tablespace_name; 

Reply:
SELECT * FROM DBA_DATA_FILES; 

看看,应该是可以查出来的。

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?