Applying PSU in GRID 12c and DB 12c – Pluggable Database

All Information about PSU:
Patch Set Updates for Oracle Products (Doc ID 854428.1)

On this article the patches below will be applied:

Patch 21948354 - Database Patch Set Update 12.1.0.2.160119 (Includes CPUJan2016)
Patch 22191349: GRID INFRASTRUCTURE PATCH SET UPDATE 12.1.0.2.160119 (JAN2016)
OS: Linux 64

The current configuration:
GI Home in conjunction with RAC, RACOne, or Single Instance home             
     
cat /etc/oratab

db01:/oracle/product/12.1.0.2/db_1:N
CDB:/oracle/product/12.1.0.2/db_1:N
db11:/oracle/product/11.2/db_1:N                # line added by Agent
+ASM:/oracle/grid:N             # line added by Agent

GRID HOME: /oracle/grid
DATABASE HOME: /oracle/product/12.1.0.2/db_1

--> Versions:

-- GRID

[oracle@lnx01 OPatch]$ ./opatch lsinventory
Oracle Interim Patch Installer version 12.1.0.1.3
Copyright (c) 2016, Oracle Corporation.  All rights reserved.

Oracle Home       : /oracle/grid
Central Inventory : /oraInventory
   from           : /oracle/grid/oraInst.loc
OPatch version    : 12.1.0.1.3
OUI version       : 12.1.0.2.0
Log file location : /oracle/grid/cfgtoollogs/opatch/opatch2016-04-11_05-12-21AM_1.log

Lsinventory Output file location : /oracle/grid/cfgtoollogs/opatch/lsinv/lsinventory2016-04-11_05-12-21AM.txt

--------------------------------------------------------------------------------
Installed Top-level Products (1):

Oracle Grid Infrastructure 12c                                       12.1.0.2.0
There are 1 products installed in this Oracle Home.

There are no Interim patches installed in this Oracle Home.

--------------------------------------------------------------------------------
OPatch succeeded.

-- DB:

[oracle@lnx01 OPatch]$ ./opatch lsinventory
Oracle Interim Patch Installer version 12.1.0.1.3
Copyright (c) 2016, Oracle Corporation.  All rights reserved.

Oracle Home       : /oracle/product/12.1.0.2/db_1
Central Inventory : /oraInventory
   from           : /oracle/product/12.1.0.2/db_1/oraInst.loc
OPatch version    : 12.1.0.1.3
OUI version       : 12.1.0.2.0
Log file location : /oracle/product/12.1.0.2/db_1/cfgtoollogs/opatch/opatch2016-04-11_05-13-06AM_1.log

Lsinventory Output file location : /oracle/product/12.1.0.2/db_1/cfgtoollogs/opatch/lsinv/lsinventory2016-04-11_05-13-06AM.txt

--------------------------------------------------------------------------------
Installed Top-level Products (1):

Oracle Database 12c                                                  12.1.0.2.0
There are 1 products installed in this Oracle Home.

There are no Interim patches installed in this Oracle Home.
OPatch succeeded.
------------------[Start Here]-----------------------------------------------
1.) Checking OPATCH version:
-- You must use the OPatch utility version 12.1.0.1.7 or later to apply this patch

[oracle@lnx01 OPatch]$ pwd
/oracle/grid/OPatch
[oracle@lnx01 OPatch]$ ./opatch version
OPatch Version: 12.1.0.1.3

OPatch succeeded.

-- > On this case needs to be updated
-- > How To Download And Install The Latest OPatch(6880880) Version 
     (Doc ID 274526.1)

--> Choose the options for download, our release must be 12.1.0.1.0 and 
--> OS: Linux x86-64.

    - copy p6880880_121010_Linux-x86-64.zip to $GRID_HOME
    - mv OPatch OPatch_old
        Note: sometimes you can face some problems with WRITE rights, 
        on this case i used: chmod g+w grid
    - unzip p6880880_121010_Linux-x86-64.zip
    - Execute the same steps for the ORACLE DATABASE HOMES
    
GRID:    
[oracle@lnx01 OPatch]$ pwd
/oracle/grid/OPatch
[oracle@lnx01 OPatch]$ ./opatch version
OPatch Version: 12.1.0.1.10

OPatch succeeded.
[oracle@lnx01 OPatch]$

DB:
[oracle@lnx01 OPatch]$ ./opatch version
OPatch Version: 12.1.0.1.10

