oracle日志生成量

  • 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_history because 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 using v$archived_log instead.

    复制代码

    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_SNAPSHOT view.

https://docs.oracle.com/en/database/oracle/oracle-database/26/haovw/tune-and-troubleshoot-oracle-data-guard1.html#GUID-52FD3117-AED0-4947-A429-8865FF89E697

相关推荐
Bdygsl12 小时前
MySQL(2)—— CRUD
数据库·mysql
chushiyunen12 小时前
python edge-tts实现tts文本转语音、音频
数据库·python·音视频
原来是猿12 小时前
MySQL【事务中 - 事务的隔离级别】
数据库·mysql
2501_9454235412 小时前
游戏与图形界面(GUI)
jvm·数据库·python
大傻^12 小时前
Spring AI Alibaba Agent开发:基于ChatClient的智能体构建模式
java·数据库·人工智能·后端·spring·springaialibaba
爬山算法12 小时前
MongoDB(50)副本集中的角色有哪些?
数据库·mongodb
大傻^12 小时前
Spring AI Alibaba 向量数据库集成:Milvus与Elasticsearch配置详解
数据库·人工智能·spring·elasticsearch·milvus·springai·springaialibaba
redsea_HR13 小时前
红海eHR解决方案背后的底层能力
大数据·数据库·人工智能
ba_pi13 小时前
每天写点什么2026-03-19-Doris三种存储模型
java·数据库·mysql
oem11013 小时前
Python Web爬虫入门:使用Requests和BeautifulSoup
jvm·数据库·python