RMAN Recovery Catalog Issues after 12.2 Upgrade

Well, after the upgrade of the DB to 12.2 the next step is to upgrade the RMAN Recovery Catalog to the same version in order to be able to run backups using it. The process is pretty straight forward.
.    Connect to RMAN using target and catalog
.    Execute upgrade catalog
RMAN> upgrade catalog;
This finishes correctly. But then we try to resync the catalog we got below error:
RMAN> resync catalog;
starting full resync of recovery catalog
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of resync command on default channel at 06/07/2018 22:15:36
ORA-01403: no data found
This is due to a bug 27013146. The solution is to apply this patch to the newly upgraded Oracle Home and re-run the upgrade catalog again.
More information can be found in MOS Note 2341947.1.
Everything is cool now, right? Well, now the old database backups are failing with below error:
RMAN-03008: error while performing automatic resync of recovery catalog
For that, the solution is outlined in MOS Doc Id 2291791.1.
Happy 12.2 upgrades!

Upgrade OPatch for OEM 13c R2 Agents

Opatch utility has to be updated often as Oracle delivers regular updates to it. I was used to version 12 and it only required an overwrite of the OPatch directory. Well, not anymore with version 13c R2.
I will walk you through an OPatch upgrade from 13.8 to 13.9 version.
First export your agent ORACLE_HOME:
$: export ORACLE_HOME=/u01/oracle/oemagent/agent_13.
Verify the current OPatch version:
$: $ORACLE_HOME/OPatch/opatch version
OPatch Version:
OPatch succeeded.
Download and unzip the 13.9 version in a temporary directory:
$: unzip p6880880_139000_Generic.zip
Archive:  p6880880_139000_Generic.zip
   creating: 6880880/
  inflating: 6880880/README.txt
  inflating: 6880880/opatch_generic.jar
  inflating: 6880880/version.txt
As you can see, now we have some zip files and a java file. Execute java to upgrade OPatch as follows:
$: $ORACLE_HOME/jdk/bin/java -jar opatch_generic.jar -silent oracle_home=$ORACLE_HOME
Launcher log file is /tmp/OraInstall2017-01-19_08-47-21PM/launcher2017-01-19_08-47-21PM.log.
Extracting the installer . . . . Done
Checking if CPU speed is above 300 MHz.   Actual 3000.000 MHz    Passed
Checking swap space: must be greater than 512 MB.   Actual 16383 MB    Passed
Checking if this platform requires a 64-bit JVM.   Actual 64    Passed (64-bit not required)
Checking temp space: must be greater than 300 MB.   Actual 18842 MB    Passed
Preparing to launch the Oracle Universal Installer from /tmp/OraInstall2017-01-19_08-47-21PM
Installation Summary
Disk Space : Required 6 MB, Available 5,229 MB
Feature Sets to Install:
        Next Generation Install Core
        OPatch Auto OPlan
Session log file is /tmp/OraInstall2017-01-19_08-47-21PM/install2017-01-19_08-47-21PM.log
Loading products list. Please wait.
Loading products. Please wait.
Updating Libraries
Starting Installations
Install pending
Installation in progress
 Component : oracle.swd.opatch
Copying files for ‘oracle.swd.opatch ‘
 Component : oracle.glcm.osys.core
Copying files for ‘oracle.glcm.osys.core ‘
 Component : oracle.glcm.oplan.core
Copying files for ‘oracle.glcm.oplan.core ‘
 Component : oracle.glcm.opatch.common.api
Copying files for ‘oracle.glcm.opatch.common.api ‘
 Component : oracle.glcm.opatchauto.core
Copying files for ‘oracle.glcm.opatchauto.core ‘
Install successful
Post feature install pending
Post Feature installing
 Feature Set : apache_commons_cli_lib
 Feature Set : oracle.glcm.opatchauto.core.actions.classpath
Post Feature installing ‘apache_commons_cli_lib’
 Feature Set : oracle.glcm.opatchauto.core.binary.classpath
 Feature Set : oracle.glcm.osys.core.classpath
Post Feature installing ‘oracle.glcm.opatchauto.core.binary.classpath’
Post Feature installing ‘oracle.glcm.osys.core.classpath’
 Feature Set : apache_commons_compress_lib
 Feature Set : oracle.glcm.opatchauto.core.wallet.classpath
Post Feature installing ‘oracle.glcm.opatchauto.core.actions.classpath’
Post Feature installing ‘apache_commons_compress_lib’
 Feature Set : oracle.glcm.opatchauto.core.classpath