OPatch succeeded.
[oracle@lnx01 OPatch]$ pwd
/oracle/product/12.1.0.2/db_1/OPatch


2.) OCM rsp file:
How to Create an OCM Response file to Apply a Patch in Silent Mode - 
opatch silent (Doc ID 966023.1)

    - set GRID env variables
    /oracle/grid/OPatch
    
    [oracle@lnx01 bin]$ ls -ltr
    total 12
    -rwxr-x--- 1 oracle oinstall 9063 Nov 27  2009 emocmrsp
    [oracle@lnx01 bin]$ pwd
    /oracle/grid/OPatch/ocm/bin
    [oracle@lnx01 bin]$

    - Executing:
    
    [oracle@lnx01 bin]$ ./emocmrsp -no_banner -output /oracle/grid/OPatch/ocm.rsp
    Provide your email address to be informed of security issues, install and
    initiate Oracle Configuration Manager. Easier for you if you use your My
    Oracle Support Email address/User Name.
    Visit http://www.oracle.com/support/policies.html for details.
    Email address/User Name:

    You have not provided an email address for notification of security issues.
    Do you wish to remain uninformed of security issues ([Y]es, [N]o) [N]:  Y
    The OCM configuration response file (/oracle/grid/OPatch/ocm.rsp) was successfully created.

    [oracle@lnx01 OPatch]$ ls -pltr ocm.rsp
    -rw-r--r-- 1 oracle oinstall 623 Apr 11 05:30 ocm.rsp
    [oracle@lnx01 OPatch]$ pwd
    /oracle/grid/OPatch

3.) On this step your inventory MUST BE OK (GRID and DB).
You can check using:

$ <ORACLE_HOME>/OPatch/opatch lsinventory -detail -oh <ORACLE_HOME>

4.) Unzip PATCH as GRID owner user:

[oracle@lnx01 PSU]$ pwd
/data02/PSU
[oracle@lnx01 PSU]$ id
uid=54321(oracle) gid=54321(oinstall) groups=54321(oinstall),54322(dba)

[oracle@lnx01 PSU]$ ls -ltr  p22191349_121020_Linux-x86-64.zip
-rw-r--r-- 1 oracle oinstall 1187883569 Apr 11 04:56 p22191349_121020_Linux-x86-64.zip

    - unzip p22191349_121020_Linux-x86-64.zip

    [oracle@lnx01 PSU]$ pwd
/data02/PSU
[oracle@lnx01 PSU]$ ls -ltr
total 1208736
drwxr-xr-x 7 oracle oinstall       4096 Jan 13 13:34 22191349
-rw-rw-r-- 1 oracle oinstall     107602 Jan 19 10:27 PatchSearch.xml
-rw-r--r-- 1 oracle oinstall 1187883569 Apr 11 04:56 p22191349_121020_Linux-x86-64.zip

5.) Applying on GRID:

    - Required amount of space(8180.049MB) on GRID_HOME
    - Stop all databases under ORACLE_DATABASE_HOME that will be applied the PSU
    - Login as ROOT
    - export ORACLE_HOME=/oracle/grid (GRID_HOME)
    - cd /oracle/grid/OPatch
    - ./opatchauto apply /data02/PSU/22191349 -ocmrf ocm.rsp
    
OPatch Automation Tool
Copyright (c)2014, Oracle Corporation. All rights reserved.

OPatchauto Version : 12.1.0.1.10
OUI Version        : 12.1.0.2.0
Running from       : /oracle/grid

opatchauto log file: /oracle/grid/cfgtoollogs/opatchauto/22191349/opatch_gi_2016-04-11_08-15-06_deploy.log

Parameter Validation: Successful

Configuration Validation: Successful

Patch Location: /data02/PSU/22191349
Grid Infrastructure Patch(es): 21436941 21948341 21948344 21948354
DB Patch(es): 21948344 21948354

Patch Validation: Successful
Grid Infrastructure home:
/oracle/grid

Performing prepatch operations on SIHA Home... Successful

Applying patch(es) to "/oracle/grid" ...
Patch "/data02/PSU/22191349/21436941" successfully applied to "/oracle/grid".
Patch "/data02/PSU/22191349/21948341" successfully applied to "/oracle/grid".
Patch "/data02/PSU/22191349/21948344" successfully applied to "/oracle/grid".
Patch "/data02/PSU/22191349/21948354" successfully applied to "/oracle/grid".

