常用sql语句
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了常用sql语句相关的知识,希望对你有一定的参考价值。
SELECT total.tablespace_name,
Round(total.MB, 2) AS Total_MB,
Round(total.MB - free.MB, 2) AS Used_MB,
Round(( 1 - free.MB / total.MB ) * 100, 2)
|| ‘%‘ AS Used_Pct
FROM (SELECT tablespace_name,
Sum(bytes) / 1024 / 1024 AS MB
FROM dba_free_space
GROUP BY tablespace_name) free,
(SELECT tablespace_name,
Sum(bytes) / 1024 / 1024 AS MB
FROM dba_data_files
GROUP BY tablespace_name) total
WHERE free.tablespace_name = total.tablespace_name;
以上是关于常用sql语句的主要内容,如果未能解决你的问题,请参考以下文章