查询表空间剩余空间和表属于哪个表空间

本文提供了一种查询Oracle数据库中表空间使用情况的方法,并介绍了如何通过特定视图来查看存储过程及指定表空间内的表和索引信息。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

select a.file_id "FileNo",a.tablespace_name "Tablespace_name",a.bytes "Bytes",a.bytes-sum(nvl(b.bytes,0)) "Used",sum(nvl(b.bytes,0)) "Free",sum(nvl(b.bytes,0))/a.bytes*100 "%free" from dba_data_files a,dba_free_space b where a.file_id=b.file_id(+) group by a.tablespace_name,a.file_id,a.bytes order by a.tablespace_name;

 

存储过程都是存放在system表空间的数据字典中,可以使用视图dba_source来查看你感兴趣的存储过程(未加密的)。而你想察看某个表空间有什么表/索引,去视图dba_tables/dba_indexes中察看把,限制一下tablespace_name,就会得到你想要得。
select * from dba_tables where tablespace_name='SYSAUX'
select * from dba_indexes where tablespace_name='SYSAUX'

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值