用户表空间查询

查询用户表空间对应关系

select username, default_tablespace
from dba_users;

查询表空间使用情况

    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;

转载

http://blog.csdn.net/guagua365/article/details/4138682

posted @ 2013-01-25 13:37  王超_cc  阅读(189)  评论(0编辑  收藏  举报