Recover inconsistent/corrupt data file in Oracle DB

Fix: ORA-01194: file 1 needs more recovery to be consistent

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
SQL> sqlplus sys/sys as sysdba

SQL> alter database open resetlogs;

SQL> recover database using backup controlfile until cancel;
...
Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
AUTO

SQL> alter database open resetlogs;

SQL> shutdown immediate

SQL> startup mount

SQL> ALTER SYSTEM SET "_allow_resetlogs_corruption"= TRUE SCOPE = SPFILE;
SQL> ALTER SYSTEM SET undo_management=MANUAL SCOPE = SPFILE;

SQL> shutdown immediate

SQL> startup mount

SQL> alter database open resetlogs;
Database altered.

SQL> CREATE UNDO TABLESPACE undo2 datafile 'D:\oraclexe\app\oracle\oradata\XE\undo2_df1.dbf' size 200m autoextend on maxsize 20G;
Tablespace created.

SQL> alter system set undo_tablespace = undo2 scope=spfile;
System altered.

SQL> alter system set undo_management=auto scope=spfile;
System altered.

SQL> shutdown immediate
SQL> startup

Reference:
https://dbatricksworld.com/ora-01194-file-1-needs-more-recovery-to-be-consistent/
http://blog.itpub.net/77164/viewspace-668388/
https://stackoverflow.com/questions/53676/how-to-resolve-ora-011033-oracle-initialization-or-shutdown-in-progress