Tuesday, August 14, 2018

Upgrading Oracle Restart from 12.2.0.1 to 18c

This post lists the steps for upgrading an Oracle restart environment (Single instance CDB on ASM) from 12.2.0.1. to 18.0.0.0 (production version 18.3.0.0). The 12.2 setup is on RHEL 7. The OS and kernel versions are as follows
cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.4 (Maipo)

uname -r
3.10.0-693.el7.x86_64
The current versions of the GI are
crsctl query has releaseversion
Oracle High Availability Services release version on the local node is [12.2.0.1.0]
crsctl query has softwareversion
Oracle High Availability Services version on the local node is [12.2.0.1.0]
The Oracle restart environment used is a role separated setup where GI is installed as grid user while Oracle software is installed Oracle user. The GI and Oracle homes had the release update (RU) 12.2.0.1.180417 applied.
Download and run orachk -u -o pre (1268927.2) on the 12.2 setup to identify any required patches before the upgrade. With the above RU applied no other patches were required be applied prior to the upgrade.
18c grid software instillation is also similar to 12.2 and is based on a image file. Before unzipping the GI image file create the 18c GI home directory and then unzip the GI image file into it.
mkdir -p /opt/app/oracle/product/18.0.0/grid
chmod 775 /opt/app/oracle/product/18.0.0
unzip LINUX.X64_180000_grid_home.zip -d /opt/app/oracle/product/18.0.0/grid
The location GI is unzipped must have at least 6.9GB free space. If not install will not proceed forward and following message is shown.
Use cluvfy with hacfg to verify pre-reqs.
cd /opt/app/oracle/product/18.0.0/grid
./runcluvfy.sh stage -pre hacfg

Verifying Physical Memory ...FAILED (PRVF-7530)
Verifying Available Physical Memory ...PASSED
Verifying Swap Size ...FAILED (PRVF-7573)
Verifying Free Space: city7s2:/usr,city7s2:/var,city7s2:/etc,city7s2:/sbin,city7s2:/tmp ...PASSED
Verifying User Existence: grid ...
  Verifying Users With Same UID: 1001 ...PASSED
Verifying User Existence: grid ...PASSED
Verifying Group Existence: dba ...PASSED
Verifying Group Membership: dba ...PASSED
Verifying Run Level ...PASSED
Verifying Architecture ...PASSED
Verifying OS Kernel Version ...PASSED
Verifying OS Kernel Parameter: semmsl ...PASSED
Verifying OS Kernel Parameter: semmns ...PASSED
Verifying OS Kernel Parameter: semopm ...PASSED
Verifying OS Kernel Parameter: semmni ...PASSED
Verifying OS Kernel Parameter: shmmax ...PASSED
Verifying OS Kernel Parameter: shmmni ...PASSED
Verifying OS Kernel Parameter: shmall ...PASSED
Verifying OS Kernel Parameter: file-max ...PASSED
Verifying OS Kernel Parameter: ip_local_port_range ...PASSED
Verifying OS Kernel Parameter: rmem_default ...PASSED
Verifying OS Kernel Parameter: rmem_max ...PASSED
Verifying OS Kernel Parameter: wmem_default ...PASSED
Verifying OS Kernel Parameter: wmem_max ...PASSED
Verifying OS Kernel Parameter: aio-max-nr ...PASSED
Verifying Package: binutils-2.23.52.0.1 ...PASSED
Verifying Package: compat-libcap1-1.10 ...PASSED
Verifying Package: libgcc-4.8.2 (x86_64) ...PASSED
Verifying Package: libstdc++-4.8.2 (x86_64) ...PASSED
Verifying Package: libstdc++-devel-4.8.2 (x86_64) ...PASSED
Verifying Package: sysstat-10.1.5 ...PASSED
Verifying Package: gcc-c++-4.8.2 ...PASSED
Verifying Package: ksh ...PASSED
Verifying Package: make-3.82 ...PASSED
Verifying Package: glibc-2.17 (x86_64) ...PASSED
Verifying Package: glibc-devel-2.17 (x86_64) ...PASSED
Verifying Package: libaio-0.3.109 (x86_64) ...PASSED
Verifying Package: libaio-devel-0.3.109 (x86_64) ...PASSED
Verifying Package: nfs-utils-1.2.3-15 ...PASSED
Verifying Package: smartmontools-6.2-4 ...PASSED
Verifying Package: net-tools-2.0-0.17 ...PASSED
Verifying Package: compat-libstdc++-33-3.2.3 (x86_64) ...PASSED
Verifying Package: libxcb-1.11 (x86_64) ...PASSED
Verifying Package: libX11-1.6.3 (x86_64) ...PASSED
Verifying Package: libXau-1.0.8 (x86_64) ...PASSED
Verifying Package: libXi-1.7.4 (x86_64) ...PASSED
Verifying Package: libXtst-1.2.2 (x86_64) ...PASSED
Verifying Users With Same UID: 0 ...PASSED
Verifying Current Group ID ...PASSED
Verifying Root user consistency ...PASSED

