【无标题】


SQL> startup force
ORACLE instance started.

Total System Global Area 2382361320 bytes
Fixed Size                  9167592 bytes
Variable Size            1241513984 bytes
Database Buffers         1124073472 bytes
Redo Buffers                7606272 bytes
Database mounted.
ORA-00742: Log read detects lost write in thread 3 sequence 64 block 877
ORA-00312: online log 6 thread 3: '+DATA/CDB/ONLINELOG/group_6.287.1148481317'
ORA-00312: online log 6 thread 3: '+DATA/CDB/ONLINELOG/group_6.294.1148481317'

SQL> recover database until cancel;
ORA-00279: change 6923676 generated at 12/25/2023 22:40:42 needed for thread 3
ORA-00289: suggestion : +DATA1
ORA-00280: change 6923676 for thread 3 is in sequence #64


Specify log: {=suggested | filename | AUTO | CANCEL}
cancel
ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below
ORA-01194: file 1 needs more recovery to be consistent
ORA-01110: data file 1: '+DATA/CDB/DATAFILE/system.275.1148478571'


ORA-01112: media recovery not started


SQL> recover database
ORA-00283: recovery session canceled due to errors
ORA-00742: Log read detects lost write in thread 3 sequence 64 block 877
ORA-00312: online log 6 thread 3: '+DATA/CDB/ONLINELOG/group_6.287.1148481317'
ORA-00312: online log 6 thread 3: '+DATA/CDB/ONLINELOG/group_6.294.1148481317'


[oracle@rac2 ~]$ rman target /

Recovery Manager: Release 19.0.0.0.0 - Production on Thu Dec 28 22:58:24 2023
Version 19.20.0.0.0

Copyright (c) 1982, 2019, Oracle and/or its affiliates.  All rights reserved.

connected to target database: CDB (DBID=2265125454, not open)

RMAN> restore database;

channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:03
Finished restore at 28-DEC-23

RMAN> recover database;

Starting recover at 28-DEC-23
using channel ORA_DISK_1

starting media recovery 
archived log file name=+DATA1/CDB/ARCHIVELOG/2023_12_23/thread_1_seq_109.295.1156298003 thread=1 sequence=109
archived log file name=+DATA1/CDB/ARCHIVELOG/2023_12_25/thread_2_seq_90.311.1156545643 thread=2 sequence=90
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 12/28/2023 22:59:34
ORA-00283: recovery session canceled due to errors
RMAN-11003: failure during parse/execution of SQL statement: alter database recover logfile '+DATA1/CDB/ARCHIVELOG/2023_12_25/thread_2_seq_90.311.1156545643'
ORA-00283: recovery session canceled due to errors
ORA-00742: Log read detects lost write in thread 3 sequence 64 block 877
ORA-00312: online log 6 thread 3: '+DATA/CDB/ONLINELOG/group_6.287.1148481317'
ORA-00312: online log 6 thread 3: '+DATA/CDB/ONLINELOG/group_6.294.1148481317'
RMAN-11003: failure during parse/execution of SQL statement: alter database recover continue
ORA-00279: change 6808732 generated at 12/24/2023 23:34:48 needed for thread 2
ORA-00289: suggestion : +DATA1/CDB/ARCHIVELOG/2023_12_25/thread_2_seq_90.311.1156545643
ORA-00280: change 6808732 for thread 2 is in sequence #90


starting media recovery
media recovery failed
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 12/28/2023 23:02:29
ORA-00283: recovery session canceled due to errors
RMAN-11003: failure during parse/execution of SQL statement: alter database recover
 if needed start
ORA-00283: recovery session canceled due to errors
ORA-00742: Log read detects lost write in thread 3 sequence 64 block 877
ORA-00312: online log 6 thread 3: '+DATA/CDB/ONLINELOG/group_6.287.1148481317'
ORA-00312: online log 6 thread 3: '+DATA/CDB/ONLINELOG/group_6.294.1148481317'

RMAN> RECOVER DATABASE UNTIL CANCEL;

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00558: error encountered while parsing input commands
RMAN-01009: syntax error: found "cancel": expecting one of: "available, scn, sequence, time"
RMAN-01007: at line 1 column 24 file: standard input

RMAN> exit


Recovery Manager complete.
[oracle@rac2 ~]$ s

SQL*Plus: Release 19.0.0.0.0 - Production on Thu Dec 28 23:04:00 2023
Version 19.20.0.0.0

Copyright (c) 1982, 2022, Oracle.  All rights reserved.


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.20.0.0.0

SQL>  RECOVER DATABASE UNTIL CANCEL;
ORA-00279: change 6923619 generated at 12/25/2023 22:40:41 needed for thread 3
ORA-00289: suggestion :
+DATA1/CDB/ARCHIVELOG/2023_12_25/thread_3_seq_63.292.1156545643
ORA-00280: change 6923619 for thread 3 is in sequence #63


