Thứ Ba, 14 tháng 1, 2020

Khắc phục lỗi recovery khi OPEN RESETLOGS lỗi SYSTEM trong Oracle Database?

Error log:
SQL> alter database open resetlogs;
alter database open resetlogs
*
ERROR at line 1:
ORA-01194: file 1 needs more recovery to be consistent
ORA-01110: data file 1: '/u01/app/oracle/oradata/ORCL/system01.dbf'
Workaround for cho lỗi này là cung cấp tất cả các archive log file có sẵn để khôi phục:
SQL> recover database using backup controlfile until cancel;
...
Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
AUTO
Lệnh trên sẽ tự động áp dụng tất cả các archive log có sẵn. Bây giờ hãy thử mở cơ sở dữ liệu với resetlogs:
SQL> alter database open resetlogs;
Nếu lỗi vẫn còn do archived log không đủ, hãy thực hiện cách giải quyết sau workaround:
SQL> shutdown immediate
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.
Startup database ở chế độ mount:
SQL> startup mount
ORACLE instance started.
Total System Global Area 530288640 bytes
Fixed Size 2131120 bytes
Variable Size 310381392 bytes
Database Buffers 209715200 bytes
Redo Buffers 8060928 bytes
Database mounted.
Thay đổi tham số “_allow_resetlogs_corruption” thành TRUE và undo_management thành MANUAL:
SQL> ALTER SYSTEM SET "_allow_resetlogs_corruption"= TRUE SCOPE = SPFILE;
SQL> ALTER SYSTEM SET undo_management=MANUAL SCOPE = SPFILE;
Sau đó thực hiện các thay đổi ở trên, tắt cơ sở dữ liệu và khởi động:
SQL> shutdown immediate
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.
SQL> startup mount
ORACLE instance started.
Total System Global Area 530288640 bytes
Fixed Size 2131120 bytes
Variable Size 310381392 bytes
Database Buffers 209715200 bytes
Redo Buffers 8060928 bytes
Database mounted.
Bây giờ hay thử lại resetlogs:
SQL> alter database open resetlogs;
Database altered.
Tạo undo tablespace mới và thiết lập tham số “undo_tablespace” tới undo tablespace mới và thay đổi tham số “undo_management” thành AUTO:
SQL> CREATE UNDO TABLESPACE undo2 datafile '/u01/app/oracle/oradata/ORCL/undo2_df1.dbf' size 200m autoextend on maxsize 30G;
Tablespace created.
SQL> alter system set undo_tablespace = undo2 scope=spfile;
System altered.
SQL> alter system set undo_management=auto scope=spfile;
System altered.
Khởi động lại:
SQL> shutdown immediate
SQL> startup
Chúc mừng!!! Database  được bật thành công
@ Trần Văn Bình - Founder of Oracle DBA AZ 

#học oracle #oracle database #khóa học oracle online #khóa học oca #học oca ở đâu #oca là gì #oca oracle #BossData #OraAz #OracleDBAAz #OracleTutorial #Quản_trị_cơ_sở_dữ_liệu_Oracle #OracleDBA #OracleDatabaseAdministration

ĐỌC NHIỀU

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