转载时请务必以超链接形式标明文章 原始出处和作者信息及本版权声明。
链接:http://www.dbasky.net/archives/2009/09/post-10.html
大家都知道要查询表空间的使用情况可以通过查询其视图写长长的一段脚本,我想大家都会写了。可是否有简便的方法呢?接下来我们看下如下例子:
db1-> sqlplus / as sysdba
SQL*Plus: Release 10.2.0.4.0 - Production on Thu Sep 24 14:59:14 2009
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options
SQL> select * from sm$ts_used;
TABLESPACE_NAME BYTES
------------------------------ ----------
SL_DATA_TS 5310775296
SYSAUX 984809472
UNDOTBS1 664928256
USERS 7447576576
TEST 2019229696
SYSTEM 939720704
BCLOG 19070976
UNDOTBS2 95354880
8 rows selected.
SQL> select * from sm$ts_free;
TABLESPACE_NAME BYTES
------------------------------ ----------
SL_DATA_TS 1421475840
UNDOTBS1 462225408
SYSAUX 88866816
USERS 2018050048
TEST 1227096064
SYSTEM 133955584
UNDOTBS2 1058013184
BCLOG 1079771136
8 rows selected.
SQL>
是不是觉得方便多得多呢。
发表评论