关于12c升级11g catalog bug的处理

来源:互联网 发布:centos 7 mirror 编辑:程序博客网 时间:2024/05/17 13:10

我们再用12c的sqlplus 去连接11g的catalog的时候,会报如下的错误

Recovery Manager: Release 12.1.0.2.0 - Production on Thu Oct 22 05:50:38 2015Copyright (c) 1982, 2014, Oracle and/or its affiliates.  All rights reserved.connected to target database: ENMO (DBID=735078679)connected to recovery catalog databasePL/SQL package RC_ADMIN.DBMS_RCVCAT version 11.02.00.04 in RCVCAT database is too old

这样的错误,在正常的情况下,upgrade catalog升级catalog就可以了。

但是我们在升级的时候

RMAN> upgrade catalog;RMAN-00571: ===========================================================RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============RMAN-00571: ===========================================================RMAN-07539: insufficient privileges to create or upgrade the catalog schema

我们查了MOS文档 ID 1915561.1

APPLIES TO: 

Oracle Database - Enterprise Edition - Version 12.1.0.2 and later
Information in this document applies to any platform.

SYMPTOMS

The RMAN command 'upgrade catalog' fails with the following error, as shown here.

RMAN-07539: insufficient privileges to create or upgrade the catalog schema

CAUSE

 Missing privileges as investigated in

Unpublished Bug 17465689 - RMAN-6443: ERROR UPGRADING RECOVERY CATALOG

SOLUTION

 Grant additional privileges to the RECOVERY_CATALOG_OWNER and RECOVERY_CATALOG_USER role using 'dbmsrmansys.sql'

 

Using 12.1.0.2 ORACLE_HOME and connect to the Catalog database

% sqlplus sys/<passwd@catalog_db> as sysdba
SQL> spool '/tmp/rmanCatUpg.txt'
          @ ?/rdbms/admin/dbmsrmansys.sql
          exit

and than retry the UPGRADE CATALOG

% rman catalog <un/pw@catalog_db>
RMAN> upgrade catalog;   # twice to confirm

是这么来描述这个BUG的,对于这个BUG,我们需要

拷贝

dbmsrmansys.sql 

sqlsessstart.sql 

sqlsessend.sql 

这三个脚本到11G的数据库上面去执行

