The Musings of CrashSensei

Random thoughts caught by the InterWeb

Patching Oracle Database 12c Single Instance

By crashsensei | December 4, 2017 | 0 Comment

Stage the software

  1. Download the latest OPatch version
    1. Browse to Patch 6880880
    2. For the Platform select Linux x86-64
    3. Click the Download button
  2. Download the latest Oracle Database patches
    1. Login to My Oracle Support
    2. Click on Patches & Updates
    3. Click on Recommended Patch Advisor
    4. Enter Oracle Database for the Product.
      Enter 12.2.0.1.0 for the Release.
      Enter Linux x86-64 for the Platform and click the Search button.
    5. Highlight the Database Release Update (not the Revision) by clicking on the row, then click Download.
    6. Click on the file to download the update
    7. Follow the same steps to download OJVM Release Update.
  3. Upload all files to /opt/oracle/dump
  4. Unzip the files
    #Opatch
    mkdir /opt/oracle/dump/patch
    unzip /opt/oracle/dump/p6880880_122010_Linux-x86-64.zip -d /opt/oracle/dump/patch
    
    #Database Release Update
    mkdir /opt/oracle/dump/patch/ru
    #You will need to use the correct patch file
    unzip /opt/oracle/dump/p26710464_122010_Linux-x86-64.zip -d /opt/oracle/dump/patch/ru
    
    #OJVM Release Update
    mkdir /opt/oracle/dump/patch/ojvm
    unzip /opt/oracle/dump/p26635944_122010_Linux-x86-64.zip -d /opt/oracle/dump/patch/ojvm
    

Update OPatch

  1. Backup current Opatch version
    rm -rf ${ORACLE_HOME}/OPatch-backup > /dev/null
    mv ${ORACLE_HOME}/OPatch ${ORACLE_HOME}/OPatch-backup
    
  2. Install new version
    cp -r /opt/oracle/dump/patch/OPatch ${ORACLE_HOME}/OPatch

