Sau khi lỗi disk, Oracle Database không được bật lên:
SQL> startup
ORACLE instance started.
Total System Global Area 4093640704 bytes
Fixed Size 2076296 bytes
Variable Size 3120562552 bytes
Database Buffers 956301312 bytes
Redo Buffers 14700544 bytes
Database mounted.
ORA-01113: file 1 needs media recovery
If i try to recover the specific datafile '/ora4/MISPROD/datafiles/system01.dbf' then i get at the alert.log
Fri Mar 30 19:12:20 2020
Media RECOVERY START
WARNING! Recovering DATA FILE 1 FROM a fuzzy BACKUP. It might be an ONLINE
BACKUP taken WITHOUT entering THE BEGIN BACKUP command.
PARALLEL RECOVERY started WITH 7 processes
Fri Mar 30 19:12:20 2020
Errors IN FILE /oracle/app/oracle/ADMIN/MISPROD/udump/misprod_ora_13962.trc:
ORA-00322: LOG 7 OF THREAD 1 IS NOT CURRENT copy
ORA-00312: ONLINE LOG 7 THREAD 1: '/ora2/MISPROD/redologs/redo07.log'
Câu lệnh để recover database:
1. sqlplus>RECOVER DATABASE USING BACKUP CONTROLFILE UNTIL CANCEL
Thông báo hiển thị:
ORA-00279: CHANGE 6369425262914 GENERATED AT 30/03/2020 11:06:27 NEEDED FOR THREAD 1
ORA-00289: suggestion : /oracle/archives/1_58621_685245590.arc
ORA-00280: CHANGE 6369425262914 FOR THREAD 1 IS IN SEQUENCE #1
Specify LOG: {=suggested | filename | AUTO | CANCEL}
CANCEL nó sẽ yêu cầu archivelog với sequence#=58621.
Để tìm sequence# cuối cùng:
SELECT SEQUENCE#, archived, TO_CHAR(first_time, 'DD/MM/YYYY HH24:MI') first_time
FROM v$log
ORDER BY first_time DESC;
2. Lấy redo entry trong file redolog /ora2/MISPROD/redologs/redo07.log
* Trong file alert.log after xuất hiện filename redolog:
Fri Mar 30 22:35:18 2020
Media RECOVERY LOG /ora2/MISPROD/redologs/redo07.LOG
Fri Mar 30 22:35:18 2020
* Thực hiện Incomplete RECOVERY để apply mọi redo được tạo ra
RECOVER database until CHANGE 6369425262914;
Fri Mar 30 22:35:18 2020
Media RECOVERY COMPLETE (MISPROD)
3. Cuối cùng OPEN database với chế độ resetlogs
SQL> alter database open resetlogs;