Pre-check for Oracle Restart configuration was unsuccessful.

Failures were encountered during execution of CVU verification request "stage -pre hacfg".

Verifying Physical Memory ...FAILED
city7s2: PRVF-7530 : Sufficient physical memory is not available on node
         "city7s2" [Required physical memory = 8GB (8388608.0KB)]

Verifying Swap Size ...FAILED
city7s2: PRVF-7573 : Sufficient swap size is not available on node "city7s2"
         [Required = 5.7752GB (6055760.0KB) ; Found = 3.7246GB (3905532.0KB)]


CVU operation performed:      stage -pre hacfg
Date:                         06-Aug-2018 18:43:55
CVU home:                     /opt/app/oracle/product/18.0.0/grid/
User:                         grid
The failure is due to lack of space for SWAP and memory (18c expect minimum 8G) and could be ignored on a test system such as this.
ASM will be upgraded as part of the upgrade process. Therefore stop the database before starting the GI upgrade.
srvctl stop database -d stby2cdb
Start the GI upgrade by running the gridSetup.sh from the grid home.
cd /opt/app/oracle/product/18.0.0/grid
./gridSetup.sh
Select upgrade GI option.
As mentioned earlier, the installer prompts to shutdown the DB since ASM will be as part of GI upgrade.
Location of the GI home cannot be changed.
As observed during cluvfy run, only the memory related pre-reqs raise warnings.
Upgrade summary page.
Run root when prompted.

Following shows the output from running the rootugprade script.
# /opt/app/oracle/product/18.0.0/grid/rootupgrade.sh
Performing root user operation.

The following environment variables are set as:
    ORACLE_OWNER= grid
    ORACLE_HOME=  /opt/app/oracle/product/18.0.0/grid

Enter the full pathname of the local bin directory: [/usr/local/bin]:
The contents of "dbhome" have not changed. No need to overwrite.
The file "oraenv" already exists in /usr/local/bin.  Overwrite it? (y/n)
[n]: y
   Copying oraenv to /usr/local/bin ...
The file "coraenv" already exists in /usr/local/bin.  Overwrite it? (y/n)
[n]: y
   Copying coraenv to /usr/local/bin ...

Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Using configuration parameter file: /opt/app/oracle/product/18.0.0/grid/crs/install/crsconfig_params
The log of current session can be found at:
  /opt/app/oracle/crsdata/city7s2/crsconfig/roothas_2018-08-06_07-20-42PM.log
2018/08/06 19:20:46 CLSRSC-595: Executing upgrade step 1 of 12: 'UpgPrechecks'.
2018/08/06 19:20:51 CLSRSC-363: User ignored prerequisites during installation
2018/08/06 19:20:52 CLSRSC-595: Executing upgrade step 2 of 12: 'GetOldConfig'.
2018/08/06 19:21:01 CLSRSC-595: Executing upgrade step 3 of 12: 'GenSiteGUIDs'.
2018/08/06 19:21:01 CLSRSC-595: Executing upgrade step 4 of 12: 'SetupOSD'.
2018/08/06 19:21:01 CLSRSC-595: Executing upgrade step 5 of 12: 'PreUpgrade'.

ASM has been upgraded and started successfully.

2018/08/06 19:22:54 CLSRSC-595: Executing upgrade step 6 of 12: 'UpgradeAFD'.
2018/08/06 19:22:54 CLSRSC-595: Executing upgrade step 7 of 12: 'UpgradeOLR'.
Creating OCR keys for user 'grid', privgrp 'oinstall'..
Operation successful.
2018/08/06 19:23:06 CLSRSC-595: Executing upgrade step 8 of 12: 'UpgradeOCR'.
LOCAL ONLY MODE
Successfully accumulated necessary OCR keys.
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
CRS-4664: Node city7s2 successfully pinned.
2018/08/06 19:23:12 CLSRSC-595: Executing upgrade step 9 of 12: 'CreateOHASD'.
2018/08/06 19:23:16 CLSRSC-595: Executing upgrade step 10 of 12: 'ConfigOHASD'.
2018/08/06 19:23:16 CLSRSC-329: Replacing Clusterware entries in file 'oracle-ohasd.service'
2018/08/06 19:23:50 CLSRSC-595: Executing upgrade step 11 of 12: 'UpgradeSIHA'.
CRS-4123: Oracle High Availability Services has been started.


city7s2     2018/08/06 19:25:46     /opt/app/oracle/product/18.0.0/grid/cdata/city7s2/backup_20180806_192546.olr     70732493

