首页 > 其他分享 >检查表空间数据文件占用

检查表空间数据文件占用

时间:2022-09-01 12:11:06浏览次数:57  
标签:检查表 name 占用 bytes 空间数据 tablespace file sum id

1、检查表空间数据文件占用:

select
b.file_name 物理文件名,
b.tablespace_name 表空间,
b.bytes/1024/1024大小M,
(b.bytes-sum(nvl(a.bytes,0)))/1024/1024 已使用M,
substr((b.bytes-sum(nvl(a.bytes,0)))/(b.bytes)*100,1,5) 利用率
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.bytes

2、查找数据文件指标及路径:
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

3、对表空间进行扩容:
alter database orclhn datafile 'F:\APP\ADMINISTRATOR\PRODUCT\11.2.0\DBHOME_1\DATABASE\SWC.DBF' resize 30720M;

标签:检查表,name,占用,bytes,空间数据,tablespace,file,sum,id
From: https://www.cnblogs.com/Peninsula/p/16646069.html

相关文章