您好,登錄后才能下訂單哦!
環境:
centos 6.5 X64
Oracle 11g Enterprise Edition Release 11.2.0.2.0
故障現象:
rman自動備份腳本失敗,報錯現象:
Starting backup at 30-JUL-15
current log archived
released channel: disk1
released channel: disk2
released channel: disk3
released channel: disk4
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of backup command at 07/30/2015 23:00:27
RMAN-06059: expected archived log not found, loss of archived log compromises recoverability
ORA-19625: error identifying file /data0/oracle/database/archive/1_985092_843387931.arc
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Recovery Manager complete
從報錯現象上看,是因為歸檔日志 985092 文件被刪除了。
分析主要原因是因為此數據庫為dataguard 架構,同事做了v$archived max(SEQUENCE#)-500保留歸檔而且是每小時執行一次刪除歸檔日志。因為晚上11點整點開始備份,也就說當整點rman開始執行run{}并分配通道后已經是23:04以后了,但是刪除腳本已經在整點23:00已經執行。 這個時候rman archive backup 腳本執行 input archived log thread=1 sequence=985092 文件時發現文件不存在。導致rman 歸檔備份失敗。
查看時間:
SQL> SELECT APPLIED,to_char(FIRST_TIME, 'yyyy-mm-dd hh34:mi:ss') as FIRST_TIME,
2 to_char(NEXT_TIME, 'yyyy-mm-dd hh34:mi:ss') as NEXT_TIME
3 from V$ARCHIVED_LOG
4 where SEQUENCE#= 985092;
APPLIED FIRST_TIME NEXT_TIME
--------- ------------------- -------------------
YES 2015-07-30 16:03:06 2015-07-30 16:03:12
NO 2015-07-30 16:03:06 2015-07-30 16:03:12
處理倆種方法:
1、綜合考慮服務器硬盤存儲空間【言外之意就是數據庫要保留一天的歸檔日志】,取消自動刪除歸檔日志腳本。讓rman 做歸檔備份完成之后自動刪除歸檔日志。
2、修改rman 歸檔備份時間和備份腳本,如:23:10開始備份。
如:
RUN {
allocate channel disk1 type disk maxpiecesize 4000M;
allocate channel disk2 type disk maxpiecesize 4000M;
sql 'alter system archive log current';
backup archivelog all delete input format '/opt/oracle/backup/arch_backup/archbackup/%d_arch_%s_%p_%h.arh' filesperset = 50;
# Control file backup
backup as compressed backupset format '/opt/oracle/backup/arch_backup/archbackup/CF_%t_%s_%p_D%T.ctl' current controlfile;
}
如果空間夠用,就推薦使用第二種,這樣數據可用范圍大。
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。