Chinaunix首页 | 论坛 | 博客
  • 博客访问: 459227
  • 博文数量: 711
  • 博客积分: 3000
  • 博客等级: 中校
  • 技术积分: 4200
  • 用 户 组: 普通用户
  • 注册时间: 2008-10-28 14:18
文章分类

全部博文(711)

文章存档

2011年(1)

2008年(710)

我的朋友

分类:

2008-10-29 11:50:38


  软件环境: 
  1、 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
【责编:admin】

--------------------next---------------------

阅读(273) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~