oracle檢視昨天產生歸檔日誌檔案總量

kunlunzhiying發表於2017-04-12
<div> <br /> </div> <div> <div> #檢視v$archived_log </div> <div> <br /> </div> <div> V$ARCHIVED_LOG displays archived log information from the control file, including archive log names. An archive log record is inserted after the online redo log is successfully archived or cleared (name column is NULL if the log was cleared). If the log is archived twice, there will be two archived log records with the same THREAD#, SEQUENCE#, and FIRST_CHANGE#, but with a different name. An archive log record is also inserted when an archive log is restored from a backup set or a copy and whenever a copy of a log is made with the RMAN COPY command. </div> <div> (這些歸檔日誌檔案的資訊來自控制檔案) </div> <div> 查詢涉及的列名: </div> <div> block_size &nbsp; NUMBER &nbsp; &nbsp; &nbsp;Redo log block size. This is the logical block size of the archived log, &nbsp;which is the &nbsp;same as the logical block size of the online log from which the archived log was opied. The online log logical block size is a platform. specific value that is not adjustable by the user.&nbsp; </div> <div> <br /> </div> <div> block &nbsp; &nbsp; &nbsp; &nbsp;NUMBER &nbsp; &nbsp; &nbsp; &nbsp; Size of the archived log (in blocks)&nbsp; </div> <div> <br /> </div> <div> fisrt_time &nbsp; DATE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Timestamp of the first change </div> <div> <br /> </div> <div> 檢視昨天日誌檔案產生的量(MB)&nbsp; </div> <div> SELECT SUM(block_size*blocks)/1024/1024/1024 "SIZE(MB)" </div> <div> FROM v$archived_log&nbsp; </div> <div> WHERE TRUNC(first_time) &gt;= TRUNC(sysdate-1) </div> <div> AND TRUNC(first_time) &lt; TRUNC(sysdate); </div> <div> <br /> </div> <div> 檢視以前每天產生的日誌檔案(MB) </div> <div> SELECT TRUNC(first_time) "TIME",SUM(block_size*blocks)/1024/1024/1024 "SIZE(MB)" </div> <div> FROM v$archived_log </div> <div> GROUP BY TRUNC(first_time); </div> </div> <div> <br /> </div> <div> <br /> </div> <div> <br /> </div> <div> </div> <div> </div> <div> </div> <div> </div> <div> </div> <div> </div> <div> </div> <div> </div>

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

相關文章