martes, 9 de julio de 2013

How to resolve ORA-00392 ORA-00312

I did a restore/recover from my original RAC to another RAC in another server. When i created the ASM diskgroups, I change one of their original names, exactly +FRAN_DATA for +DATA.
The restore/recover was ok but when i tried to open database with "resetlogs" option i got ORA-00392 and ORA-00312.
The solution is easy, you should clear the busy onlinelog and later change one by one all the redologs name until you can open database with resetlogs option. Something ike this:


SQL> alter database open resetlogs;
alter database open resetlogs
*
ERROR en línea 1:
ORA-00392: el log 27 del thread 2 se está limpiando, operación no permitida
ORA-00312: log online 27 thread 2: '+DATA/fran/onlinelog/group_27'



SQL> alter database clear logfile group 27;

Base de datos modificada.


SQL> alter database open resetlogs;

alter database open resetlogs
*
ERROR en línea 1:
ORA-00349: fallo al obtener el tamaño del bloque para
'+FRAN_DATA/fran/onlinelog/group_20'
ORA-15001: diskgroup "FRAN_DATA" does not exist or is not mounted
ORA-15001: diskgroup "FRAN_DATA" does not exist or is not mounted


SQL> alter database rename file '+FRAN_DATA/fran/onlinelog/group_20' to '+DATA/fran/onlinelog/group_20';


Base de datos modificada.


SQL>  alter database open resetlogs;

 alter database open resetlogs
*
ERROR en línea 1:
ORA-00349: fallo al obtener el tamaño del bloque para
'+FRAN_DATA/fran/onlinelog/group_21'
ORA-15001: diskgroup "FRAN_DATA" does not exist or is not mounted
ORA-15001: diskgroup "FRAN_DATA" does not exist or is not mounted


SQL> alter database rename file '+FRAN_DATA/fran/onlinelog/group_21' to '+DATA/fran/onlinelog/group_21';


Base de datos modificada.


SQL> alter database open resetlogs

  2  ;
alter database open resetlogs
*
ERROR en línea 1:
ORA-00349: fallo al obtener el tamaño del bloque para
'+FRAN_DATA/fran/onlinelog/group_22'
ORA-15001: diskgroup "FRAN_DATA" does not exist or is not mounted
ORA-15001: diskgroup "FRAN_DATA" does not exist or is not mounted


SQL>  alter database rename file '+FRAN_DATA/fran/onlinelog/group_22' to '+DATA/fran/onlinelog/group_22';


Base de datos modificada.


SQL> alter database open resetlogs;

alter database open resetlogs
*
ERROR en línea 1:
ORA-00349: fallo al obtener el tamaño del bloque para
'+FRAN_DATA/fran/onlinelog/group_23'
ORA-15001: diskgroup "FRAN_DATA" does not exist or is not mounted
ORA-15001: diskgroup "FRAN_DATA" does not exist or is not mounted


SQL> alter database rename file '+FRAN_DATA/fran/onlinelog/group_23' to '+DATA/fran/onlinelog/group_23';


Base de datos modificada.


SQL> alter database rename file '+FRAN_DATA/fran/onlinelog/group_24' to '+DATA/fran/onlinelog/group_24';


Base de datos modificada.


SQL> alter database open resetlogs;

alter database open resetlogs
*
ERROR en línea 1:
ORA-00349: fallo al obtener el tamaño del bloque para
'+FRAN_DATA/fran/onlinelog/group_25'
ORA-15001: diskgroup "FRAN_DATA" does not exist or is not mounted
ORA-15001: diskgroup "FRAN_DATA" does not exist or is not mounted


SQL> alter database rename file '+FRAN_DATA/fran/onlinelog/group_25' to '+DATA/fran/onlinelog/group_25';


Base de datos modificada.


SQL> alter database rename file '+FRAN_DATA/fran/onlinelog/group_26' to '+DATA/fran/onlinelog/group_26';


Base de datos modificada.


SQL> alter database open resetlogs;


Base de datos modificada.


:)