Performing postpatch operations on SIHA Home... Successful

Apply Summary:
Following patch(es) are successfully installed:
GI Home: /oracle/grid: 21436941,21948341,21948344,21948354

opatchauto succeeded.


6.) Patch 21948354 - Database Patch Set Update 12.1.0.2.160119 (Includes CPUJan2016)

    - Copy p21948354_121020_Linux-x86-64.zip $ORACLE_HOME/OPatch
    - unzip p21948354_121020_Linux-x86-64.zip
    - cd /oracle/product/12.1.0.2/db_1/OPatch/21948354
    - check if all databases / listener that belongs to this HOME are down
    - ../opatch apply

    Oracle Interim Patch Installer version 12.1.0.1.10
Copyright (c) 2016, Oracle Corporation.  All rights reserved.


Oracle Home       : /oracle/product/12.1.0.2/db_1
Central Inventory : /oraInventory
   from           : /oracle/product/12.1.0.2/db_1/oraInst.loc
OPatch version    : 12.1.0.1.10
OUI version       : 12.1.0.2.0
Log file location : /oracle/product/12.1.0.2/db_1/cfgtoollogs/opatch/opatch2016-04-11_08-33-37AM_1.log

Verifying environment and performing prerequisite checks...
OPatch continues with these patches:   19769480  20299023  20831110  21359755  21948354

Do you want to proceed? [y|n]
y
User Responded with: Y
All checks passed.
Provide your email address to be informed of security issues, install and
initiate Oracle Configuration Manager. Easier for you if you use your My
Oracle Support Email address/User Name.
Visit http://www.oracle.com/support/policies.html for details.
Email address/User Name:

You have not provided an email address for notification of security issues.
Do you wish to remain uninformed of security issues ([Y]es, [N]o) [N]:  Y



Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
(Oracle Home = '/oracle/product/12.1.0.2/db_1')


Is the local system ready for patching? [y|n]
y
User Responded with: Y
Backing up files...
Applying sub-patch '19769480' to OH '/oracle/product/12.1.0.2/db_1'

Patching component oracle.rdbms.deconfig, 12.1.0.2.0...

Patching component oracle.xdk, 12.1.0.2.0...

Patching component oracle.tfa, 12.1.0.2.0...

Patching component oracle.rdbms.util, 12.1.0.2.0...

Patching component oracle.rdbms, 12.1.0.2.0...

Patching component oracle.rdbms.dbscripts, 12.1.0.2.0...

Patching component oracle.xdk.parser.java, 12.1.0.2.0...

Patching component oracle.oraolap, 12.1.0.2.0...

Patching component oracle.xdk.rsf, 12.1.0.2.0...

Patching component oracle.rdbms.rsf, 12.1.0.2.0...

Patching component oracle.rdbms.rman, 12.1.0.2.0...

Patching component oracle.ldap.rsf, 12.1.0.2.0...

Patching component oracle.ldap.rsf.ic, 12.1.0.2.0...
Applying sub-patch '20299023' to OH '/oracle/product/12.1.0.2/db_1'
ApplySession: Optional component(s) [ oracle.has.crs, 12.1.0.2.0 ]  not present in the Oracle Home or a higher version is found.

Patching component oracle.tfa, 12.1.0.2.0...

Patching component oracle.rdbms.deconfig, 12.1.0.2.0...

Patching component oracle.rdbms.rsf, 12.1.0.2.0...

Patching component oracle.rdbms, 12.1.0.2.0...

Patching component oracle.rdbms.dbscripts, 12.1.0.2.0...

Patching component oracle.rdbms.rsf.ic, 12.1.0.2.0...

Patching component oracle.ldap.rsf, 12.1.0.2.0...

Patching component oracle.ldap.rsf.ic, 12.1.0.2.0...
Applying sub-patch '20831110' to OH '/oracle/product/12.1.0.2/db_1'

Patching component oracle.rdbms, 12.1.0.2.0...

Patching component oracle.oraolap.dbscripts, 12.1.0.2.0...

Patching component oracle.ldap.rsf, 12.1.0.2.0...

Patching component oracle.tfa, 12.1.0.2.0...

Patching component oracle.rdbms.dbscripts, 12.1.0.2.0...

