ora-00314 log 1 of thread 1 expected sequence# does not match ora-00312:
There can be many reasons for log sequence mismatch, may be there was instance crash occured when there was transfer of redo logs or abnormally shutdown database or network issue, etc., this error tells you that you have sequence which is not match with the sequence applying.
ORA-00314: log 1 of thread 1, expected sequence# 33873 doesn't match 33865
From above 33865 is getting transfer but header of controlfile expecting 33873 sequence, it is not getting match and resulting in error.
In this condition you have to use recover database command and reset the log sequence, after doing this header will be get loaded with sequence 1.
Note: Before doing all this steps take full backup of datafile,controlfile and Archive log files for safety side, so that condition will never become worse than now.
Below is commands to get rid of this error:
First of all if there was no restore perform then we have to just overwrite the Online logs, check with below query if there are any file to recover
select * from v$recover_file; no rows selected.
If no rows selected then you can move to forward steps.
select group#, thread#, sequence#, bytes / 1024 / 1024 "Size in MB", members, archived, status from v$log; GROUP# THREAD# SEQUENCE# Size in MB MEMBERS ARC STATUS ---------- ---------- ---------- ---------- ---------- --- ---------------- 1 1 33873 500 2 YES INACTIVE 3 1 33874 500 2 YES INACTIVE 2 1 33875 500 2 NO CURRENT
See the sequence column there will be some number which is displayed in the error.
Now shutdown the database and startup it mount mode
shutdown immediate; startup mount;
Finally recovery and open the database in resetlogs mode:
recover database until cancel; ## This should report "Media recovery complete." alter database open resetlogs;
You can again check by command v$log which is given in above steps and see the sequence number it should be 1.
In this process there will be no loss of data and take backup for safety side.