RMAN故障一例(歸檔的備份,從不obsolete)
問題描述:
近期的rman備份中,歸檔日誌的備份沒有被刪除,rman的指令碼和策略都沒變過,歸檔的備份一直保留,每過一段時間就要物理刪除備份,很是奇怪。
rman的configure如下
RMAN> show all;
RMAN configuration parameters for database with db_unique_name HUBSRAC are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 2;
CONFIGURE BACKUP OPTIMIZATION ON;
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
CONFIGURE DEVICE TYPE DISK BACKUP TYPE TO COMPRESSED BACKUPSET PARALLELISM 1;
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE COMPRESSION ALGORITHM 'MEDIUM' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE;
CONFIGURE ARCHIVELOG DELETION POLICY TO BACKED UP 20 TIMES TO DISK;
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '+dg_redo/hubsrac/snapcf_hubsrac.f';
RMAN> corsscheck backup;
RMAN> report obsolete;
RMAN retention policy will be applied to the command
RMAN retention policy is set to redundancy 2
Report of obsolete backups and copies
Type Key Completion Time Filename/Handle
-------------------- ------ ------------------ --------------------
Control File Copy 44 2016/05/31 14:14:26 +DG_REDO01/orclrac/control_snapshot/snapcf_orclrac1.f
發現obsolete的列表裡,只有一個controlfile的copy,而且是三個月前的?推算一下,應該是這個庫之前做standby的時候遺留下來的,嘗試刪除這個過期的備份
RMAN> delete obsolete;
RMAN retention policy will be applied to the command
RMAN retention policy is set to redundancy 2
using channel ORA_DISK_1
Deleting the following obsolete backups and copies:
Type Key Completion Time Filename/Handle
-------------------- ------ ------------------ --------------------
Control File Copy 44 2016/05/31 14:14:26 +DG_REDO01/orclrac/control_snapshot/snapcf_orclrac1.f
Do you really want to delete the above objects (enter YES or NO)? YES
deleted control file copy
control file copy file name=+DG_REDO01/orclrac/control_snapshot/snapcf_orclrac1.f RECID=44 STAMP=913299266
Deleted 1 objects
注意已經提示Deleted 1 objects,但是在此report時會發現,這個記錄仍然存在
RMAN> report obsolete;
RMAN retention policy will be applied to the command
RMAN retention policy is set to redundancy 2
Report of obsolete backups and copies
Type Key Completion Time Filename/Handle
-------------------- ------ ------------------ --------------------
Control File Copy 44 2016/05/31 14:14:26 +DG_REDO01/orclrac/control_snapshot/snapcf_orclrac1.f
換一種方法刪除
RMAN> CROSSCHECK CONTROLFILECOPY '+DG_REDO01/orclrac/control_snapshot/snapcf_orclrac1.f';
released channel: ORA_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=2064 instance=orclrac2 device type=DISK
validation failed for control file copy
control file copy file name=+DG_REDO01/orclrac/control_snapshot/snapcf_orclrac1.f RECID=44 STAMP=913299266
Crosschecked 1 objects
RMAN> delete obsolete;
RMAN retention policy will be applied to the command
RMAN retention policy is set to redundancy 2
using channel ORA_DISK_1
Deleting the following obsolete backups and copies:
Type Key Completion Time Filename/Handle
-------------------- ------ ------------------ --------------------
Control File Copy 44 2016/05/31 14:14:26 +DG_REDO01/orclrac/control_snapshot/snapcf_orclrac1.f
Do you really want to delete the above objects (enter YES or NO)? YES
deleted control file copy
control file copy file name=+DG_REDO01/orclrac/control_snapshot/snapcf_orclrac1.f RECID=44 STAMP=913299266
Deleted 1 objects
仍讓存在。。。
RMAN> report obsolete;
RMAN retention policy will be applied to the command
RMAN retention policy is set to redundancy 2
Report of obsolete backups and copies
Type Key Completion Time Filename/Handle
-------------------- ------ ------------------ --------------------
Control File Copy 44 2016/05/31 14:14:26 +DG_REDO01/orclrac/control_snapshot/snapcf_orclrac1.f
再換一種方法
RMAN> DELETE FORCE NOPROMPT OBSOLETE DEVICE TYPE DISK;
If RMAN-06214 still occurs, then try
RMAN> CROSSCHECK COPY OF CONTROLFILE;
還是存在
RMAN> report obsolete;
RMAN retention policy will be applied to the command
RMAN retention policy is set to redundancy 2
Report of obsolete backups and copies
Type Key Completion Time Filename/Handle
-------------------- ------ ------------------ --------------------
Control File Copy 44 2016/05/31 14:14:26 +DG_REDO01/orclrac/control_snapshot/snapcf_orclrac1.f
沒辦法了,uncatalog之後就沒有了,官方上給出的方法:
RMAN> change controlfilecopy '+DG_REDO01/orclrac/control_snapshot/snapcf_orclrac1.f' uncatalog;
uncataloged control file copy
control file copy file name=+DG_REDO01/orclrac/control_snapshot/snapcf_orclrac1.f RECID=44 STAMP=913299266
Uncataloged 1 objects
過期的控制檔案備份是幹掉了,可是再次去檢查obsolete,發現那些老的歸檔日誌備份仍然不是obsolete~
檢視一下capture,發現有ogg的capture註冊在資料庫
SQL> col required_checkpoint_scn for 9999999999999999999
SQL> select capture_name, required_checkpoint_scn from dba_capture;
CAPTURE_NAME REQUIRED_CHECKPOINT_SCN
------------------------------ -----------------------
OGG$CAP_FM1 46264409580
OGG$CAP_ET1 46264410538
根源就在這裡,這個庫以前作為ogg的source端使用過一段時間,後來業務變更,ogg就停掉了。但是配置ogg時註冊進ogg的一些服務並沒有清除,ogg 11g的 logretention和12c的integrated在日誌沒有被抽取的時候,會阻止rman中的歸檔備份被清除。
登入ogg把之前的兩個抽取程式unregister一下
GGSCI (hubsrac01 as ) 7> dblogin userid oggadmin,password oggadmin
GGSCI (hubsrac01 as ) 7> unregister extract fm1 database
GGSCI (hubsrac01 as ) 7> unregister extract et1 database
清除過程中資料庫的alert資訊如下
GoldenGate Apply: OGG$FM1 APPLY Dropped
APPLY OGG$FM1: Apply User: OGGADMIN
APPLY OGG$FM1: Apply Tag: 00
Tue Aug 30 15:05:40 2016
Streams Capture: OGG$CAP_FM1 CAPTURE Dropped
CAPTURE OGG$CAP_FM1: Start SCN: 46167477979 (0xbfcbcedb.0000000a)
CAPTURE OGG$CAP_FM1: First SCN: 46167477979 (0xbfcbcedb.0000000a)
CAPTURE OGG$CAP_FM1: Required Checkpoint SCN: 46264409580 (0xc592ddec.0000000a)
CAPTURE OGG$CAP_FM1: Captured SCN: 46264409883 (0xc592df1b.0000000a)
CAPTURE OGG$CAP_FM1: Applied SCN: 46264409580 (0xc592ddec.0000000a)
CAPTURE OGG$CAP_FM1: Capture Type: LOCAL
CAPTURE OGG$CAP_FM1: Logminer Id: 4
CAPTURE OGG$CAP_FM1: Source Database: ORCLRAC
Tue Aug 30 15:05:53 2016
ALTER SYSTEM SET service_names='SYS$OGGADMIN.OGG$Q_ET1.ORCLRAC' SCOPE=MEMORY SID='orclrac2';
Tue Aug 30 15:06:31 2016
GoldenGate Apply: OGG$ET1 APPLY Dropped
APPLY OGG$ET1: Apply User: OGGADMIN
APPLY OGG$ET1: Apply Tag: 00
Tue Aug 30 15:06:32 2016
Streams Capture: OGG$CAP_ET1 CAPTURE Dropped
CAPTURE OGG$CAP_ET1: Start SCN: 46165434320 (0xbfac9fd0.0000000a)
CAPTURE OGG$CAP_ET1: First SCN: 46165434320 (0xbfac9fd0.0000000a)
CAPTURE OGG$CAP_ET1: Required Checkpoint SCN: 46264410538 (0xc592e1aa.0000000a)
CAPTURE OGG$CAP_ET1: Captured SCN: 46264410853 (0xc592e2e5.0000000a)
CAPTURE OGG$CAP_ET1: Applied SCN: 46264410538 (0xc592e1aa.0000000a)
CAPTURE OGG$CAP_ET1: Capture Type: LOCAL
CAPTURE OGG$CAP_ET1: Logminer Id: 2
CAPTURE OGG$CAP_ET1: Source Database: ORCLRAC
Tue Aug 30 15:06:42 2016
ALTER SYSTEM SET service_names='hubsrac' SCOPE=MEMORY SID='orclrac2';
再次檢查obsolete
RMAN> report obsolete;
RMAN retention policy will be applied to the command
RMAN retention policy is set to redundancy 2
Report of obsolete backups and copies
Type Key Completion Time Filename/Handle
-------------------- ------ ------------------ --------------------
Backup Set 326851 2016/08/28 00:01:42
Backup Piece 326851 2016/08/28 00:01:42 /mnt/orclbackup/log_20160828_328204_1
Backup Set 326855 2016/08/28 01:01:55
Backup Piece 326855 2016/08/28 01:01:55 /mnt/orclbackup/log_20160828_328208_1
Backup Set 326859 2016/08/28 02:01:54
Backup Piece 326859 2016/08/28 02:01:54 /mnt/orclbackup/log_20160828_328212_1
Backup Set 326872 2016/08/28 03:01:44
Backup Piece 326872 2016/08/28 03:01:44 /mnt/orclbackup/log_20160828_328227_1
Backup Set 326880 2016/08/28 04:01:33
Backup Piece 326880 2016/08/28 04:01:33 /mnt/orclbackup/log_20160828_328234_1
Backup Set 326884 2016/08/28 05:01:35
Backup Piece 326884 2016/08/28 05:01:35 /mnt/orclbackup/log_20160828_328238_1
Backup Set 326888 2016/08/28 06:02:08
Backup Piece 326888 2016/08/28 06:02:08 /mnt/orclbackup/log_20160828_328242_1
Backup Set 326892 2016/08/28 07:01:20
Backup Piece 326892 2016/08/28 07:01:20 /mnt/orclbackup/log_20160828_328246_1
Backup Set 326893 2016/08/28 07:02:27
Backup Piece 326893 2016/08/28 07:02:27 /mnt/orclbackup/log_20160828_328247_1
Backup Set 326897 2016/08/28 08:01:17
Backup Piece 326897 2016/08/28 08:01:17 /mnt/orclbackup/log_20160828_328251_1
Backup Set 326898 2016/08/28 08:02:24
Backup Piece 326898 2016/08/28 08:02:24 /mnt/orclbackup/log_20160828_328252_1
Backup Set 326902 2016/08/28 09:01:14
Backup Piece 326902 2016/08/28 09:01:14 /mnt/orclbackup/log_20160828_328256_1
Backup Set 326903 2016/08/28 09:02:19
Backup Piece 326903 2016/08/28 09:02:19 /mnt/orclbackup/log_20160828_328257_1
Backup Set 326907 2016/08/28 10:01:17
Backup Piece 326907 2016/08/28 10:01:17 /mnt/orclbackup/log_20160828_328261_1
Backup Set 326908 2016/08/28 10:02:24
Backup Piece 326908 2016/08/28 10:02:24 /mnt/orclbackup/log_20160828_328262_1
Backup Set 326912 2016/08/28 11:02:08
Backup Piece 326912 2016/08/28 11:02:08 /mnt/orclbackup/log_20160828_328266_1
Backup Set 326916 2016/08/28 12:02:13
Backup Piece 326916 2016/08/28 12:02:13 /mnt/orclbackup/log_20160828_328270_1
Backup Set 326920 2016/08/28 13:02:23
Backup Piece 326920 2016/08/28 13:02:23 /mnt/orclbackup/log_20160828_328274_1
Backup Set 326924 2016/08/28 14:01:26
Backup Piece 326924 2016/08/28 14:01:26 /mnt/orclbackup/log_20160828_328278_1
Backup Set 326925 2016/08/28 14:02:41
刪除即可
RMAN> delete obsolete;
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29320885/viewspace-2124198/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- DELETE OBSOLETE不刪除歸檔日誌以及歸檔的備份集delete
- RMAN說,我能備份(5)--RMAN備份歸檔檔案
- rman全庫備份備份歸檔日誌檔案
- RMAN備份歸檔日誌多份 %c
- Rman備份中obsolete和expired的區別
- RMAN備份中冗餘度和Obsolete的備份的關係
- RMAN備份歸檔日誌指令碼指令碼
- 非歸檔資料庫RMAN備份資料庫
- rman開啟備份優化對備份歸檔的影響優化
- 不備份上次已經備份的歸檔
- RMAN恢復(rman只備份資料庫,但不備份歸檔,歸檔透過簡單的rsync或scp來傳送到異地備份)資料庫
- rman備份但丟失一個資料檔案,但有歸檔備份
- RMAN備份整庫和歸檔日誌的方法
- 原創 Rman備份中obsolete和expired的區別
- RMAN備份、恢復實驗室 之 備份篇 【歸檔模式】模式
- rman備份後為什麼要同時備份歸檔日誌
- Rman Crosscheck刪除失效歸檔-備份恢復ROS
- Oracle設定多個歸檔路徑生成多份歸檔日誌,Rman備份時也只備份其中的一份歸檔日誌Oracle
- RMAN備份資料檔案+控制檔案+歸檔日誌
- rman在歸檔與非歸檔時備份資料庫的簡單示例資料庫
- 歸檔日誌大小 與使用rman 備份後的歸檔日誌產生的備份集大小的關係
- RMAN備份及恢復歸檔日誌的語法
- 如何刪除控制檔案中過去rman備份到磁帶的歸檔備份集
- 用RMAN備份歸檔日誌時檢查歸檔日誌是否存在
- dg丟失歸檔,使用rman增量備份恢復
- RMAN在歸檔/非歸檔,庫關閉/mounted/開啟狀態下的備份
- 故障分析 | MySQL 備份檔案靜默損壞一例分析MySql
- Oracle的奇葩設定之非歸檔模式與RMAN備份Oracle模式
- ORACLE NBU調取oracle rman指令碼備份歸檔不自動刪除歸檔Oracle指令碼
- 使用logmnr,在RMAN備份檔案中恢復備份的歸檔日誌檔案進行分析
- rman備份檔案的格式
- rman備份OBSOLETE和EXPIRED引數來歷及區別
- rman 非歸檔模式下停庫備份與恢復模式
- 請問RMAN備份異機還原,備份之後的歸檔日誌在RMAN中怎麼處理?
- RMAN備份恢復之歸檔日誌對BLOCKRECOVER的影響BloC
- Backup And Recovery User's Guide-從RMAN開始-備份資料庫-備份處於歸檔模式的資料庫GUIIDE資料庫模式
- 備份與恢復--從備份的歸檔日誌中恢復資料
- RAC環境下的RMAN 備份指令碼一例指令碼