如何查看各个表空间占用磁盘情况

    技术2022-05-11  133

    如何查看各个表空间占用磁盘情况?

    软件环境:  1、Windows NT4.0+ORACLE 8.0.4 2、ORACLE安装路径为:C:/ORANT SQL语句:        /*     中文环境    */      col 表空间名 format a20;      select       b.file_id  文件ID号,      b.tablespace_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_id,b.bytes       order by b.file_id;     /*    英文环境    */                col tablespace_name format a20;      select       b.file_id  file_ID,      b.tablespace_name  tablespace_name,      b.bytes  Bytes,      (b.bytes-sum(nvl(a.bytes,0)))  used,      sum(nvl(a.bytes,0))  free,      sum(nvl(a.bytes,0))/(b.bytes)*100         Percent      from dba_free_space a,dba_data_files b       where a.file_id=b.file_id       group by b.tablespace_name,b.file_id,b.bytes       order by b.file_id;        文件ID号 表空间名                          字节数    已使用  剩余空间 剩余百分比 --------- ------------------------------ --------- --------- --------- ----------         1 SYSTEM                          20971520   9971712  10999808  52.451172         2 USER_DATA                        3145728    432128   2713600  86.263021         3 ROLLBACK_DATA                    5242880   1640448   3602432  68.710938         4 TEMPORARY_DATA                   2097152      2048   2095104  99.902344

    最新回复(0)