Specify log: {=suggested | filename | AUTO | CANCEL}
cancel
ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below
ORA-01196: file 1 is inconsistent due to a failed media recovery session
ORA-01110: data file 1: '+DATA/CDB/DATAFILE/system.275.1148478571'


ORA-01112: media recovery not started


SQL>  RECOVER DATABASE UNTIL CANCEL;
ORA-00279: change 6923619 generated at 12/25/2023 22:40:41 needed for thread 3
ORA-00289: suggestion :
+DATA1/CDB/ARCHIVELOG/2023_12_25/thread_3_seq_63.292.1156545643
ORA-00280: change 6923619 for thread 3 is in sequence #63


Specify log: {=suggested | filename | AUTO | CANCEL}
auto
ORA-00279: change 6923676 generated at 12/25/2023 22:40:42 needed for thread 3
ORA-00289: suggestion : +DATA1
ORA-00280: change 6923676 for thread 3 is in sequence #64
ORA-00278: log file
'+DATA1/CDB/ARCHIVELOG/2023_12_25/thread_3_seq_63.292.1156545643' no longer
needed for this recovery


ORA-00308: cannot open archived log '+DATA1'
ORA-17503: ksfdopn:2 Failed to open file +DATA1
ORA-15045: ASM file name '+DATA1' is not in reference form


SQL> RECOVER DATABASE UNTIL CANCEL;
ORA-00279: change 6923676 generated at 12/25/2023 22:40:42 needed for thread 3
ORA-00289: suggestion : +DATA1
ORA-00280: change 6923676 for thread 3 is in sequence #64


Specify log: {=suggested | filename | AUTO | CANCEL}
cancel
Media recovery cancelled.
SQL> alter database open resetlogs;
alter database open resetlogs
*
ERROR at line 1:
ORA-00600: internal error code, arguments: [krsi_al_hdr_update.invalid_nab_1],
[4294967295], [], [], [], [], [], [], [], [], [], []


SQL>  RECOVER DATABASE UNTIL CANCEL;
ORA-00283: recovery session canceled due to errors
ORA-01610: recovery using the BACKUP CONTROLFILE option must be done


SQL> recover database using  BACKUP CONTROLFILE  UNTIL CANCEL;
ORA-00283: recovery session canceled due to errors
ORA-38872: Cannot perform backup control file recovery if Flashback Database is
enabled.


SQL> alter database flashback off;

Database altered.

SQL>  recover database using  BACKUP CONTROLFILE  UNTIL CANCEL;
ORA-00279: change 6923676 generated at 12/25/2023 22:40:42 needed for thread 3
ORA-00289: suggestion : +DATA1
ORA-00280: change 6923676 for thread 3 is in sequence #64


Specify log: {=suggested | filename | AUTO | CANCEL}
cancel
Media recovery cancelled.
SQL> alter database open resetlogs;

Database altered.

SQL>

--------------------

CAUSE

REDO03.LOG was lost .
 
The ora-742 says there was a lost write to REDO03.LOG .
 

SOLUTION

SQL> alter system dump logfile 'E:\ARCHIVELOGS\xxx\REDO03.LOG' validate;


Clear the log in order to enable the archival again


SQL> select group#,member from v$logfile;
SQL> alter database clear unarchived logfile group ;

Should be group# 3 , if yes

After this ,  take a full backup, because the old one would not be useful anymore because of the lost of archive log sequence .

Production DB crashed with ORA-00742: Log read detects lost write in thread n sequence xxxxxx block #
ORA-00312: online log  thread : '+//redologfile.log'.

Database has been recovered using all the archived and available online redo log files and made sure that no datafile is in fuzzy state in v$datafile_header

Recover database is successful. 

RMAN> recover database;

Starting recover at 2022-09-14 23:27:56
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=6 instance= device type=DISK

starting media recovery
media recovery complete, elapsed time: 00:00:03

Finished recover at 2022-09-14 23:28:18
RMAN>  

SQL> select * from v$recover_file;

no rows selected


But while trying to open the database, it fails with below error

SQL> alter database open;
alter database open
*
ERROR at line 1:
ORA-00742: Log read detects lost write in thread  sequence  block 
ORA-00312: online log  thread : '+//redologfile.log'

While trying to perform clear unarchived logfile as mentioned in document Doc ID 2064718.1, it fails with below error. 
 

SQL> alter database clear unarchived logfile group ;
alter database clear unarchived logfile group 
*
ERROR at line 1:
ORA-01624: log  needed for crash recovery of instance (thread )
ORA-00312: online log  thread : '+//redologfile.log'

CHANGES

CAUSE

lost write on online redo log file.
 
archive failed for online redo log file due to lost write on a block has been identified
 

SOLUTION

Recreate controlfile using trace output with noresetlogs option and then mount the database

Do a fake recovery using RMAN and then open database.

RMAN> recover database; 

RMAN> alter database open;

Once the database is opened, clear the corrupted redo log file using the below statement

SQL> alter database clear unarchived logfile group ;

Make sure the issue that caused the lost write is fixed and take a full backup of the database. 

你可能感兴趣的:(oracle)