-
Gather daily history of primary database's redo generation rate using this query.
COPY
SQL> select trunc(completion_time) as "DATE", count(*) as "LOG SWITCHES", round(sum(blocks*block_size)/1024/1024) as "REDO PER DAY (MB)" from v$archived_log where dest_id=1 group by trunc(completion_time) order by 1; -
Gather the peak redo rate for each hour.
COPY
select begin_time,instance_number,metric_name, round(value/1024/1024) "Max Rate in MB" from (select to_char(begin_time,'DD-MON-YYYY HH24') begin_time,instance_number,metric_name,max(value) value from dba_hist_sysmetric_history where metric_name = 'Redo Generated Per Sec' and trunc(begin_time) >=trunc(sysdate-7) group by to_char(begin_time,'DD-MON-YYYY HH24'),instance_number,metric_name) order by 1,3;Optionally change the '7' to some other value to change the number of days in the output.
The preferred query is
dba_hist_sysmetric_historybecause it provides more precise information, but the retention is limited by AWR retention. If the dates you are looking for are not available form the previous query, gather per log redo generation rate usingv$archived_loginstead.COPY
SQL> alter session set nls_date_format='YYYY/MM/DD HH24:MI:SS'; SQL> select thread#,sequence#,blocks*block_size/1024/1024 MB,(next_time-first_time)*86400 sec, blocks*block_size/1024/1024)/((next_time-first_time)*86400) "MB/s" from v$archived_log where ((next_time-first_time)*86400<>0) and first_time between to_date('2024/10/15 08:00:00','YYYY/MM/DD HH24:MI:SS') and to_date('2024/11/15 11:00:00','YYYY/MM/DD HH24:MI:SS') and dest_id=1 order by first_time; -
Gather hourly snapshots of the redo generation rate from the Automatic Workload Repository (AWR) report 6 hours before the start of any redo or transport lag.
By default, Oracle Database automatically generates snapshots once every hour; however, you may want to manually create snapshots to capture statistics at times different from those of the automatically generated snapshots. To view information about an existing snapshot, use the
DBA_HIST_SNAPSHOTview.
oracle日志生成量
好记忆不如烂笔头abc2025-12-25 8:39
相关推荐
Flynn Liang24 分钟前
AI Agent Redis 生产踩坑实录:13 类故障的根因、复现与调优SelectDB2 小时前
开源日志平台怎么选?ELK、Loki、ClickHouse、Apache Doris 四大方案对比与选型指南SelectDB2 小时前
ELK 磁盘空间不足怎么办?Elasticsearch 存储膨胀原因、排查步骤与 3 种降本方案满小满2 小时前
为什么我先 ANALYZE,而不是先加索引SelectDB2 小时前
日志分析用什么数据库好?Elasticsearch、ClickHouse、Doris 选型对比与 3 个企业案例inferno4 小时前
十三、存储过程(PROCEDURE)数据库急诊室_阿哲5 小时前
一周慢查询日志审计:1200 条里有多少真问题zhangjw345 小时前
2-4 集合运算 union /union all /intersect/exceptDecay__6 小时前
PostgreSQL DBA 日常运维手册 —— 会话、锁阻塞、慢查询、膨胀与每日巡检FungLeo6 小时前
FengCMS ·PHP+MySQL 升级实录· 设置发布与模板缓存:数据库与配置文件如何避免旧表单覆盖