Patching component oracle.rdbms.rsf, 12.1.0.2.0...
Applying sub-patch '21359755' to OH '/oracle/product/12.1.0.2/db_1'

Patching component oracle.assistants.server, 12.1.0.2.0...

Patching component oracle.rdbms.rsf, 12.1.0.2.0...

Patching component oracle.rdbms, 12.1.0.2.0...

Patching component oracle.rdbms.dbscripts, 12.1.0.2.0...

Patching component oracle.tfa, 12.1.0.2.0...
Applying sub-patch '21948354' to OH '/oracle/product/12.1.0.2/db_1'

Patching component oracle.rdbms.deconfig, 12.1.0.2.0...

Patching component oracle.xdk, 12.1.0.2.0...

Patching component oracle.tfa, 12.1.0.2.0...

Patching component oracle.rdbms, 12.1.0.2.0...

Patching component oracle.rdbms.dbscripts, 12.1.0.2.0...

Patching component oracle.xdk.parser.java, 12.1.0.2.0...

Patching component oracle.rdbms.rsf, 12.1.0.2.0...

Patching component oracle.xdk.rsf, 12.1.0.2.0...
Composite patch 21948354 successfully applied.
Log file location: /oracle/product/12.1.0.2/db_1/cfgtoollogs/opatch/opatch2016-04-11_08-33-37AM_1.log

OPatch succeeded.


7.) Loading Modified SQL Files into the Database

    - Login into Container Database:
    
    sqlplus / as sysdba
    startup
    alter pluggable database all open;
    cd /oracle/product/12.1.0.2/db_1/OPatch
    
    [oracle@lnx01 OPatch]$ ./datapatch -verbose
    SQL Patching tool version 12.1.0.2.0 on Mon Apr 11 08:40:25 2016
    Copyright (c) 2015, Oracle.  All rights reserved.

    Log file for this invocation: /oracle/cfgtoollogs/sqlpatch/sqlpatch_12309_2016_04_11_08_40_25/sqlpatch_invocation.log

    Connecting to database...OK
    Note:  Datapatch will only apply or rollback SQL fixes for PDBs
           that are in an open state, no patches will be applied to closed PDBs.
           Please refer to Note: Datapatch: Database 12c Post Patch SQL Automation
           (Doc ID 1585822.1)
    Bootstrapping registry and package to current versions...done
    Determining current state...done

    Current state of SQL patches:
    Bundle series PSU:
      ID 160119 in the binary registry and not installed in any PDB

    Adding patches to installation queue and performing prereq checks...
    Installation queue:
      For the following PDBs: CDB$ROOT PDB$SEED PDB1 PDB3
        Nothing to roll back
        The following patches will be applied:
          21948354 (Database Patch Set Update : 12.1.0.2.160119 (21948354))

    Installing patches...
    Patch installation complete.  Total patches installed: 4

    Validating logfiles...
    Patch 21948354 apply (pdb CDB$ROOT): SUCCESS
      logfile: /oracle/cfgtoollogs/sqlpatch/21948354/19553095/21948354_apply_CDB_CDBROOT_2016Apr11_08_40_57.log (no errors)
    Patch 21948354 apply (pdb PDB$SEED): SUCCESS
      logfile: /oracle/cfgtoollogs/sqlpatch/21948354/19553095/21948354_apply_CDB_PDBSEED_2016Apr11_08_41_03.log (no errors)
    Patch 21948354 apply (pdb PDB1): SUCCESS
      logfile: /oracle/cfgtoollogs/sqlpatch/21948354/19553095/21948354_apply_CDB_PDB1_2016Apr11_08_41_03.log (no errors)
    Patch 21948354 apply (pdb PDB3): SUCCESS
      logfile: /oracle/cfgtoollogs/sqlpatch/21948354/19553095/21948354_apply_CDB_PDB3_2016Apr11_08_41_03.log (no errors)
    SQL Patching tool complete on Mon Apr 11 08:41:11 2016
    
    - To check inside database:
    Datapatch: Database 12c Post Patch SQL Automation (Doc ID 1585822.1)
    
    08:46:21 SQL> select status, description, patch_id, action from registry$sqlpatch;

    STATUS          DESCRIPTION                                                PATCH_ID ACTION
    --------------- ------------------------------------------------------------------- ---------------
    SUCCESS         Database Patch Set Update : 12.1.0.2.160119 (21948354)     21948354 APPLY
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s