当前位置: 首页 > 工具软件 > sm-validator > 使用案例 >

SM$TS_USED,SM$TS_FREE,SM$TS_AVAIL

许焕
2023-12-01
SM$TS_USED,SM$TS_FREE,SM$TS_AVAIL,这三个在Oracle官方文档的reference上找不到相关解释。其实三者都是视图,从DBA_VIEWS中可以得到相关信息。

点击(此处)折叠或打开

  1. SYS@ORCL> desc SM$TS_USED
  2.  Name                                 Null? Type
  3.  ----------------------------------------------------------------- -------- --------------------------------------------
  4.  TABLESPACE_NAME                             VARCHAR2(30)
  5.  BYTES                                     NUMBER

  6. SYS@ORCL> desc SM$TS_FREE
  7.  Name                                 Null? Type
  8.  ----------------------------------------------------------------- -------- --------------------------------------------
  9.  TABLESPACE_NAME                             VARCHAR2(30)
  10.  BYTES                                     NUMBER

  11. SYS@ORCL> desc SM$TS_AVAIL
  12.  Name                                 Null? Type
  13.  ----------------------------------------------------------------- -------- --------------------------------------------
  14.  TABLESPACE_NAME                             VARCHAR2(30)
  15.  BYTES                                     NUMBER

SYS@ORCL> select view_name,text_length,text from dba_views where view_name='SM$TS_USED';


VIEW_NAME       TEXT_LENGTH
------------------------------ -----------
TEXT
--------------------------------------------------------------------------------
SM$TS_USED 87
select tablespace_name, sum(bytes) bytes from dba_segments
    group by tablespa(ce_name
意即该视图是上述查询中的text列所示SQL语句的等效视图,如下可证明该结论:
SYS@ORCL> select tablespace_name,sum(bytes) bytes from dba_segments
  2  group by tablespace_name;

TABLESPACE_NAME    BYTES
------------------------------ ----------
SYSAUX 561971200
UNDOTBS1 20971520
USERS  3211264
SYSTEM 793051136
EXAMPLE 324206592

SYS@ORCL> select * from sm$ts_used;

TABLESPACE_NAME    BYTES
------------------------------ ----------
SYSAUX 561971200
UNDOTBS1 20971520
USERS  3211264
SYSTEM 793051136
EXAMPLE 324206592

剩下二者同上
SYS@ORCL> select view_name,text_length,text from dba_views where view_name='SM$TS_FREE';

VIEW_NAME       TEXT_LENGTH
------------------------------ -----------
TEXT
--------------------------------------------------------------------------------
SM$TS_FREE 89
select tablespace_name, sum(bytes) bytes from dba_free_space
    group by tables

SYS@ORCL> select view_name,text_length,text from dba_views where view_name='SM$TS_AVAIL';

VIEW_NAME       TEXT_LENGTH
------------------------------ -----------
TEXT
--------------------------------------------------------------------------------
SM$TS_AVAIL 89
select tablespace_name, sum(bytes) bytes from dba_data_files
    group by tables

by the way, SM$TS_USED,SM$TS_FREE,SM$TS_AVAIL,个人觉得sm有可能是sum的简写,ts则是tablespaces的简写。
感谢ORA-600的提示:-)

@760
 类似资料:

相关阅读

相关文章

相关问答