Post Feature installing ‘oracle.glcm.opatchauto.core.wallet.classpath’
Post Feature installing ‘oracle.glcm.opatchauto.core.classpath’
 Feature Set : oracle.glcm.opatch.common.api.classpath
 Feature Set : oracle.glcm.oplan.core.classpath
Post Feature installing ‘oracle.glcm.opatch.common.api.classpath’
Post Feature installing ‘oracle.glcm.oplan.core.classpath’
Post feature install complete
String substitutions pending
String substituting
 Component : oracle.swd.opatch
String substituting ‘oracle.swd.opatch ‘
 Component : oracle.glcm.osys.core
String substituting ‘oracle.glcm.osys.core ‘
 Component : oracle.glcm.oplan.core
String substituting ‘oracle.glcm.oplan.core ‘
 Component : oracle.glcm.opatch.common.api
String substituting ‘oracle.glcm.opatch.common.api ‘
 Component : oracle.glcm.opatchauto.core
String substituting ‘oracle.glcm.opatchauto.core ‘
String substitutions complete
Link pending
Linking in progress
 Component : oracle.swd.opatch
Linking ‘oracle.swd.opatch ‘
 Component : oracle.glcm.osys.core
Linking ‘oracle.glcm.osys.core ‘
 Component : oracle.glcm.oplan.core
Linking ‘oracle.glcm.oplan.core ‘
 Component : oracle.glcm.opatch.common.api
Linking ‘oracle.glcm.opatch.common.api ‘
 Component : oracle.glcm.opatchauto.core
Linking ‘oracle.glcm.opatchauto.core ‘
Linking in progress
Link successful
Setup pending
Setup in progress
 Component : oracle.swd.opatch
Setting up ‘oracle.swd.opatch ‘
 Component : oracle.glcm.osys.core
Setting up ‘oracle.glcm.osys.core ‘
 Component : oracle.glcm.oplan.core
Setting up ‘oracle.glcm.oplan.core ‘
 Component : oracle.glcm.opatch.common.api
Setting up ‘oracle.glcm.opatch.common.api ‘
 Component : oracle.glcm.opatchauto.core
Setting up ‘oracle.glcm.opatchauto.core ‘
Setup successful
Save inventory pending
Saving inventory
Saving inventory complete
Configuration complete
Logs successfully copied to /u01/app/oraInventory/logs.
Verify the new OPatch version

$: $ORACLE_HOME/OPatch/opatch version
OPatch Version:
OPatch succeeded. 


How to upgrade the RMAN recovery catalog to 12c?

Some days back I faced an issue while trying to upgrade the RMAN recovery catalog to support 12c databases.

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

The problem is that for 12c the catalog owner requires additional privileges. The solution is to run the dbmsrmansys.sql script that comes with the 12c binaries.

You have to copy this file from your 12c home “$ORACLE_HOME/rdbms/admin” directory to where your RMAN recovery catalog database is and execute it.

SQL> @$ORACLE_HOME/rdbms/admin/dbmsrmansys.sql
The script is going to complain for the lack of 2 other scripts, but the upgrade runs just fine.
$ rman CATALOG rman@catalog
recovery catalog database Password:


Upgrade Oracle Enterprise Manager to

