【oracle】关于日志产生量的计算-日志切换频率

【oracle】关于日志产生量的计算-统计ORACLE日志增长量

根据每日归档的生成量,可以反过来估计每日的数据库活动性及周期性,并决定空间分配的问题!
1.计算归档日志的生产量:
select name,completion_time,BLOCKS * BLOCK_SIZE/1024/1024 MB 
from v$archived_log 
where rownum < 11 and completion_time between trunc(sysdate) - 2 and trunc(sysdate) - 1;

2.计算某日全天的日志生成计算:
select trunc(completion_time),sum(Mb)/1024 DAY_GB 
from(select name,completion_time,BLOCKS*BLOCK_SIZE/1024/1024 Mb from v$archived_log
where COMPLETION_TIME between trunc(sysdate - 2) and trunc(sysdate) - 1)
group by trunc(COMPLETION_TIME)

3.最近日期的日志生成统计

select trunc(completion_time),sum(mb)/1024 day_gb
from(select name,completion_time,blocks*block_size /1024 /1024 mb from v$archived_log)
group by trunc(completion_time)
order by (trunc(completion_time))

转自:http://blog.itpub.net/22664653/viewspace-706515/

 

查看Oracleredo日志切换频率:

 

第一个:

select 

b.SEQUENCE#,

 b.FIRST_TIME,

a.SEQUENCE#,

b.a.FIRST_TIME,

c.round(((a.FIRST_TIME-b.FIRST_TIME)*24)*60,2) 

from v$log_history a, v$log_history b 

where a.SEQUENCE#=b.SEQUENCE#+1 

and b.THREAD#=1 

order by a.SEQUENCE# desc;

   

第二个:

select 

sequence#,

first_time,

nexttime,

round(((first_time-nexttime)*24)*60,2) diff 

from 

(select sequence#,first_time,lag(first_time) over(order by sequence#) nexttime from v$log_history where thread#=1) 

order by sequence# desc;

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值