To check the tablespace usage in an Oracle database, you can query the DBA_TABLESPACES view. Here is an example SQL query that will show the usage of each tablespace in the database:
SELECT tablespace_name,
ROUND((1 - (free_space / total_space)) * 100, 2) AS used_percent
FROM
(SELECT tablespace_name,
SUM(bytes) / 1024 / 1024 AS total_space,
SUM(maxbytes) / 1024 / 1024 AS max_space,
SUM(bytes - decode(autoextensible, 'YES', maxbytes, bytes)) / 1024 / 1024 AS free_space
FROM dba_data_files
GROUP BY tablespace_name);
This query will return the name of each tablespace in the database along with the percentage of space that is currently being used. The used_percent column will show how much of each tablespace is currently in use.
以上就是关于“oracle数据库表空间使用率查询”的相关介绍,筋斗云是国内较早的云主机应用的服务商,拥有10余年行业经验,提供丰富的云服务器、租用服务器等相关产品服务。云服务器资源弹性伸缩,主机vCPU、内存性能强悍、超高I/O速度、故障秒级恢复;电子化备案,提交快速,专业团队7×24小时服务支持!
简单好用、高性价比云服务器租用链接:https://www.jindouyun.cn/product/cvm