【oracle】關於日誌產生量的計算

楊奇龍發表於2011-09-02
根據每日歸檔的生成量,可以反過來估計每日的資料庫活動性及週期性,並決定空間分配的問題!
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)

ops$admin@dw1>select trunc(completion_time),sum(Mb)/1024 DAY_GB 
  2  from(select name,completion_time,BLOCKS*BLOCK_SIZE/1024/1024 Mb from v$archived_log
  3  where COMPLETION_TIME between trunc(sysdate - 2) and trunc(sysdate) - 1)
  4  group by trunc(COMPLETION_TIME);

TRUNC(COMPLETION_T     DAY_GB
----------------------------     ----------
31-AUG-11                    511.713791
====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))

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/22664653/viewspace-706515/,如需轉載,請註明出處,否則將追究法律責任。

相關文章