\

Friday, May 19, 2017

What can happen with a database after power failure

I know, I know it should never happen on productions, but if - you will probably see this error:
ORA-00600: internal error code, arguments: [kcratr_nab_less_than_odr], [1], [32725], [29121], [30345], [], [], [], [], [], [], []

Unfortunately in this case you cannot open the database. But don't panic there is a way to deal with that. Start from create controlfile from trace:
SQL> ALTER DATABASE BACKUP CONTROLFILE TO TRACE AS '/tmp/control.sql' resetlogs;

Then shutdown and startup database:
SQL> Shutdown abort;
SQL> Startup mount ;

recover
SQL> recover database using backup controlfile until cancel;

and now you can open it
SQL> alter database open resetlogs;