歸檔日誌存在arch 查歸檔日誌檔案每小時生成量

2021-10-19 06:25:22 字數 1882 閱讀 5064

在o

racle資料庫中,通過v$archived_log資料字典檢視查詢該資料庫的歸檔日誌檔案的生成情況。

如果你以為在rac下需要查的**$archvied_log檢視,這其實是乙個錯誤的想法。

無論在單例項資料庫,還是多例項的rac資料庫,都是查這個檢視來獲取資訊。

查當天每小時的歸檔日誌生成量

select logtime,

count(*),

round(sum(blocks * block_size) / 1024 / 1024) mbsize

from (select trunc(first_time, 'hh') as logtime, a.blocks, a.block_size

from v$archived_log a

where a.dest_id = 1

and a.first_time > trunc(sysdate))

group by logtime

order by logtime desc;

查最近一周每天的歸檔日誌生成量

select logtime,

count(*),

round(sum(blocks * block_size) / 1024 / 1024) mbsize

from (select trunc(first_time, 'dd') as logtime, a.blocks, a.block_size

from v$archived_log a

where a.dest_id = 1

and a.first_time > trunc(sysdate - 7))

group by logtime

order by logtime desc;

如果你需要知道rac下各個節點的歸檔日誌情況,我將上面指令碼略作修改,增加thread#列。

查當天每小時的各個例項的歸檔日誌生成量

select thread#,

logtime,

count(*),

round(sum(blocks * block_size) / 1024 / 1024) mbsize

from (select a.thread#,

trunc(first_time, 'hh') as logtime,

a.blocks,

a.block_size

from v$archived_log a

where a.dest_id = 1

and a.first_time > trunc(sysdate))

group by thread#, logtime

order by thread#, logtime desc;

查最近一周每天的各個例項的歸檔日誌生成量

select thread#,

logtime,

count(*),

round(sum(blocks * block_size) / 1024 / 1024) mbsize

from (select thread#,

trunc(first_time, 'dd') as logtime,

a.blocks,

a.block_size

from v$archived_log a

where a.dest_id = 1

and a.first_time > trunc(sysdate - 7))

group by thread#, logtime

order by thread#, logtime desc;

敬請留存,以備不時之需

@mikixiyou

分享到:

2012-12-18 16:13

瀏覽 10180

分類:資料庫

mysql 歸檔日誌 Oracle歸檔日誌總結

1.開啟歸檔日誌 sqlplus as sysdba sql shutdown immediate sql startup mount 開啟控制檔案,不開啟資料檔案 sql alter database archivelog 將資料庫切換為歸檔模式 sql alter database open 將...

Oracle 開啟歸檔日誌以及關閉歸檔日誌

racle資料庫可以執行在2種模式下 歸檔模式 archivelog 和非歸檔模式 noarchivelog 歸檔模式可以提高oracle資料庫的可恢復性,生產資料庫都應該執行在此模式下,歸檔模式應該和相應的備份策略相結合,只有歸檔模式沒有相應的備份策略只會帶來麻煩。本文簡單介紹如何啟用和關閉資料庫...

oracle日誌歸檔

文章出處 感謝作者的分享 oracle 歸檔日誌 oracle可以將聯機日誌檔案儲存到多個不同的位置,將聯機日誌轉換為歸檔日誌的過程稱之為歸檔。相應的日誌被稱為歸檔日誌。一 歸檔日誌 是聯機重做日誌組檔案的乙個副本 包含redo記錄以及乙個唯一的log sequence number 對日誌組中的乙...