ORA-02291: integrity constraint (RMAN.RLH_F1) violated

PROBLEMAS CON RMAN : REGISTER DATABASE – UNREGISTER DATABASE

Me disponia a realizar la tarea de agregar una base de desarrollo a los backups automaticos con RMAN por una solictud de gente de ese departamento ya que hace un tiempo la tenian abandonada y estaban teniendo una fuerte actividad developer. Mi sorpresa fue mayuscula cuando me intento loguear para registrarla en el catalogo de RMAN y probrar un backup de controlfile arrojandome el error ORA-02291

[oracle@dat1010lx bin]$ rman target / catalog=rman@catrman

Recovery Manager: Release 10.2.0.4.0 - Production on Thu Nov 4 16:29:34 2010

Copyright (c) 1982, 2007, Oracle.  All rights reserved.

connected to target database: POTDESA (DBID=3043094951)
recovery catalog database Password:
connected to recovery catalog database

RMAN> register database;

starting full resync of recovery catalog
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of register command at 11/04/2010 16:29:46
RMAN-03014: implicit resync of recovery catalog failed
RMAN-03009: failure of full resync command on default channel at 11/04/2010 16:29:46
ORA-02291: integrity constraint (RMAN.ORL_F1) violated - parent key not found

RMAN> quit

El error estaba ocurriendo por que los chicos del team habian registrado la base para automatizar la tarea, y mientras se resincornizaba
alguien bajo la base del catalogo, quedando asi de manera inconsistente.

¿ Como seguimos ?

Sencillo , tenia que deregistrar la base y volver a correr el registro de la misma de forma ordenada.
Al ejecutar el UNREGISTER, me encuentro con el mismo problema, ups !

RMAN>unregister database;
starting full resync of recovery catalog
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of register command at 11/04/2010 16:29:46
RMAN-03014: implicit resync of recovery catalog failed
RMAN-03009: failure of full resync command on default channel at 11/04/2010 16:29:46
ORA-02291: integrity constraint (RMAN.ORL_F1) violated - parent key not found

RMAN> quit

Me dispuse a revisar en el catalogo y a leer un poco en la documentacion oficial y me decidi por correr el paquete DBMS_RCVCAT.UNREGISTERDATABASE.
Previamente corri el query que les dejo para que arme de manera automatica la corrida del paquete, poniendo como parametro POTDESA.

[oracle@dat1010lx bin]$ sqlplus rman@catrman

SQL> set line 150
SQL> select 'EXEC DBMS_RCVCAT.UNREGISTERDATABASE('||DB_KEY||','||DBID||');'
   command, resetlogs_time
  from rc_database
  where name = 'POTDESA';  2    3    4  

COMMAND 														RESETLOGS
----------------------------------------------------------------------------------------------------------------------- ---------
EXEC DBMS_RCVCAT.UNREGISTERDATABASE(422970,3043094951); 								09-MAY-08

Ejecuto el paquete:

SQL> EXEC DBMS_RCVCAT.UNREGISTERDATABASE(422970,3043094951);

PL/SQL procedure successfully completed.

SQL> commit;

Commit complete.

Al finalizar de manera exitosa el deregistro, proceso a registrarlo nuevamente dejando solucionado mi problema.

[oracle@dat1010lx bin]$ rman target / catalog=rman@catrman

Recovery Manager: Release 10.2.0.4.0 - Production on Thu Nov 4 17:14:51 2010
Copyright (c) 1982, 2007, Oracle.  All rights reserved.
connected to target database: POTDESA (DBID=3043094951)

recovery catalog database Password:

connected to recovery catalog database
RMAN> register database;
database registered in recovery catalog

starting full resync of recovery catalog

full resync complete

RMAN> 

2 thoughts on “ORA-02291: integrity constraint (RMAN.RLH_F1) violated

Comments are closed.