oldwain随便写 http://oldwain.itpub.net/ <a href="http://oldwain.itpub.net">oldwain随便写</a>

跟老牛学一招oracle

上一篇 / 下一篇  2008-01-04 00:00:00 / 个人分类:Oracle

刚刚从老牛那里, 学了一招:

查询表空间的使用量、剩余量:

select * from sm$ts_used;

select * from sm$ts_free;

比起用其它的视图写长长的一段脚本, 简便多了。

ITPUB个人空间[0yL0nd`*z.P

两个视图的定义:

SQL>select text from dba_views where  view_name =   'SM$TS_FREE';

TEXT
x S:?!Xm,b9b3S0 --------------------------------------------------------------------------------
3I}_&xs'xFb0 select tablespace_name, sum(bytes) bytes from dba_free_space
)L-d+|a%rK0 group by tablespace_name

SQL>select text from dba_views where view_name = 'SM$TS_USED';

TEXT
@~j db A%@i/^;we0 --------------------------------------------------------------------------------ITPUB个人空间^7TxNr6f(t]
select tablespace_name, sum(bytes) bytes from dba_segmentsITPUB个人空间;hyT/r3D y8U@{
group by tablespace_name

据说从7.x到11g都可以用。

TAG:

 

评分:0

我来说两句

显示全部

:loveliness: :handshake :victory: :funk: :time: :kiss: :call: :hug: :lol :'( :Q :L ;P :$ :P :o :@ :D :( :)

日历

« 2008-11-23  
      1
2345678
9101112131415
16171819202122
23242526272829
30      

数据统计

  • 访问量: 2741
  • 日志数: 1042
  • 建立时间: 2007-11-28
  • 更新时间: 2008-02-22

RSS订阅

Open Toolbar