ITPub博客

首页 > 数据库 > Oracle > 依靠dba_hist_tbspc_space_usage视图获得表空间的历史使用情况

依靠dba_hist_tbspc_space_usage视图获得表空间的历史使用情况

原创 Oracle 作者:xianhua_33 时间:2022-04-08 11:48:34 0 删除 编辑

dba_hist_tbspc_space_usage视图中存放了历史信息

select a.name, b.*

from v$tablespace a,

(select tablespace_id,

trunc(to_date(rtime, 'mm/dd/yyyy hh24:mi:ss')) datetime,

round(max(tablespace_usedsize * 8 / 1024),2) used_size_MB

from dba_hist_tbspc_space_usage

where trunc(to_date(rtime, 'mm/dd/yyyy hh24:mi:ss')) >

trunc(sysdate - 17)

group by tablespace_id,

trunc(to_date(rtime, 'mm/dd/yyyy hh24:mi:ss'))

order by tablespace_id,

trunc(to_date(rtime, 'mm/dd/yyyy hh24:mi:ss'))) b

where a.ts# = b.tablespace_id and a.name='USERS';

NAME                           TABLESPACE_ID DATETIME  USED_SIZE_MB

------------------------------ ------------- --------- ------------

USERS                                      4 07-MAR-22    7240.67

USERS                                      4 08-MAR-22    7252.05

USERS                                      4 09-MAR-22    7320.55

USERS                                      4 10-MAR-22    7404.98


来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/69950318/viewspace-2886167/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2019-10-09

  • 博文量
    95
  • 访问量
    41129