oracle查同比增长_[oracle]Oracle查询表空间的每日增长量
SELECTa.snap_id,a.con_id,e.name pdbname,c.tablespace_name ts_name,to_char(to_date(a.rtime,‘mm/dd/yyyy hh24:mi:ss‘), ‘yyyy-mm-dd hh24:mi‘) rtime,round(a.tablespace_size * c.block_size / 1024 / 1024, 2)
SELECTa.snap_id,
a.con_id,
e.name pdbname,
c.tablespace_name ts_name,
to_char(to_date(a.rtime,‘mm/dd/yyyy hh24:mi:ss‘), ‘yyyy-mm-dd hh24:mi‘) rtime,round(a.tablespace_size * c.block_size / 1024 / 1024, 2) ts_size_mb,round(a.tablespace_usedsize * c.block_size / 1024 / 1024, 2) ts_used_mb,round((a.tablespace_size - a.tablespace_usedsize) * c.block_size / 1024 / 1024,2) ts_free_mb,round(a.tablespace_usedsize / a.tablespace_size * 100, 2) pct_usedFROMcdb_hist_tbspc_space_usage a,
(SELECTtablespace_id,
nb.con_id,
substr(rtime,1, 10) rtime,max(snap_id) snap_idFROMdba_hist_tbspc_space_usage nbgroup by tablespace_id, nb.con_id,substr(rtime, 1, 10)) b,
cdb_tablespaces c,
v$tablespace d,
V$CONTAINERS ewhere a.snap_id =b.snap_idand a.tablespace_id =b.tablespace_idand a.con_id=b.con_idand a.con_id=c.con_idand a.con_id=d.con_idand a.con_id=e.con_idand a.tablespace_id=d.TS#and d.NAME=c.tablespace_nameand to_date(a.rtime, ‘mm/dd/yyyy hh24:mi:ss‘) >=sysdate-30
order by a.CON_ID,a.tablespace_id,to_date(a.rtime, ‘mm/dd/yyyy hh24:mi:ss‘) desc;
[oracle]Oracle查询表空间的每日增长量
魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。
更多推荐


所有评论(0)