Saturday, November 14, 2020

ORA-00742: Log read detects lost write in thread 1 sequence 7 block 644504

 Database startup command giving below error 

SQL> startup;

ORACLE instance started.

 

Total System Global Area 4.0802E+10 bytes

Fixed Size                  2934936 bytes

Variable Size            6710888296 bytes

Database Buffers         3.3957E+10 bytes

Redo Buffers              131280896 bytes

Database mounted.

ORA-00742: Log read detects lost write in thread 1 sequence 7 block 644504

ORA-00312: online log 2 thread 1: '/<dbname>/db/onlinelog/redo02b.log'

ORA-00312: online log 2 thread 1: '/<dbname>/db/onlinelog/redo02a.log'


Solution : 

Ensure database is in mount state 

SQL> select name,open_mode from v$database;


NAME      OPEN_MODE

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

<dbname>  MOUNTED


SQL> set lines 300

SQL> select * from v$log;


    GROUP#    THREAD#  SEQUENCE#      BYTES  BLOCKSIZE    MEMBERS ARC STATUS           FIRST_CHANGE# FIRST_TIME         NEXT_CHANGE# NEXT_TIME                  CON_ID

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

         1          1          6 1073741824        512          2 NO  INACTIVE            1.5897E+13 12-NOV-20            1.5897E+13 14-NOV-20                       0

         2          1          7 1073741824        512          2 NO  CURRENT             1.5897E+13 14-NOV-20            2.8147E+14                                 0

         5          1          5 1073741824        512          2 NO  INACTIVE            1.5897E+13 10-NOV-20            1.5897E+13 12-NOV-20                       0

         4          1          4 1073741824        512          2 YES INACTIVE            1.5897E+13 10-NOV-20            1.5897E+13 10-NOV-20                       0

         3          1          3 1073741824        512          2 YES INACTIVE            1.5897E+13 10-NOV-20            1.5897E+13 10-NOV-20                       0


--- Recover database from redolog groups using below commands

SQL> recover database until cancel;

ORA-00279: change 15896705587493 generated at 11/14/2020 00:17:41 needed for thread 1

ORA-00289: suggestion : /<dbname>/db/archive/<dbname>/archivelog/2020_11_14/o1_mf_1_7_%u_.arc

ORA-00280: change 15896705587493 for thread 1 is in sequence #7



Specify log: {<RET>=suggested | filename | AUTO | CANCEL}

/<dbname>/db/onlinelog/redo02b.log   <-- This is the redolog which error pointed 

Log applied.

Media recovery complete

--- Open database with resetlogs 


SQL> alter database open resetlogs;


Database altered.


-- Crosscheck the database and ensure it is in Read/Write mode 

SQL> select name,open_mode from v$database;


NAME      OPEN_MODE

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

<dbname>  READ WRITE

No comments:

Post a Comment