oracle 平均值 最大值,oracle 查询 归档日志最大值和平均值

select max(ss.size_GB), avg(ss.size_GB)

from (select s.*, rownum rn2

from (select a.*

from (select t1.*, rownum rn

from (SELECT TRUNC(FIRST_TIME) time,

SUM(BLOCK_SIZE * BLOCKS) / 1024 / 1024 / 1024 size_GB

FROM V$ARCHIVED_LOG

GROUP BY TRUNC(FIRST_TIME)

order by time desc) t1) a

where a.rn > 1

order by a.time asc) s) ss

where ss.rn2 > 1;

----查询ASM使用率

select group_number,name,total_mb/1024 TGB,free_mb/1024 FGB,USABLE_FILE_MB/1024  from v$asm_diskgroup;

---RAC 查询单节点日归档大小

select to_char(b.FIRST_TIME, 'yyyy-mm-dd') arch_date,

round(sum(b.BLOCKS * b.BLOCK_SIZE / 1024 / 1024/1024), 2) "ARCH_SIZE(GB)"

from v$archived_log b

where b.CREATOR = 'ARCH'

and b.STANDBY_DEST = 'NO'

and b.archived = 'YES'

and b.dest_id = 1

and b.FIRST_TIME >= sysdate - 15

and b.FIRST_TIME < trunc(sysdate)

group by to_char(FIRST_TIME, 'yyyy-mm-dd')

order by 1;

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值