Apply OJVM and Database Release Updates

  1. Stop all database services
    lsnrctl stop
    
    #Stop each database
    chdb <DATABASE_SID>
    sqlplus / as syslog
    studown immediate
    quit
  2. Switch to the OPatch directory cd ${ORACLE_HOME}/OPatch
  3. Validate OPatch is working correctly ./opatch lsinventory
    Oracle Interim Patch Installer version 12.2.0.1.11
    Copyright (c) 2017, Oracle Corporation.  All rights reserved.
    
    
    Oracle Home       : /opt/oracle/app/oracle/product/12.2.0/dbhome_1
    Central Inventory : /opt/oracle/app/oraInventory
       from           : /opt/oracle/app/oracle/product/12.2.0/dbhome_1/oraInst.loc
    OPatch version    : 12.2.0.1.11
    OUI version       : 12.2.0.1.4
    Log file location : /opt/oracle/app/oracle/product/12.2.0/dbhome_1/cfgtoollogs/opatch/opatch2017-12-01_15-43-29PM_1.log
    
    Lsinventory Output file location : /opt/oracle/app/oracle/product/12.2.0/dbhome_1/cfgtoollogs/opatch/lsinv/lsinventory2017-12-01_15-43-29PM.txt
    
    --------------------------------------------------------------------------------
    Local Machine Information::
    Hostname: oraman13c.washco.org
    ARU platform id: 226
    ARU platform description:: Linux x86-64
    
    Installed Top-level Products (1):
    
    Oracle Database 12c                                                  12.2.0.1.0
    There are 1 products installed in this Oracle Home.
    
    
    There are no Interim patches installed in this Oracle Home.
    
    
    --------------------------------------------------------------------------------
    
    OPatch succeeded.
    
  4. Add OPatch to Path PATH=${ORACLE_HOME}/OPatch:${PATH}
  5. Apply Database Release Update
    1. Switch to DRU patch directory cd /opt/oracle/dump/patch/ru/26710464/
    2. Apply the patch opatch apply
      Oracle Interim Patch Installer version 12.2.0.1.11
      Copyright (c) 2017, Oracle Corporation.  All rights reserved.
      
      
      Oracle Home       : /opt/oracle/app/oracle/product/12.2.0/dbhome_1
      Central Inventory : /opt/oracle/app/oraInventory
         from           : /opt/oracle/app/oracle/product/12.2.0/dbhome_1/oraInst.loc
      OPatch version    : 12.2.0.1.11
      OUI version       : 12.2.0.1.4
      Log file location : /opt/oracle/app/oracle/product/12.2.0/dbhome_1/cfgtoollogs/opatch/opatch2017-12-01_15-58-03PM_1.log
      
      Verifying environment and performing prerequisite checks...
      OPatch continues with these patches:   26710464
      
      Do you want to proceed? [y|n]
      y
      User Responded with: Y
      All checks passed.
      
      Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
      (Oracle Home = '/opt/oracle/app/oracle/product/12.2.0/dbhome_1')
      
      
      Is the local system ready for patching? [y|n]
      y
      User Responded with: Y
      Backing up files...
      Applying interim patch '26710464' to OH '/opt/oracle/app/oracle/product/12.2.0/dbhome_1'
      ApplySession: Optional component(s) [ oracle.has.crs, 12.2.0.1.0 ] , [ oracle.ons.daemon, 12.2.0.1.0 ]  not present in the Oracle Home or a higher version is found.
      
      Patching component oracle.rdbms.deconfig, 12.2.0.1.0...
      
      Patching component oracle.tfa, 12.2.0.1.0...
      
      Patching component oracle.rdbms, 12.2.0.1.0...
      
      Patching component oracle.rdbms.util, 12.2.0.1.0...
      
      Patching component oracle.rdbms.dbscripts, 12.2.0.1.0...
      
      Patching component oracle.has.deconfig, 12.2.0.1.0...
      
      Patching component oracle.xdk.parser.java, 12.2.0.1.0...
      
      Patching component oracle.xdk.rsf, 12.2.0.1.0...
      
      Patching component oracle.ctx.rsf, 12.2.0.1.0...
      
      Patching component oracle.rdbms.rman, 12.2.0.1.0...
      
      Patching component oracle.rdbms.oci, 12.2.0.1.0...
      
      Patching component oracle.rdbms.crs, 12.2.0.1.0...
      
      Patching component oracle.oracore.rsf, 12.2.0.1.0...
      
      Patching component oracle.ctx, 12.2.0.1.0...
      
      Patching component oracle.xdk, 12.2.0.1.0...
      
      Patching component oracle.nlsrtl.rsf, 12.2.0.1.0...
      
      Patching component oracle.rdbms.rsf, 12.2.0.1.0...
      
      Patching component oracle.ons, 12.2.0.1.0...
      
      Patching component oracle.rdbms.lbac, 12.2.0.1.0...
      
      Patching component oracle.rdbms.rsf.ic, 12.2.0.1.0...
      
      Patching component oracle.sdo, 12.2.0.1.0...
      
      Patching component oracle.precomp.common, 12.2.0.1.0...
      
      Patching component oracle.precomp.lang, 12.2.0.1.0...
      Patch 26710464 successfully applied.
      Log file location: /opt/oracle/app/oracle/product/12.2.0/dbhome_1/cfgtoollogs/opatch/opatch2017-12-01_15-58-03PM_1.log
      
      OPatch succeeded.
  6. Apply the Oracle JaveVM patch
    1. Switch to OJVM patch directory cd /opt/oracle/dump/patch/ojvm/26635944/
    2. Apply the patch opatch apply
      Oracle Interim Patch Installer version 12.2.0.1.11
      Copyright (c) 2017, Oracle Corporation.  All rights reserved.
      
      
      Oracle Home       : /opt/oracle/app/oracle/product/12.2.0/dbhome_1
      Central Inventory : /opt/oracle/app/oraInventory
         from           : /opt/oracle/app/oracle/product/12.2.0/dbhome_1/oraInst.loc
      OPatch version    : 12.2.0.1.11
      OUI version       : 12.2.0.1.4
      Log file location : /opt/oracle/app/oracle/product/12.2.0/dbhome_1/cfgtoollogs/opatch/opatch2017-12-04_08-29-52AM_1.log
      
      Verifying environment and performing prerequisite checks...
      OPatch continues with these patches:   26635944
      
      Do you want to proceed? [y|n]
      y
      User Responded with: Y
      All checks passed.
      
      Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
      (Oracle Home = '/opt/oracle/app/oracle/product/12.2.0/dbhome_1')
      
      
      Is the local system ready for patching? [y|n]
      y
      User Responded with: Y
      Backing up files...
      Applying interim patch '26635944' to OH '/opt/oracle/app/oracle/product/12.2.0/dbhome_1'
      
      Patching component oracle.javavm.server, 12.2.0.1.0...
      
      Patching component oracle.javavm.server.core, 12.2.0.1.0...
      
      Patching component oracle.rdbms.dbscripts, 12.2.0.1.0...
      
      Patching component oracle.rdbms, 12.2.0.1.0...
      Patch 26635944 successfully applied.
      Log file location: /opt/oracle/app/oracle/product/12.2.0/dbhome_1/cfgtoollogs/opatch/opatch2017-12-04_08-29-52AM_1.log
      
      OPatch succeeded.
      
  7. Startup the listener
  8. Upgrade each database
    1. Switch to the database & launch SQL*Plus
      chdb <DATABASE SID>
      sqlplus /nolog
    2. Startup database in upgrade mode
      Connect / as sysdba
      startup upgrade
      quit
    3. Switch to Opatch dir and run patch
      cd $ORACLE_HOME/OPatch
      ./datapatch -verbose
      SQL Patching tool version 12.2.0.1.0 Production on Mon Dec  4 09:17:17 2017
      Copyright (c) 2012, 2017, Oracle.  All rights reserved.
      
      Log file for this invocation: /opt/oracle/app/oracle/cfgtoollogs/sqlpatch/sqlpatch_19589_2017_12_04_09_17_17/sqlpatch_invocation.log
      
      Connecting to database...OK
      Bootstrapping registry and package to current versions...done
      Determining current state...done
      
      Current state of SQL patches:
      Patch 26635944 (OJVM RELEASE UPDATE: 12.2.0.1.171017 (26635944)):
        Installed in the binary registry only
      Bundle series DBRU:
        ID 171017 in the binary registry and not installed in the SQL registry
      
      Adding patches to installation queue and performing prereq checks...
      Installation queue:
        Nothing to roll back
        The following patches will be applied:
          26635944 (OJVM RELEASE UPDATE: 12.2.0.1.171017 (26635944))
          26710464 (DATABASE RELEASE UPDATE 12.2.0.1.171017)
      
      Installing patches...
      Patch installation complete.  Total patches installed: 2
      
      Validating logfiles...
      Patch 26635944 apply: SUCCESS
        logfile: /opt/oracle/app/oracle/cfgtoollogs/sqlpatch/26635944/21607957/26635944_apply_ORCL_2017Dec04_09_17_37.log (no errors)
      Patch 26710464 apply: SUCCESS
        logfile: /opt/oracle/app/oracle/cfgtoollogs/sqlpatch/26710464/21632407/26710464_apply_ORCL_2017Dec04_09_18_33.log (no errors)
      SQL Patching tool complete on Mon Dec  4 09:19:55 2017
      
    4. Launch SQL*PLus sqlplus /nolog
    5. Restart the database
      Connect / as sysdba
      shutdown
      startup

       

 

TAGS

0 Comments