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
@~jdb A%@i/^;we0
--------------------------------------------------------------------------------ITPUB个人空间 ^7TxNr6f(t]
select tablespace_name, sum(bytes) bytes from dba_segmentsITPUB个人空间;hyT/r3Dy8U@{
group by tablespace_name
据说从7.x到11g都可以用。
导入论坛
引用链接
收藏
分享给好友
推荐到圈子
管理
举报
TAG: