A-A+
跟老牛学一招oracle
从老牛那里, 学了一招:
查询表空间的使用量、剩余量:
select * from sm$ts_used;
select * from sm$ts_free;
比起用其它的视图写长长的一段脚本, 简便多了。
两个视图的定义:
SQL>select text from dba_views where view_name = 'SM$TS_FREE';
TEXT
--------------------------------------------------------------------------------
select tablespace_name, sum(bytes) bytes from dba_free_space
group by tablespace_name
SQL>select text from dba_views where view_name = 'SM$TS_USED';
TEXT
--------------------------------------------------------------------------------
select tablespace_name, sum(bytes) bytes from dba_segments
group by tablespace_name
据说从7.x到11g都可以用。