sqlplus / as sysdba ERROR: ORA-09817: Write to audit file failed. SVR4 Error: 28: No space left on device ORA-01075: you are currently logged on
很明顯幾個單詞NO SPACE,趕緊看系統df -h 果真100%沒了,第一反應,是歸檔日誌佔滿了空間,數據庫不會增加那麼快,因此到歸檔日誌目錄裏發現不少不少歸檔日誌;sql
爲了讓業務人員能立刻連上數據庫使用,先手動刪除了部分歸檔日誌,騰出一點點空間,可是沒多久空間又滿了,而後去看歸檔日誌目錄,發現每一個6秒就要生成一個歸檔日誌文件,每個文件大小187M,這很嚇人,數據庫
SELECT TRUNC(FIRST_TIME) "TIME", SUM(BLOCK_SIZE * BLOCKS) / 1024 / 1024 / 1024 "SIZE(GB)" FROM V$ARCHIVED_LOG GROUP BY TRUNC(FIRST_TIME);
select * from v$archived_log
select group#,sequence#,bytes/1024/1024,members,status from v$log; alter database add logfile group 4 ('/oradata/hhfz/redo04.log') size 200M; alter database add logfile group 5 ('/oradata/hhfz/redo05.log') size 200M;
--建立logminer數據字典表 @?/rdbms/admin/dbmslm.sql; @?/rdbms/admin/dbmslmd.sql; --執行要分析的歸檔日誌 exec sys.dbms_logmnr.add_logfile(logfilename => '/oradata/hhfz_arch/1_5056_912160774.arc',options => dbms_logmnr.new); exec sys.dbms_logmnr.start_logmnr(options => sys.dbms_logmnr.dict_from_online_catalog); --查詢 歸檔日誌的內容 select seg_owner,count(*) from v$logmnr_contents group by seg_owner; select count(1),substr(sql_redo,1,60) from v$logmnr_contents group by substr(sql_redo,1,60) order by count(1) desc ; --增長別的日誌文件 exec sys.dbms_logmnr.add_logfile(logfilename=>'/oradata/hhfz_arch/1_5056_912160774.arc'); exec sys.dbms_logmnr.add_logfile(logfilename=>'/oradata/hhfz_arch/1_4986_912160774.arc'); --結束分析歸檔日誌 exec sys.dbms_logmnr.end_logmnr;
最後查出一些sql,可是業務以爲這些sql不算大,因此並不以爲有啥問題。我也感受,雖然一直同一個SQL在插入,可是這點應該能承受纔對。oracle