Oracle

Patching Process of Pluggable Databases (Part 2)

June 9, 2019

(A RAC DB server with 2 nodes – one CDB and multiple PDBs)

In this article you may find some instructions regarding the Patching Process of Oracle Pluggable Databases on a 2 nodes RAC DB Server with one Container Database (CDB) and multiple Pluggable Databases.

The steps that you need to follow in order to apply the latest PSU are the following:

  1. Source the environment of the CDB on the 1st node.
       $ . oraenv

  2. Upgrade OPatch utility to the latest version.

  3. Download and unzip the latest COMBO PSU.

  4. Check for possible conflicts between the downloaded PSU and the already applied patches
       $ ./opatch prereq CheckConflictAgainstOHWithDetail -ph ./

  5. In order to find the PDBs that are connected to this CDB along with their status, we execute the following command:
    SQL> column name format a15  
    COLUMN "RESTRICTED" FORMAT A10  
    select d.con_id, v.name, v.open_mode, nvl(v.restricted, 'n/a') "RESTRICTED", d.status   from v$PDBs v inner join dba_pdbs d using (GUID) order by v.create_scn;

  6. Close all the PDBs that are related to this CDB with the following command:
       SQL> alter pluggable database all close immediate;

  7. Shutdown the CDB instance on the 1st node
       $ srvctl stop instance -d database_name -i instance_name

  8. Go to OPatch path
       $ cd $ORACLE_HOME/OPatch

  9. Apply the combo DB + OJVM Patch (with the usual way)
       $ ./opatch napply <PATCH_LOCATION>/<PATCH_NUMBER>

  10. Start the CDB instance on the 1st node
       $ srvctl start instance -d database_name -i instance_name

  11. Open all the PDBs
       SQL> alter pluggable database all open;

  12. Perform steps 1-11 on the 2nd node as well

  13. Staying at OPatch path, we execute the following command:
       $ ./datapatch -verbose

  14. If everything has succeeded (e.g. Patch 28729169 apply (pdb TESTPDB): SUCCESS) we proceed with the restart of CDB instances (on both nodes – sequentially and not at the same time) and we open the PDBs
       $ srvctl stop instance -d database_name -i instance_name
    $ srvctl start instance -d database_name -i instance_name
       SQL> alter pluggable database all open;

  15. Verify that the patches have been applied to the CDB
       $ ./opatch lspatches

  16. Verify that the patches have been applied to the PDBs on both nodes by executing the following commands:
       $ sqlplus / as sysdba
    SQL> alter session set container=<PDB_NAME>;  
    SQL>
    col action_time for a28  

    col action for a8  
    col version for a8  
    col status for a8  
    col comments for a30  
    set line 999 pages 999  
    select con_id, patch_id, version, status, Action, Action_time from cdb_registry_sqlpatch order by action_time;  
    select patch_id, patch_uid, version, status, description from cdb_registry_sqlpatch;  
    select patch_id, version, status, Action, Action_time from cdb_registry_sqlpatch order by action_time;

Leave a Reply

Your email address will not be published. Required fields are marked *