[06:14:30 oracle(db)@kiwi admin]$ sqlplus sys/oracle@testdb as sysdbaSQL*Plus: Release 12.1.0.2.0 Production on Thu Oct 22 06:14:53 2015Copyright (c) 1982, 2014, Oracle.  All rights reserved.Connected to:Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit ProductionWith the Partitioning, OLAP, Data Mining and Real Application Testing options06:14:53 sys@testdb> @?/rdbms/admin/dbmsrmansys.sql06:15:06 sys@testdb> Rem06:15:06 sys@testdb> Rem Copyright (c) 2013, 2014, Oracle and/or its affiliates.06:15:06 sys@testdb> Rem All rights reserved.06:15:06 sys@testdb> Rem06:15:06 sys@testdb> Rem BEGIN SQL_FILE_METADATA06:15:06 sys@testdb> Rem SQL_SOURCE_FILE: rdbms/admin/dbmsrmansys.sql06:15:06 sys@testdb> Rem SQL_SHIPPED_FILE: rdbms/admin/dbmsrmansys.sql06:15:06 sys@testdb> Rem SQL_PHASE: DBMSRMANSYS06:15:06 sys@testdb> Rem SQL_STARTUP_MODE: NORMAL06:15:06 sys@testdb> Rem SQL_IGNORABLE_ERRORS: NONE06:15:06 sys@testdb> Rem SQL_CALLING_FILE: NONE06:15:06 sys@testdb> Rem END SQL_FILE_METADATA06:15:06 sys@testdb> Rem06:15:06 sys@testdb> Rem    MODIFIED   (MM/DD/YY)06:15:06 sys@testdb> Rem    surman      02/11/14 - 13922626: Update SQL metadata06:15:06 sys@testdb> Rem    vbegun      10/29/13 - Created06:15:06 sys@testdb> Rem06:15:06 sys@testdb> 06:15:06 sys@testdb> @@?/rdbms/admin/sqlsessstart.sql06:15:06 sys@testdb> Rem06:15:06 sys@testdb> Rem $Header: rdbms/admin/sqlsessstart.sql /main/1 2013/03/13 13:08:33 surman Exp $06:15:06 sys@testdb> Rem06:15:06 sys@testdb> Rem sqlsessstart.sql06:15:06 sys@testdb> Rem06:15:06 sys@testdb> Rem Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.06:15:06 sys@testdb> Rem06:15:06 sys@testdb> Rem    NAME06:15:06 sys@testdb> Rem         sqlsessstart.sql - SQL session start06:15:06 sys@testdb> Rem06:15:06 sys@testdb> Rem    DESCRIPTION06:15:06 sys@testdb> Rem         Any commands which should be run at the start of all oracle06:15:06 sys@testdb> Rem         supplied scripts.06:15:06 sys@testdb> Rem06:15:06 sys@testdb> Rem    NOTES06:15:06 sys@testdb> Rem         See sqlsessend.sql for the corresponding end script.06:15:06 sys@testdb> Rem06:15:06 sys@testdb> Rem    MODIFIED   (MM/DD/YY)06:15:06 sys@testdb> Rem    surman      03/08/13 - 16462837: Common start and end scripts06:15:06 sys@testdb> Rem    surman      03/08/13 - Created06:15:06 sys@testdb> Rem06:15:06 sys@testdb> 06:15:06 sys@testdb> alter session set "_ORACLE_SCRIPT" = true;alter session set "_ORACLE_SCRIPT" = true                  *ERROR at line 1:ORA-02248: invalid option for ALTER SESSIONElapsed: 00:00:00.0106:15:06 sys@testdb> 06:15:06 sys@testdb> --  Do not drop this role recovery_catalog_owner.06:15:06 sys@testdb> --  Drop this role will revoke this role from all rman users.06:15:06 sys@testdb> --  If this role exists, ORA-1921 is expected.06:15:06 sys@testdb> declare06:15:06   2      role_exists exception;06:15:06   3      pragma exception_init(role_exists, -1921);06:15:06   4  begin06:15:06   5     execute immediate 'create role recovery_catalog_owner';06:15:06   6  exception06:15:06   7     when role_exists then06:15:06   8        null;06:15:06   9  end;06:15:06  10  /PL/SQL procedure successfully completed.Elapsed: 00:00:00.1606:15:06 sys@testdb> declare06:15:06   2      role_exists exception;06:15:06   3      pragma exception_init(role_exists, -1921);06:15:06   4  begin06:15:06   5     execute immediate 'create role recovery_catalog_user';06:15:06   6  exception06:15:06   7     when role_exists then06:15:06   8        null;06:15:06   9  end;06:15:06  10  /PL/SQL procedure successfully completed.Elapsed: 00:00:00.0606:15:06 sys@testdb> 06:15:06 sys@testdb> grant create session,alter session,create synonym,create view,06:15:06   2   create database link,create table,create cluster,create sequence,06:15:06   3   create trigger,create procedure, create type to recovery_catalog_owner;Grant succeeded.Elapsed: 00:00:00.0206:15:06 sys@testdb> 06:15:06 sys@testdb> -- Following are added for VPD support06:15:06 sys@testdb> grant execute on dbms_rls to recovery_catalog_owner;Grant succeeded.Elapsed: 00:00:00.0206:15:06 sys@testdb> grant create any trigger to recovery_catalog_owner;Grant succeeded.Elapsed: 00:00:00.0606:15:06 sys@testdb> grant create any synonym to recovery_catalog_owner;Grant succeeded.Elapsed: 00:00:00.0106:15:06 sys@testdb> grant create public synonym to recovery_catalog_owner;Grant succeeded.Elapsed: 00:00:00.0106:15:06 sys@testdb> grant drop any synonym to recovery_catalog_owner;Grant succeeded.Elapsed: 00:00:00.0106:15:06 sys@testdb> grant administer database trigger to recovery_catalog_owner;Grant succeeded.Elapsed: 00:00:00.0206:15:06 sys@testdb> grant recovery_catalog_user to recovery_catalog_owner with admin option;Grant succeeded.Elapsed: 00:00:00.0306:15:06 sys@testdb> 06:15:06 sys@testdb> @?/rdbms/admin/sqlsessend.sql06:15:06 sys@testdb> Rem06:15:06 sys@testdb> Rem $Header: rdbms/admin/sqlsessend.sql /main/1 2013/03/13 13:08:33 surman Exp $06:15:06 sys@testdb> Rem06:15:06 sys@testdb> Rem sqlsessend.sql06:15:06 sys@testdb> Rem06:15:06 sys@testdb> Rem Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.06:15:06 sys@testdb> Rem06:15:06 sys@testdb> Rem    NAME06:15:06 sys@testdb> Rem         sqlsessend.sql - SQL session end06:15:06 sys@testdb> Rem06:15:06 sys@testdb> Rem    DESCRIPTION06:15:06 sys@testdb> Rem         Any commands which should be run at the end of all oracle06:15:06 sys@testdb> Rem         supplied scripts.06:15:06 sys@testdb> Rem06:15:06 sys@testdb> Rem    NOTES06:15:06 sys@testdb> Rem         See sqlsessstart.sql for the corresponding start script.06:15:06 sys@testdb> Rem06:15:06 sys@testdb> Rem    MODIFIED   (MM/DD/YY)06:15:06 sys@testdb> Rem    surman      03/08/13 - 16462837: Common start and end scripts06:15:06 sys@testdb> Rem    surman      03/08/13 - Created06:15:06 sys@testdb> Rem06:15:06 sys@testdb> 06:15:06 sys@testdb> alter session set "_ORACLE_SCRIPT" = false;alter session set "_ORACLE_SCRIPT" = false                  *ERROR at line 1:ORA-02248: invalid option for ALTER SESSION

忽略掉报错,然后在执行upgrade catalog就可以了

RMAN> upgrade catalog;recovery catalog owner is RC_ADMINenter UPGRADE CATALOG command again to confirm catalog upgradeRMAN> upgrade catalog;recovery catalog upgraded to version 12.01.00.02DBMS_RCVMAN package upgraded to version 12.01.00.02DBMS_RCVCAT package upgraded to version 12.01.00.02.


0 0
原创粉丝点击