Chủ Nhật, 25 tháng 10, 2020

Cách khắc phục lỗi SAN dẫn đến lỗi datafile system khi bật Oracle Database

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
ORA-01110: data file 1: '/ora4/MISPROD/datafiles/system01.dbf'
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;


KẾT NỐI VỚI CHUYÊN GIA TRẦN VĂN BÌNH: 📧 Mail: binhoracle@gmail.com ☎️ Mobile: 0902912888 ⚡️ Skype: tranbinh48ca 👨 Facebook: https://www.facebook.com/BinhOracleMaster 👨 Inbox Messenger: https://m.me/101036604657441 (profile) 👨 Fanpage: https://www.facebook.com/tranvanbinh.vn 👨 Inbox Fanpage: https://m.me/tranvanbinh.vn 👨👩 Group FB: https://www.facebook.com/groups/OracleDBAVietNam 👨 Website: http://www.tranvanbinh.vn 👨 Blogger: https://tranvanbinhmaster.blogspot.com 🎬 Youtube: http://bit.ly/ytb_binhoraclemaster 👨 Tiktok: https://www.tiktok.com/@binhoraclemaster?lang=vi 👨 Linkin: https://www.linkedin.com/in/binhoracle 👨 Twitter: https://twitter.com/binhoracle 👨 Địa chỉ: Tòa nhà Sun Square - 21 Lê Đức Thọ - Phường Mỹ Đình 1 - Quận Nam Từ Liêm - TP.Hà Nội #OracleTutorial #OracleDBA #OracleDatabaseAdministration #học oracle database #oca #ocp #oce #ocm

ĐỌC NHIỀU

Trần Văn Bình - Oracle Database Master