oracle歸檔日誌增長過快處理方法

來源:互聯網
上載者:User

標籤:oracle   archivelog   toad   歸檔過快   

oracle歸檔日誌一般由dml語句產生,所以增加太快應該是dml太頻繁

首先查詢以下每天的歸檔產生的情況:

SELECT TRUNC(FIRST_TIME) "TIME",
             SUM(BLOCK_SIZE * BLOCKS) / 1024 / 1024 / 1024 "SIZE(GB)"
    FROM V$ARCHIVED_LOG
 GROUP BY TRUNC(FIRST_TIME);

從而好判斷那個時間段開始歸檔比較異常


從以下兩種方式分析歸檔日誌的情況


方法一:使用logminer


1,使用指令碼建立相關的包

@$ORACLE_HOME/rdbms/admin/dbmslm.sql
 @$ORACLE_HOME/rdbms/admin/dbmslmd.sql;
第一個指令碼用來建立DBMS_LOGMNR包,該包用來分析記錄檔。
第二個指令碼用來建立DBMS_LOGMNR_D包,該包用來建立資料字典檔案。

2.指定要分析的記錄檔
    exec sys.dbms_logmnr.add_logfile(logfilename => ‘/archivelog/node/1_771348_78836667000.arc‘,options => dbms_logmnr.new);

3.使用本地的線上資料字典分析歸檔日誌
    exec sys.dbms_logmnr.start_logmnr(options => sys.dbms_logmnr.dict_from_online_catalog);



4,查詢分析出來的歸檔日誌內容,例如統計最大修改量的Schema
    select seg_owner,count(*) from v$logmnr_contents group by seg_owner;
    select count(1),substr(sql_redo,1,30) from v$logmnr_contents group by substr(sql_redo,1,30) order by count(1) desc ;

5.增加別的記錄檔
    exec sys.dbms_logmnr.add_logfile(logfilename=>‘/archivelog/node/1_773333_78836667000.arc‘);
   exec sys.dbms_logmnr.add_logfile(logfilename=>‘/archivelog/node1/1_773334_78836667000.arc‘);
6.結束分析歸檔日誌
    exec sys.dbms_logmnr.end_logmnr;


方法二:使用toad工具查看日誌資訊

在database 找到logminer 然後把要分析的日誌放進去,裡面有詳細的資料庫執行記錄,很直觀的看到產生歸檔的語句


查出來語句後,然後給開發一塊商量還是否可以降低一些dml語句的執行頻率


oracle歸檔日誌增長過快處理方法

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.