PL/SQL package RMAN.DBMS_RCVCAT version 11.02.00.04 in RCVCAT database is too old



Hoje estarei abordando um erro relativamente comum, que ocorre quando tentamos registrar no catalogo rman uma base que está em uma versão superior a versão do catalogo.

Ao tentar registrar um novo ambiente criado na versão 12.1.0.2.0 em um catalogo rman existente na versão 11.02.00.04, é constatada a ocorrência do erro abaixo.


[oracle@lamim12c: cdbprd1 ~] $ rman target /

Recovery Manager: Release 12.1.0.2.0 - Production on Fri Jan 20 15:22:57 2017

Copyright (c) 1982, 2014, Oracle and/or its affiliates.  All rights reserved.

connected to target database: CDBPRD1 (DBID=1730989942)

RMAN> connect catalog rman/senha@catdb

connected to recovery catalog database
PL/SQL package RMAN.DBMS_RCVCAT version 11.02.00.04 in RCVCAT database is too old

RMAN> Register Database;

PL/SQL package RMAN.DBMS_RCVCAT version 11.02.00.04 in RCVCAT database is too old
PL/SQL package RMAN.DBMS_RCVCAT version 11.02.00.04 in RCVCAT database is too old
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of register command at 01/20/2017 15:23:52
RMAN-06429: RCVCAT database is not compatible with this version of RMAN
O primeiro passo seguido foi tentar realizar um upgrade do catalogo. Esta ação foi realizada conectando no catalogo rman, através do ambiente 12c.
RMAN> upgrade catalog;

recovery catalog owner is RMAN
enter UPGRADE CATALOG command again to confirm catalog upgrade

RMAN> upgrade catalog;

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-06004: ORACLE error from recovery catalog database: ORA-01917: user or role 'RECOVERY_CATALOG_USER' does not exist
Porém apos algum tempo em execução, o processo apresentou erro.
RMAN-06004: ORACLE error from recovery catalog database: ORA-01917: user or role 'RECOVERY_CATALOG_USER' does not exist
Este erro é um bug (Bug 17465689) e ocorre devido a necessidade de permissões adicionais para o catalog rman, porém o processo de upgrade do catalogo não concede de forma automática.
Para contornar esse problema, basta seguir as instruções da Doc ID 1915561.1, que recomenda a execução dos scripts dbmsrmansys.sql e dbmsrmanvpc.sql para virtual private catalog. A conexão ao catalogo rman para execução dos scripts, deve ser realizada a partir do Oracle 12c com o usuário SYS.
[oracle@lamim12c: cdbprd1 bin] $ sqlplus sys/senha@catdb as sysdba

SQL*Plus: Release 12.1.0.2.0 Production on Fri Jan 20 17:20:10 2017

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

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

catdb> @?/rdbms/admin/dbmsrmansys.sql
alter session set "_ORACLE_SCRIPT" = true
                  *
ERROR at line 1:
ORA-02248: invalid option for ALTER SESSION

PL/SQL procedure successfully completed.

PL/SQL procedure successfully completed.

Grant succeeded.

Grant succeeded.

Grant succeeded.

Grant succeeded.

Grant succeeded.

Grant succeeded.

Grant succeeded.

Grant succeeded.

alter session set "_ORACLE_SCRIPT" = false
                  *
ERROR at line 1:
ORA-02248: invalid option for ALTER SESSION

catdb> 
Apos executar este processo, podemos conectar novamente ao rman e realizar o processo de upgrade do catalogo e posteriormente registrar o mesmo.
[oracle@lamim12c: cdbprd1 ~] $ rman target /

Recovery Manager: Release 12.1.0.2.0 - Production on Fri Jan 20 16:04:54 2017

Copyright (c) 1982, 2014, Oracle and/or its affiliates.  All rights reserved.

connected to target database: CDBPRD1 (DBID=1730989942)

RMAN> connect catalog rman/senha@catdb

connected to recovery catalog database

RMAN> upgrade catalog;

recovery catalog owner is RMAN
enter UPGRADE CATALOG command again to confirm catalog upgrade

RMAN> upgrade catalog;

recovery catalog upgraded to version 12.01.00.02
DBMS_RCVMAN package upgraded to version 12.01.00.02
DBMS_RCVCAT package upgraded to version 12.01.00.02.

RMAN> register database;

database registered in recovery catalog
starting full resync of recovery catalog
full resync complete

RMAN>
Conectando no catalogo rman, podemos contatar que o processo de upgrade foi concluído com sucesso e agora estamos na versão 12.01.00.02
Catalogo_Rman=catdb-> sqlplus sys/maadm2014@catdb as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Fri Jan 20 17:21:01 2017

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


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> select * from rman.rcver;

VERSION
------------
12.01.00.02

SQL>
Espero ter ajudado!!!

Fontes:
http://docs.oracle.com/database/122/RCMRF/UPGRADE-CATALOG.htm#RCMRF161
Oracle Support Document 1915561.1 (Upgrade Recovery Catalog fails with RMAN-07539: insufficient privileges).

Comentários