Oracle

Oracle:損壞的數據文件不會重新聯機?

  • September 13, 2021

在某個問題上需要立即幫助… Oracle 支持需要很長時間才能回复。

我們的一個表空間中有一個損壞的數據文件,我試圖離線關閉數據文件,然後執行還原並從備用數據庫恢復。但是,recover 返回了一個錯誤,指出序列失去或未應用。現在我無法將數據文件重新聯機,並且模式上的所有操作都已停止。

RMAN> recover datafile 88;
...
...
...
archived log thread=1 sequence=94742
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 09/08/2021 22:05:54
RMAN-06055: could not find archived log with sequence 94742 for thread 1

RMAN> alter database datafile 88 online;

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of sql statement command at 09/08/2021 22:07:49
ORA-01113: file 88 needs media recovery
ORA-01110: data file 88: '/ora03/oracle/oradata/REPPRD01/AFM_DATA05.DBF'

有小費嗎?我拼命地嘗試任何事情。

編輯: 是的,我試過了recover datafile 88 until sequence 94742

EDIT2: 數據保護配置:

DGMGRL> show configuration

Configuration - REPPRD01_DR

 Protection Mode: MaxPerformance
 Members:
 REPPRD01 - Primary database
   Error: ORA-16724: cannot resolve gap for one or more standby databases

   rep01    - Physical standby database
     Error: ORA-16766: Redo Apply is stopped

Fast-Start Failover: DISABLED

Configuration Status:
ERROR   (status updated 21 seconds ago)

備用配置:

RMAN> show all;

RMAN configuration parameters for database with db_unique_name REP01 are:
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;
CONFIGURE BACKUP OPTIMIZATION OFF; # default
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 PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
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 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE ; # default
CONFIGURE RMAN OUTPUT TO KEEP FOR 7 DAYS; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/u01/oracle/product/12.1.0.2/dbs/snapcf_REP01.f'; # default

修復是在主數據庫中執行 BMR 恢復之前在備用狀態下執行以下命令:

RMAN> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION;

將歸檔刪除策略更改為應用於所有備用數據庫。這將防止存檔因備份後被刪除而無法傳輸的情況。

現在希望您的備份正常並恢復所有歸檔日誌:

restore archivelog from sequence 94742;

在此之後重新啟動恢復過程。

在此設置後監控您的存檔空間。

引用自:https://dba.stackexchange.com/questions/299321