您的位置:首页 > 数据库 > Oracle

oracle查看表空间剩余和修改表空间大小

2018-02-01 08:54 323 查看
select 

b.file_id 文件ID号, 

b.tablespace_name 表空间名, 

b.bytes/1024/1024||'M'字节数, 

(b.bytes-sum(nvl(a.bytes,0)))/1024/1024||'M' 已使用, 

sum(nvl(a.bytes,0))/1024/1024||'M' 剩余空间, 

100 - sum(nvl(a.bytes,0))/(b.bytes)*100 占用百分比 

from dba_free_space a,dba_data_files b 

where a.file_id=b.file_id  and b.tablespace_name = 'XXXtablespace'

group by b.tablespace_name,b.file_id,b.bytes 

order by b.file_id; 

alter database datafile '/oracle/oradata/torcl/GMAMP796.dbf' resize 1024m;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: