ORACLE 歸檔日誌資訊sql
PROMPT
PROMPT redolog switch
set linesize 300
set pages 100
column d1 form a20 heading "Date"
column sw_cnt form 99999 heading 'Number|of|Switches'
column Mb form 999,999 heading "Redo Size"
column redoMbytes form 999,999,9999 heading "Redo Log File Size (Mb)"
break on report
compute sum of sw_cnt on report
compute sum of Mb on report
var redoMbytes number;
begin
select max(bytes)/1024/1024 into :redoMbytes from v$log;
end;
/
print redoMbytes
select trunc(first_time) d1
, count(*) sw_cnt
, count(*) * :redoMbytes Mb
from v$log_history
group by trunc(first_time)
/
最近三個月日誌歸檔頻繁度
select to_char(first_time,'yyyy-mm-dd'),thread#,count(*)
from v$log_history
where first_time>sysdate-90
group by to_char(first_time,'yyyy-mm-dd'),thread#
having count(*)>20
order by thread#
/
select a.f_time "日期",
a.thread#,
ceil(sum(a.blocks * a.block_size) / 1024 / 1024 / 1024) "每天歸檔量(G)",
ceil(sum(a.blocks * a.block_size) / 1024 / 1024 / 24) "每小時avg歸檔量(M)"
from (select distinct sequence#,
thread#,
blocks,
block_size,
to_char(first_time, 'yyyy/mm/dd') f_time
from v$archived_log) a
group by a.f_time, a.thread#
order by 3 desc;
日期 THREAD# 每天歸檔量(G) 每小時avg歸檔量(M)
---------- ---------- ------------- ------------------
2011/10/26 1 10 402
2011/10/31 1 5 175
2011/10/21 1 5 179
2011/10/27 1 5 171
2011/11/01 1 5 179
2011/10/18 1 5 173
2011/10/19 1 5 176
2011/10/20 1 5 185
2011/10/23 1 4 149
2011/10/29 1 4 147
2011/10/17 1 4 168
日期 THREAD# 每天歸檔量(G) 每小時avg歸檔量(M)
---------- ---------- ------------- ------------------
2011/10/28 1 4 129
2011/10/16 1 4 141
2011/10/24 1 4 168
2011/10/25 1 4 169
2011/10/30 1 4 132
2011/10/22 1 2 84
2011/11/02 1 1 8
2011/10/15 1 1 21
select to_char(first_time,'yyyy/mm/dd:hh24') "日期",thread#,count(1) "高峰時每小時歸檔個數"
from v$log_history
where trunc(first_time)
in (select d_time
from (select max(count(1)) m_arch
from v$log_history group by trunc(first_time)) a,
(select trunc(first_time) d_time,count(1) d_arch
from v$log_history group by trunc(first_time)) b
where a.m_arch=b.d_arch)
group by to_char(first_time,'yyyy/mm/dd:hh24'),thread# order by 3 desc ,thread#,1 ;
日期 THREAD# 高峰時每小時歸檔個數
------------- ---------- --------------------
2011/10/31:18 1 21
2011/10/31:17 1 7
2011/10/31:10 1 3
2011/10/31:04 1 2
2011/10/31:00 1 1
2011/10/31:09 1 1
2011/10/31:13 1 1
2011/10/31:16 1 1
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/500314/viewspace-1087146/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- oracle歸檔日誌Oracle
- Oracle 歸檔日誌Oracle
- 【SQL】Oracle 歸檔日誌暴增原因分析SQLOracle
- 【Oracle】歸檔日誌管理-設定歸檔日誌路徑以及歸檔日誌冗餘Oracle
- 歸檔oracle alert日誌Oracle
- Oracle歸檔日誌清理Oracle
- oracle之 Oracle歸檔日誌管理Oracle
- Oracle RMAN 清除歸檔日誌Oracle
- oracle刪除歸檔日誌Oracle
- Oracle RMAN清除歸檔日誌Oracle
- Oracle歸檔日誌管理技巧Oracle
- oracle archive log 歸檔日誌OracleHive
- Oracle歸檔日誌刪除Oracle
- 當ORACLE歸檔日誌滿後如何正確刪除歸檔日誌Oracle
- oracle歸檔日誌過滿清理Oracle
- ORACLE RMAN 還原歸檔日誌Oracle
- Oracle archive log 歸檔日誌管理OracleHive
- oracle 10g 歸檔日誌Oracle 10g
- 歸檔日誌
- oracle11G歸檔日誌管理Oracle
- oracle 歸檔日誌開啟,關閉Oracle
- oracle 10g 歸檔日誌清除Oracle 10g
- 歸檔日誌挖掘
- PostgreSQL 歸檔日誌SQL
- 【REDO】Oracle 日誌挖掘,分析歸檔日誌線上日誌主要步驟Oracle
- oracle 刪除過期的歸檔日誌Oracle
- oracle dg 歸檔日誌恢復情況Oracle
- Oracle歸檔日誌暴增排查優化Oracle優化
- Oracle基礎 04 歸檔日誌 archivelogOracleHive
- ORACLE 歸檔日誌開啟關閉方法Oracle
- oracle 歸檔日誌的小知識點Oracle
- oracle dataguard 自動刪除歸檔日誌Oracle
- Oracle RAC中使用RMAN管理歸檔日誌Oracle
- 【Oracle】 rman 刪除歸檔日誌的命令Oracle
- oracle rman備份歸檔日誌需要先切換日誌嗎Oracle
- oracle歸檔切換以及歸檔日誌滿報錯問題Oracle
- 控制檔案/歸檔日誌
- 如何正確刪除ORACLE歸檔日誌檔案Oracle