city7s2     2018/07/16 15:05:07     /opt/app/oracle/product/12.2.0/grid/cdata/city7s2/backup_20180716_150507.olr     2527213670
2018/08/06 19:25:46 CLSRSC-595: Executing upgrade step 12 of 12: 'InstallACFS'.
CRS-4123: Oracle High Availability Services has been started.

CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'city7s2'
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'city7s2' has completed
CRS-4133: Oracle High Availability Services has been stopped.
CRS-4123: Oracle High Availability Services has been started.
2018/08/06 19:26:54 CLSRSC-327: Successfully configured Oracle Restart for a standalone server
Click OK on the execution configuration to proceed with the rest of the upgrade steps. Following shows the end of the upgrade page.
The HAS software is now upgraded to 18c.
crsctl query has releaseversion
Oracle High Availability Services release version on the local node is [18.0.0.0.0]
crsctl query has softwareversion
Oracle High Availability Services version on the local node is [18.0.0.0.0]
If the ASM spfile was moved to $GI_HOME/dbs (described in step 12 in an earlier post) then this need to be moved to 18c GI_HOME. Spfile is not automatically moved to new 18c GI Home and remains in the 12c home.
srvctl config asm
ASM home: 
Password file: +DATA/orapwasm
Backup of Password file:
ASM listener: LISTENER
Spfile: /opt/app/oracle/product/12.2.0/grid/dbs/spfile+ASM.ora
ASM diskgroup discovery string: /dev/oracleasm/*
This could be verified by checking the ASM alert log.
Using parameter settings in server-side spfile /opt/app/oracle/product/12.2.0/grid/dbs/spfile+ASM.ora
Once the 12c GI home is removed then the ASM spfile will be lost resulting in ASM start up issues. Use asmcmd to copy the spfile to new 18c home.
ASMCMD> spget
/opt/app/oracle/product/12.2.0/grid/dbs/spfile+ASM.ora
ASMCMD> spcopy /opt/app/oracle/product/12.2.0/grid/dbs/spfile+ASM.ora /opt/app/oracle/product/18.0.0/grid/dbs/spfile+ASM.ora
ASMCMD> spset /opt/app/oracle/product/18.0.0/grid/dbs/spfile+ASM.ora
ASMCMD> spget
/opt/app/oracle/product/18.0.0/grid/dbs/spfile+ASM.ora
Check Oracle restart configuration is also updated with the new spfile location. When spfile is copied using spcopy, Oracle restart configuration gets automatically updated.
srvctl config asm
ASM home: 
Password file: +DATA/orapwasm
Backup of Password file:
ASM listener: LISTENER
Spfile: /opt/app/oracle/product/18.0.0/grid/dbs/spfile+ASM.ora
ASM diskgroup discovery string: /dev/oracleasm/*
If the ASM Spfile was located in ASM (e.g. Spfile: +DATA/ASM/ASMPARAMETERFILE/registry.253.958818889) then there are no issues to address.
Use cluvfy post check validate as follows
cluvfy stage -post hacfg

Verifying Oracle Restart Integrity ...PASSED
Verifying OLR Integrity ...PASSED

Post-check for Oracle Restart configuration was successful.


Next step is to upgrade the database software. Similar to GI home instillation, this too is based on image (different to 12.2). Create the 18c home location and unzip the DB software image file into it.
mkdir -p /opt/app/oracle/product/18.0.0/dbhome_1
unzip LINUX.X64_180000_db_home.zip -d /opt/app/oracle/product/18.0.0/dbhome_1
To begin the installation execute runInstaller from Oracle home location.
cd /opt/app/oracle/product/18.0.0/dbhome_1
./runInstaller
Select software only setup for the instillation option.
Select single database installation as this is an Oracle restart setup.
Select appropriate edition based on the licensing.
Oracle home location is fixed and the location is where the DB software was unzipped.
There are no new OS groups introduced in 18c. So all the OS groups used 12.2 are used here as well.
DB software installation summary.
When prompted run the root.sh from Oracle. Root.sh script prompts to install TFA even for single instance databases. It is also possible to install TFA later on as well.
/opt/app/oracle/product/18.0.0/dbhome_1/root.sh
Performing root user operation.

The following environment variables are set as:
    ORACLE_OWNER= oracle
    ORACLE_HOME=  /opt/app/oracle/product/18.0.0/dbhome_1

Enter the full pathname of the local bin directory: [/usr/local/bin]:
The contents of "dbhome" have not changed. No need to overwrite.
The contents of "oraenv" have not changed. No need to overwrite.
The contents of "coraenv" have not changed. No need to overwrite.

Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Do you want to setup Oracle Trace File Analyzer (TFA) now ? yes|[no] :
no
Oracle Trace File Analyzer (TFA - Non Daemon Mode) is available at :
    /opt/app/oracle/product/18.0.0/dbhome_1/suptools/tfa/release/tfa_home/bin/tfactl

Note :
1. tfactl will use TFA Daemon Mode if TFA already running in Daemon Mode and user has access to TFA
2. tfactl will configure TFA Non Daemon Mode only if user has no access to TFA Daemon mode or TFA Daemon mode is not installed

OR

Oracle Trace File Analyzer (TFA - Daemon Mode) can be installed by running this script :
    /opt/app/oracle/product/18.0.0/dbhome_1/suptools/tfa/release/tfa_home/install/roottfa.sh


After the database software is installed next step is upgrade of the database. Run preupgrade.jar available in the 18c home (18c_home/rdbms/admin) to check the upgrade readiness of the database (for more refer 2421552.1). Since this is a CDB with one PDB the preupgrade tool will generate 3 sections (CDB$ROOT, PDB$SEE and the PDB). Below is the output from the preupgrade run.
$ORACLE_HOME/jdk/bin/java -jar preupgrade.jar TERMINAL
Report generated by Oracle Database Pre-Upgrade Information Tool Version
18.0.0.0.0 on 2018-08-08T13:22:45

Upgrade-To version: 18.0.0.0.0

=======================================
Status of the database prior to upgrade
=======================================
      Database Name:  PRODCDB
     Container Name:  CDB$ROOT
       Container ID:  1
            Version:  12.2.0.1.0
         Compatible:  12.2.0
          Blocksize:  8192
           Platform:  Linux x86 64-bit
      Timezone File:  26
  Database log mode:  ARCHIVELOG
           Readonly:  FALSE
            Edition:  EE

  Oracle Component                       Upgrade Action    Current Status
  ----------------                       --------------    --------------
  Oracle Server                          [to be upgraded]  VALID
  Real Application Clusters              [to be upgraded]  OPTION OFF
  Oracle Workspace Manager               [to be upgraded]  VALID
  Oracle Text                            [to be upgraded]  VALID
  Oracle XML Database                    [to be upgraded]  VALID

==============
BEFORE UPGRADE
==============

  REQUIRED ACTIONS
  ================
  None

  RECOMMENDED ACTIONS
  ===================
  1.  Review and remove any unnecessary HIDDEN/UNDERSCORE parameters.

      The database contains the following initialization parameters whose name
      begins with an underscore:

      _rac_dbtype_reset

      Remove hidden parameters before database upgrade unless your application
      vendors and/or Oracle Support state differently.  Changes will need to be
      made in the pfile/spfile.

  2.  (AUTOFIXUP) Gather stale data dictionary statistics prior to database
      upgrade in off-peak time using:

        EXECUTE DBMS_STATS.GATHER_DICTIONARY_STATS;

      Dictionary statistics do not exist or are stale (not up-to-date).

      Dictionary statistics help the Oracle optimizer find efficient SQL
      execution plans and are essential for proper upgrade timing. Oracle
      recommends gathering dictionary statistics in the last 24 hours before
      database upgrade.

      For information on managing optimizer statistics, refer to the 12.2.0.1
      Oracle Database SQL Tuning Guide.

  INFORMATION ONLY
  ================
  3.  To help you keep track of your tablespace allocations, the following
      AUTOEXTEND tablespaces are expected to successfully EXTEND during the
      upgrade process.

                                                 Min Size
      Tablespace                        Size     For Upgrade
      ----------                     ----------  -----------
      SYSTEM                             700 MB       866 MB
      TEMP                                54 MB       150 MB
      UNDOTBS1                           380 MB       412 MB

      Minimum tablespace sizes for upgrade are estimates.

  4.  No action needed.

      Using default parallel upgrade options, this CDB with 2 PDBs will first
      upgrade the CDB$ROOT, and then upgrade at most 2 PDBs at a time using 2
      parallel processes per PDB.

      The number of PDBs upgraded in parallel and the number of parallel
      processes per PDB can be adjusted as described in Database Upgrade Guide.

  ORACLE GENERATED FIXUP SCRIPT
  =============================
  All of the issues in database PRODCDB container CDB$ROOT
  which are identified above as BEFORE UPGRADE "(AUTOFIXUP)" can be resolved by
  executing the following from within the container

    SQL>@/opt/app/oracle/cfgtoollogs/stby2cdb/preupgrade/preupgrade_fixups.sql

=============
AFTER UPGRADE
=============

  REQUIRED ACTIONS
  ================
  None

  RECOMMENDED ACTIONS
  ===================
  5.  Upgrade the database time zone file using the DBMS_DST package.

      The database is using time zone file version 26 and the target 18.0.0.0.0
      release ships with time zone file version 31.

      Oracle recommends upgrading to the desired (latest) version of the time
      zone file.  For more information, refer to "Upgrading the Time Zone File
      and Timestamp with Time Zone Data" in the 18.0.0.0.0 Oracle Database
      Globalization Support Guide.

  6.  (AUTOFIXUP) Gather dictionary statistics after the upgrade using the
      command:

        EXECUTE DBMS_STATS.GATHER_DICTIONARY_STATS;

      Oracle recommends gathering dictionary statistics after upgrade.

      Dictionary statistics provide essential information to the Oracle
      optimizer to help it find efficient SQL execution plans. After a database
      upgrade, statistics need to be re-gathered as there can now be tables
      that have significantly changed during the upgrade or new tables that do
      not have statistics gathered yet.

  7.  Gather statistics on fixed objects after the upgrade and when there is a
      representative workload on the system using the command:

        EXECUTE DBMS_STATS.GATHER_FIXED_OBJECTS_STATS;

      This recommendation is given for all preupgrade runs.

      Fixed object statistics provide essential information to the Oracle
      optimizer to help it find efficient SQL execution plans.  Those
      statistics are specific to the Oracle Database release that generates
      them, and can be stale upon database upgrade.

      For information on managing optimizer statistics, refer to the 12.2.0.1
      Oracle Database SQL Tuning Guide.

  ORACLE GENERATED FIXUP SCRIPT
  =============================
  All of the issues in database PRODCDB container CDB$ROOT
  which are identified above as AFTER UPGRADE "(AUTOFIXUP)" can be resolved by
  executing the following from within the container

    SQL>@/opt/app/oracle/cfgtoollogs/stby2cdb/preupgrade/postupgrade_fixups.sql


Report generated by Oracle Database Pre-Upgrade Information Tool Version
18.0.0.0.0 on 2018-08-08T13:23:03

Upgrade-To version: 18.0.0.0.0

=======================================
Status of the database prior to upgrade
=======================================
      Database Name:  PRODCDB
     Container Name:  PDB$SEED
       Container ID:  2
            Version:  12.2.0.1.0
         Compatible:  12.2.0
          Blocksize:  8192
           Platform:  Linux x86 64-bit
      Timezone File:  26
  Database log mode:  ARCHIVELOG
           Readonly:  TRUE
            Edition:  EE

  Oracle Component                       Upgrade Action    Current Status
  ----------------                       --------------    --------------
  Oracle Server                          [to be upgraded]  VALID
  Real Application Clusters              [to be upgraded]  OPTION OFF
  Oracle Workspace Manager               [to be upgraded]  VALID
  Oracle Text                            [to be upgraded]  VALID
  Oracle XML Database                    [to be upgraded]  VALID

==============
BEFORE UPGRADE
==============

  REQUIRED ACTIONS
  ================
  None

  RECOMMENDED ACTIONS
  ===================
  1.  Run 12.2.0.1.0 $ORACLE_HOME/rdbms/admin/utlrp.sql to recompile invalid
      objects.  You can view the individual invalid objects with

        SET SERVEROUTPUT ON;
        EXECUTE DBMS_PREUP.INVALID_OBJECTS;

      4 objects are INVALID.

      There should be no INVALID objects in SYS/SYSTEM or user schemas before
      database upgrade.

  2.  Review and remove any unnecessary HIDDEN/UNDERSCORE parameters.

      The database contains the following initialization parameters whose name
      begins with an underscore:

      _rac_dbtype_reset

      Remove hidden parameters before database upgrade unless your application
      vendors and/or Oracle Support state differently.  Changes will need to be
      made in the pfile/spfile.

  3.  (AUTOFIXUP) Gather stale data dictionary statistics prior to database
      upgrade in off-peak time using:

        EXECUTE DBMS_STATS.GATHER_DICTIONARY_STATS;

      Dictionary statistics do not exist or are stale (not up-to-date).

      Dictionary statistics help the Oracle optimizer find efficient SQL
      execution plans and are essential for proper upgrade timing. Oracle
      recommends gathering dictionary statistics in the last 24 hours before
      database upgrade.

      For information on managing optimizer statistics, refer to the 12.2.0.1
      Oracle Database SQL Tuning Guide.

  4.  (AUTOFIXUP) Gather statistics on fixed objects prior the upgrade.

      None of the fixed object tables have had stats collected.

      Gathering statistics on fixed objects, if none have been gathered yet, is
      recommended prior to upgrading.

      For information on managing optimizer statistics, refer to the 12.2.0.1
      Oracle Database SQL Tuning Guide.

  INFORMATION ONLY
  ================
  5.  To help you keep track of your tablespace allocations, the following
      AUTOEXTEND tablespaces are expected to successfully EXTEND during the
      upgrade process.

                                                 Min Size
      Tablespace                        Size     For Upgrade
      ----------                     ----------  -----------
      SYSAUX                             285 MB       500 MB
      SYSTEM                             210 MB       589 MB
      TEMP                                20 MB       150 MB
      UNDOTBS1                           210 MB       412 MB

      Minimum tablespace sizes for upgrade are estimates.

  6.  No action needed.

      Using default parallel upgrade options, this CDB with 1 PDBs will first
      upgrade the CDB$ROOT, and then upgrade at most 1 PDBs at a time using 2
      parallel processes per PDB.

      The number of PDBs upgraded in parallel and the number of parallel
      processes per PDB can be adjusted as described in Database Upgrade Guide.

  ORACLE GENERATED FIXUP SCRIPT
  =============================
  All of the issues in database PRODCDB container PDB$SEED
  which are identified above as BEFORE UPGRADE "(AUTOFIXUP)" can be resolved by
  executing the following from within the container

    SQL>@/opt/app/oracle/cfgtoollogs/stby2cdb/preupgrade/preupgrade_fixups.sql

=============
AFTER UPGRADE
=============

  REQUIRED ACTIONS
  ================
  None

  RECOMMENDED ACTIONS
  ===================
  7.  Upgrade the database time zone file using the DBMS_DST package.

      The database is using time zone file version 26 and the target 18.0.0.0.0
      release ships with time zone file version 31.

      Oracle recommends upgrading to the desired (latest) version of the time
      zone file.  For more information, refer to "Upgrading the Time Zone File
      and Timestamp with Time Zone Data" in the 18.0.0.0.0 Oracle Database
      Globalization Support Guide.

  8.  (AUTOFIXUP) Gather dictionary statistics after the upgrade using the
      command:

        EXECUTE DBMS_STATS.GATHER_DICTIONARY_STATS;

      Oracle recommends gathering dictionary statistics after upgrade.

      Dictionary statistics provide essential information to the Oracle
      optimizer to help it find efficient SQL execution plans. After a database
      upgrade, statistics need to be re-gathered as there can now be tables
      that have significantly changed during the upgrade or new tables that do
      not have statistics gathered yet.

  9.  Gather statistics on fixed objects after the upgrade and when there is a
      representative workload on the system using the command:

        EXECUTE DBMS_STATS.GATHER_FIXED_OBJECTS_STATS;

      This recommendation is given for all preupgrade runs.

      Fixed object statistics provide essential information to the Oracle
      optimizer to help it find efficient SQL execution plans.  Those
      statistics are specific to the Oracle Database release that generates
      them, and can be stale upon database upgrade.

      For information on managing optimizer statistics, refer to the 12.2.0.1
      Oracle Database SQL Tuning Guide.

  ORACLE GENERATED FIXUP SCRIPT
  =============================
  All of the issues in database PRODCDB container PDB$SEED
  which are identified above as AFTER UPGRADE "(AUTOFIXUP)" can be resolved by
  executing the following from within the container

    SQL>@/opt/app/oracle/cfgtoollogs/stby2cdb/preupgrade/postupgrade_fixups.sql


Report generated by Oracle Database Pre-Upgrade Information Tool Version
18.0.0.0.0 on 2018-08-08T13:23:01

Upgrade-To version: 18.0.0.0.0

=======================================
Status of the database prior to upgrade
=======================================
      Database Name:  PRODCDB
     Container Name:  PDBAPP1
       Container ID:  3
            Version:  12.2.0.1.0
         Compatible:  12.2.0
          Blocksize:  8192
           Platform:  Linux x86 64-bit
      Timezone File:  26
  Database log mode:  ARCHIVELOG
           Readonly:  FALSE
            Edition:  EE

  Oracle Component                       Upgrade Action    Current Status
  ----------------                       --------------    --------------
  Oracle Server                          [to be upgraded]  VALID
  Real Application Clusters              [to be upgraded]  OPTION OFF
  Oracle Workspace Manager               [to be upgraded]  VALID
  Oracle Text                            [to be upgraded]  VALID
  Oracle XML Database                    [to be upgraded]  VALID

==============
BEFORE UPGRADE
==============

  REQUIRED ACTIONS
  ================
  None

  RECOMMENDED ACTIONS
  ===================
  1.  Run 12.2.0.1.0 $ORACLE_HOME/rdbms/admin/utlrp.sql to recompile invalid
      objects.  You can view the individual invalid objects with

        SET SERVEROUTPUT ON;
        EXECUTE DBMS_PREUP.INVALID_OBJECTS;

      4 objects are INVALID.

      There should be no INVALID objects in SYS/SYSTEM or user schemas before
      database upgrade.

  2.  Review and remove any unnecessary HIDDEN/UNDERSCORE parameters.

      The database contains the following initialization parameters whose name
      begins with an underscore:

      _rac_dbtype_reset

      Remove hidden parameters before database upgrade unless your application
      vendors and/or Oracle Support state differently.  Changes will need to be
      made in the pfile/spfile.

  3.  (AUTOFIXUP) Gather stale data dictionary statistics prior to database
      upgrade in off-peak time using:

        EXECUTE DBMS_STATS.GATHER_DICTIONARY_STATS;

      Dictionary statistics do not exist or are stale (not up-to-date).

      Dictionary statistics help the Oracle optimizer find efficient SQL
      execution plans and are essential for proper upgrade timing. Oracle
      recommends gathering dictionary statistics in the last 24 hours before
      database upgrade.

      For information on managing optimizer statistics, refer to the 12.2.0.1
      Oracle Database SQL Tuning Guide.

  INFORMATION ONLY
  ================
  4.  To help you keep track of your tablespace allocations, the following
      AUTOEXTEND tablespaces are expected to successfully EXTEND during the
      upgrade process.

                                                 Min Size
      Tablespace                        Size     For Upgrade
      ----------                     ----------  -----------
      SYSAUX                             395 MB       582 MB
      SYSTEM                             210 MB       600 MB
      TEMP                                20 MB       150 MB
      UNDOTBS1                           210 MB       412 MB

      Minimum tablespace sizes for upgrade are estimates.

  5.  No action needed.

      Using default parallel upgrade options, this CDB with 1 PDBs will first
      upgrade the CDB$ROOT, and then upgrade at most 1 PDBs at a time using 2
      parallel processes per PDB.

      The number of PDBs upgraded in parallel and the number of parallel
      processes per PDB can be adjusted as described in Database Upgrade Guide.

  ORACLE GENERATED FIXUP SCRIPT
  =============================
  All of the issues in database PRODCDB container PDBAPP1
  which are identified above as BEFORE UPGRADE "(AUTOFIXUP)" can be resolved by
  executing the following from within the container

    SQL>@/opt/app/oracle/cfgtoollogs/stby2cdb/preupgrade/preupgrade_fixups.sql

=============
AFTER UPGRADE
=============

  REQUIRED ACTIONS
  ================
  None

  RECOMMENDED ACTIONS
  ===================
  6.  Upgrade the database time zone file using the DBMS_DST package.

      The database is using time zone file version 26 and the target 18.0.0.0.0
      release ships with time zone file version 31.

      Oracle recommends upgrading to the desired (latest) version of the time
      zone file.  For more information, refer to "Upgrading the Time Zone File
      and Timestamp with Time Zone Data" in the 18.0.0.0.0 Oracle Database
      Globalization Support Guide.

  7.  (AUTOFIXUP) Gather dictionary statistics after the upgrade using the
      command:

        EXECUTE DBMS_STATS.GATHER_DICTIONARY_STATS;

      Oracle recommends gathering dictionary statistics after upgrade.

      Dictionary statistics provide essential information to the Oracle
      optimizer to help it find efficient SQL execution plans. After a database
      upgrade, statistics need to be re-gathered as there can now be tables
      that have significantly changed during the upgrade or new tables that do
      not have statistics gathered yet.

  8.  Gather statistics on fixed objects after the upgrade and when there is a
      representative workload on the system using the command:

        EXECUTE DBMS_STATS.GATHER_FIXED_OBJECTS_STATS;

      This recommendation is given for all preupgrade runs.

      Fixed object statistics provide essential information to the Oracle
      optimizer to help it find efficient SQL execution plans.  Those
      statistics are specific to the Oracle Database release that generates
      them, and can be stale upon database upgrade.

      For information on managing optimizer statistics, refer to the 12.2.0.1
      Oracle Database SQL Tuning Guide.

  ORACLE GENERATED FIXUP SCRIPT
  =============================
  All of the issues in database PRODCDB container PDBAPP1
  which are identified above as AFTER UPGRADE "(AUTOFIXUP)" can be resolved by
  executing the following from within the container

    SQL>@/opt/app/oracle/cfgtoollogs/stby2cdb/preupgrade/postupgrade_fixups.sql


==================
PREUPGRADE SUMMARY
==================
  /opt/app/oracle/cfgtoollogs/stby2cdb/preupgrade/preupgrade.log
  /opt/app/oracle/cfgtoollogs/stby2cdb/preupgrade/preupgrade_fixups.sql
  /opt/app/oracle/cfgtoollogs/stby2cdb/preupgrade/postupgrade_fixups.sql

Execute fixup scripts across the entire CDB:

Before upgrade:

1. Execute preupgrade fixups with the below command
$ORACLE_HOME/perl/bin/perl -I$ORACLE_HOME/perl/lib -I$ORACLE_HOME/rdbms/admin $ORACLE_HOME/rdbms/admin/catcon.pl -l /opt/app/oracle/cfgtoollogs/stby2cdb/preupgrade/ -b preup_stby2cdb /opt/app/oracle/cfgtoollogs/stby2cdb/preupgrade/preupgrade_fixups.sql

2. Review logs under /opt/app/oracle/cfgtoollogs/stby2cdb/preupgrade/

After the upgrade:

1. Execute postupgrade fixups with the below command
$ORACLE_HOME/perl/bin/perl -I$ORACLE_HOME/perl/lib -I$ORACLE_HOME/rdbms/admin $ORACLE_HOME/rdbms/admin/catcon.pl -l /opt/app/oracle/cfgtoollogs/stby2cdb/preupgrade/ -b postup_stby2cdb /opt/app/oracle/cfgtoollogs/stby2cdb/preupgrade/postupgrade_fixups.sql

2. Review logs under /opt/app/oracle/cfgtoollogs/stby2cdb/preupgrade/
Run the pre-upgrade fixup script and then DBUA from the 18c home. Select the database to upgrade.
The PDB is upgraded at the same the CDB. If there were multiple PDBs this step allows to set the order of priority for upgrading the PDBs.
Check and resolve any validation concerns.
Parallel upgrade will speed up the upgrade process. This step also allows to specify whether timezone is also upgraded at the same time as the database.
Specify recovery option in case upgrade fails and has to revert back to 12.2 DB.
Select the listener to be used.
The upgrade summary page.
Upgrade progress.
Upgrade result page.
Upgrade result page showing total upgrade time.
Once the upgrade has finished execute the post-upgrade fixup script (mentioned in the output when preupgrade.jar was run).
The DB components versions and status after the upgrade for each container is as follows. The full version is 18.3 due the fact that RU 18.3.0.0.180717 is bundled with the 18c installer image file (check .patch_storge after unzipping) and applied to the database during the upgrade.
SQL> select con_id,comp_name,status,version,version_full from cdb_registry order by 1,2;

    CON_ID COMP_NAME                           STATUS       VERSION         VERSION_FULL
---------- ----------------------------------- ------------ --------------- ---------------
         1 Oracle Database Catalog Views       VALID        18.0.0.0.0      18.3.0.0.0
         1 Oracle Database Packages and Types  VALID        18.0.0.0.0      18.3.0.0.0
         1 Oracle Real Application Clusters    OPTION OFF   18.0.0.0.0      18.3.0.0.0
         1 Oracle Text                         VALID        18.0.0.0.0      18.3.0.0.0
         1 Oracle Workspace Manager            VALID        18.0.0.0.0      18.3.0.0.0
         1 Oracle XML Database                 VALID        18.0.0.0.0      18.3.0.0.0
         3 Oracle Database Catalog Views       VALID        18.0.0.0.0      18.3.0.0.0
         3 Oracle Database Packages and Types  VALID        18.0.0.0.0      18.3.0.0.0
         3 Oracle Real Application Clusters    OPTION OFF   18.0.0.0.0      18.3.0.0.0
         3 Oracle Text                         VALID        18.0.0.0.0      18.3.0.0.0
         3 Oracle Workspace Manager            VALID        18.0.0.0.0      18.3.0.0.0
         3 Oracle XML Database                 VALID        18.0.0.0.0      18.3.0.0.0
The timezone file has been upgraded to 31.
SQL> select * from v$timezone_file;

FILENAME                VERSION     CON_ID
-------------------- ---------- ----------
timezlrg_31.dat              31          0
If satisfied with the upgrade and application testing then change the compatibility parameter on the DB and ASM disk groups.
SQL> alter system set compatible='18.0.0.0.0' scope=spfile;
shutdown immediate;
Login as grid user and then login to ASM instance as sysasm to change asm compatibility parameters.
SQL> alter diskgroup FRA SET attribute 'compatible.asm'='18.0.0.0.0';
SQL> alter diskgroup DATA  SET attribute 'compatible.asm'='18.0.0.0.0';
SQL> alter diskgroup fra set attribute 'compatible.rdbms'='18.0.0.0.0';
SQL> alter diskgroup data set attribute 'compatible.rdbms'='18.0.0.0.0';

SQL> select g.name,a.name,a.value from v$asm_diskgroup g, v$asm_attribute a where g.group_number=a.group_number and a.name like '%compat%';

NAME                 NAME                 VALUE
-------------------- -------------------- --------------------
DATA                 compatible.asm       18.0.0.0.0
DATA                 compatible.rdbms     18.0.0.0.0
FRA                  compatible.asm       18.0.0.0.0
FRA                  compatible.rdbms     18.0.0.0.0
After ASM compatibility parameters are updated start the database.
18c also has the patch listing error mentioned in an earlier post. The fix mentioned in that post works for 18c as well.
Finally run orachk -u -o post check the post upgrade state of the oracle restart setup.

Related Posts
Upgrading Oracle Single Instance with ASM (Oracle Restart) from 11.2.0.4 to 12.2.0.1
Upgrading Oracle Single Instance with ASM (Oracle Restart) from 12.1.0.2 to 12.2.0.1
Upgrading Single Instance on ASM from 11.2.0.3 to 11.2.0.4
Upgrading Grid Infrastructure Used for Single Instance from 11.2.0.4 to 12.1.0.2