Enterprise Manager was just released and now is time to test and document the process. The official documentation can be obtained from here (http://docs.oracle.com/cd/E24628_01/upgrade.121/e22625/upgrading_12101_PS1_gtgstrtd.htm) and this document cover the steps I followed and may not work on yours (I’m not responsible of any issues/problems caused to your system).
This document covers Oracle Enterprise Manager upgrade from to version in a Single-OMS configuration using one system upgrade method and is divided in 3 sections describing prerequisites, upgrade and post upgrade tasks.


  • Download the software from (http://www.oracle.com/technetwork/oem/enterprise-manager/downloads/index.html) on your server and extract it to a stage directory.

mkdir /stage
unzip em12104_linux64_disk1.zip -d /stage
unzip em12104_linux64_disk2.zip -d /stage
unzip em12104_linux64_disk3.zip -d /stage

  • Ensure that you have a valid OMS (middleware home & inventory), Repository and Software Library backup.
  • If you have BI Publisher installed, then stop BIP server through WebLogic Admin Console.
  • Drop any snapshot created against Repository tables.

SQL> select master , log_table from all_mview_logs where log_owner=’SYSMAN’

no rows selected

  • Check and compile invalid objects in the Repository schema.

SQL> select ‘alter ‘||object_type||’ ‘||owner||’.’||object_name||’ compile;’ from all_objects
 2  where status=’INVALID’;

no rows selected

  • Execute privileges on DBMS_RANDOM are required during the upgrade, run the below commands to set them.

SQL> grant execute on DBMS_RANDOM to DBSNMP;
SQL> grant execute on DBMS_RANDOM to SYSMAN;
SQL> revoke execute on DBMS_RANDOM from PUBLIC;

  • Copy the emkey from OMS to the Management Repository.

$ emctl config emkey -copy_to_repos
Oracle Enterprise Manager Cloud Control 12c Release 3
Copyright (c) 1996, 2013 Oracle Corporation.  All rights reserved.
Enter Enterprise Manager Root (SYSMAN) Password :
The EMKey has been copied to the Management Repository. This operation will cause the EMKey to become unsecure.
After the required operation has been completed, secure the EMKey by running “emctl config emkey -remove_from_repos”.

  • Stop OMS, extended instances and both OMS and Repository agents.

$ emctl extended oms jvmd stop -all
Oracle Enterprise Manager Cloud Control 12c Release 3
Copyright (c) 1996, 2013 Oracle Corporation.  All rights reserved.
Please enter the SYSMAN password:
Stopping all Engines
No engines found for this operation
Emctl Extended verb failed. Please check /u01/app/oracle/gc_inst/em/EMGC_OMS1/sysman/log/emctl.log for more details

$ emctl extended oms adp stop -all
Oracle Enterprise Manager Cloud Control 12c Release 3
Copyright (c) 1996, 2013 Oracle Corporation.  All rights reserved.
Please enter the SYSMAN password:
Stopping all Engines
No engines found for this operation
Emctl Extended verb failed. Please check /u01/app/oracle/gc_inst/em/EMGC_OMS1/sysman/log/emctl.log for more details

$ emctl stop oms -all
Oracle Enterprise Manager Cloud Control 12c Release 3
Copyright (c) 1996, 2013 Oracle Corporation.  All rights reserved.
Stopping WebTier…
WebTier Successfully Stopped
Stopping Oracle Management Server…
Oracle Management Server Successfully Stopped
AdminServer Successfully Stopped
Oracle Management Server is Down

$ ./emctl stop agent
Oracle Enterprise Manager Cloud Control 12c Release 3
Copyright (c) 1996, 2013 Oracle Corporation.  All rights reserved.
Stopping agent ….. stopped.


  • Run the runInstaller executable from the folder where the software was extracted.

$ cd /stage
$ ./runInstaller

  • Type My Oracle Support account details.

  • Choose if you want to search for any software updates.

  • Review and fix any prerequisite failure.

  • Choose the upgrade method, in my case One system Upgrade then select the Oracle Home.

  • Type the “NEW” Middleware Home location.

  • Type the required Repository credentials.

  • Some prerequisites failed, click Yes to let the installer fix them automatically.

  • Review the list of plug-ins that are going to be automatically upgraded.

  • Select any additional plug-ins to be deployed after the upgrade.

  • Type the required WebLogic Domain credentials.

  • Review the all the information provided and click Install.

  • Review the progress.

  • Run the required allroot.sh script as root.

  • Review the final information about the upgrade process.

  • Login to Cloud Control and verify the version. Note that some targets are marked as down, we are going to fix them in the post upgrade tasks.

  • Upgrade Oracle Management Agents (at least OMS and Repository). Go to Setup -> Manage Cloud Control -> Upgrade Agents.

  • Type a Job Name (or use the default name) and click Add to select the agents you want to upgrade to
  • Select the agents from the list and click OK.

  • Choose credentials and click Submit. There’s the option to schedule the upgrade for later under Additional Inputs.

  • You must run the root.sh script after the upgrade, click OK.

  • Review the agent upgrade process.

  • Agent upgrade was successful.

Post Upgrade

Deleting the Old OMS Home is an optional task, however I have decided to perform it in order to save space and have a clean Inventory.

  • Invoke the installer from the old OMS home

$ export ORACLE_HOME=/u01/app/oracle/oms12cr3/oms
$ /oui/bin/runInstaller -deinstall

  • Select only the OMS-related plug-ins homes (from the Old Home only!!) and click Remove.

  • Select the Java Development Kit JDK home and click Remove.

  • Select the Oracle WebTier home and click Remove. After finishing the deinstall click Close.

  • Finally select the OMS home & the Oracle Common directories and click Remove.

All targets marked up.