Table of Contents

Post-Upgrade Tasks

After the upgrade has been done, there are couple more scripts and configurations (RAC Necessary) which have to be done:

Scripts

The location of these scripts is: $ORACLE_HOME/rdbms/admin ← New ORACLE_HOME

Procedures

Let's start with the scripts:

Scripts

utlu122s

[oracle@lparaca admin]$ sqlplus

SQL*Plus: Release 12.2.0.1.0 Production on Tue Jan 23 14:14:39 2018

Copyright (c) 1982, 2016, Oracle.  All rights reserved.

Enter user-name: / as sysdba
Connected to an idle instance.

SQL> startup;
ORACLE instance started.

Total System Global Area 1174405120 bytes
Fixed Size          8619984 bytes
Variable Size     436209712 bytes
Database Buffers          721420288 bytes
Redo Buffers        8155136 bytes
Database mounted.
Database opened.
SQL> @utlu122s.sql^C

SQL> !pwd
/u01/app/oracle/product/12.2.0.1/rdbms/admin

SQL> @utlu122s.sql




Oracle Database 12.2 Post-Upgrade Status Tool           01-23-2018 14:15:45

Component                       Current         Version  Elapsed Time
Name                            Status          Number   HH:MM:SS

Oracle Server                  UPGRADED      12.2.0.1.0  00:14:55
JServer JAVA Virtual Machine           UPGRADED      12.2.0.1.0  00:09:19
Oracle Real Application Clusters       UPGRADED      12.2.0.1.0  00:00:01
Oracle Workspace Manager               UPGRADED      12.2.0.1.0  00:00:50
OLAP Analytic Workspace                UPGRADED      12.2.0.1.0  00:00:26
Oracle OLAP API                        UPGRADED      12.2.0.1.0  00:00:21
Oracle Label Security                  UPGRADED      12.2.0.1.0  00:00:12
Oracle XDK                     UPGRADED      12.2.0.1.0  00:01:22
Oracle Text                    UPGRADED      12.2.0.1.0  00:01:09
Oracle XML Database                    UPGRADED      12.2.0.1.0  00:02:19
Oracle Database Java Packages          UPGRADED      12.2.0.1.0  00:00:23
Oracle Multimedia                      UPGRADED      12.2.0.1.0  00:03:23
Spatial                        UPGRADED      12.2.0.1.0  00:06:53
Oracle Application Express             UPGRADED     5.0.4.00.12  00:13:35
Oracle Database Vault                  UPGRADED      12.2.0.1.0  00:00:29
Final Actions                                            00:02:51
Post Upgrade                                             00:00:55

Total Upgrade Time: 00:59:38

Database time zone version is 18. It is older than current release time
zone version 26. Time zone upgrade is needed using the DBMS_DST package.

Summary Report File = /u01/app/oracle/product/12.2.0.1/cfgtooll
<sxh>


===catuppst===
<sxh bash>

14:16:24 SQL> Rem
14:16:24 SQL> Rem $Header: rdbms/admin/catuppst.sql /main/52 2016/06/14 23:41:26 cmlim Exp $
14:16:24 SQL> Rem
14:16:24 SQL> Rem catuppst.sql
14:16:24 SQL> Rem
14:16:24 SQL> Rem Copyright (c) 2006, 2016, Oracle and/or its affiliates.
14:16:24 SQL> Rem All rights reserved.
14:16:24 SQL> Rem
14:16:24 SQL> Rem    NAME
14:16:24 SQL> Rem        catuppst.sql - CATalog UPgrade PoST-upgrade actions
14:16:24 SQL> Rem
14:16:24 SQL> Rem    DESCRIPTION
14:16:24 SQL> Rem        This post-upgrade script performs remaining upgrade actions that
14:16:24 SQL> Rem        do not require that the database be open in UPGRADE mode.
14:16:24 SQL> Rem        Automatically apply the latest PSU.
14:16:24 SQL> Rem
14:16:24 SQL> Rem    NOTES
14:16:24 SQL> Rem        You must be connected AS SYSDBA to run this script.
14:16:24 SQL> Rem
14:16:24 SQL> Rem    MODIFIED   (MM/DD/YY)
14:16:24 SQL> Rem    cmlim       06/06/16 - bug 23215791: add more DBUA_TIMESTAMPS during db
14:16:24 SQL> Rem                           upgrades
14:16:24 SQL> Rem    anupkk      04/03/16 - Bug 22917286: Moved call to olstrig.sql to
14:16:24 SQL> Rem                           olsdbmig.sql
14:16:24 SQL> Rem    raeburns    02/29/16 - Bug 22820096: revert ALTER TYPE to default
14:16:24 SQL> Rem                           CASCADE
14:16:24 SQL> Rem    rmorant     02/11/16 - Bug22340563 add parallel hint
14:16:24 SQL> Rem    atomar      02/04/16 - move aq action to release specific script
14:16:24 SQL> Rem    raeburns    12/09/15 - Bug 22175911: add SERVEROUTPUT OFF after
14:16:24 SQL> Rem                           catuptabdata.sql
Elapsed: 00:00:00.02
14:16:46 SQL>
14:16:46 SQL> -- DBUA_TIMESTAMP: catuppst.sql finished
14:16:46 SQL> SELECT dbms_registry_sys.time_stamp('CATUPPST') as timestamp from dual;

TIMESTAMP
--------------------------------------------------------------------------------
COMP_TIMESTAMP CATUPPST               2018-01-23 14:16:46
DBUA_TIMESTAMP CATUPPST      FINISHED 2018-01-23 14:16:46
DBUA_TIMESTAMP CATUPPST          NONE 2018-01-23 14:16:46


1 row selected.

Elapsed: 00:00:00.01
14:16:46 SQL>
14:16:46 SQL> Rem Set errorlogging off
14:16:46 SQL> SET ERRORLOGGING OFF;
14:16:46 SQL>
14:16:46 SQL> Rem
14:16:46 SQL> Rem Set _ORACLE_SCRIPT to false
14:16:46 SQL> Rem
14:16:46 SQL> ALTER SESSION SET "_ORACLE_SCRIPT"=false;

Session altered.

Elapsed: 00:00:00.00
14:16:46 SQL>
14:16:46 SQL> Rem *********************************************************************
14:16:46 SQL> Rem END catuppst.sql
14:16:46 SQL> Rem *********************************************************************
14:16:46 SQL>
14:16:46 SQL> @utlrp.sql
14:19:59 SQL> Rem
14:19:59 SQL> Rem $Header: utlrp.sql 24-jul-2003.10:06:51 gviswana Exp $

And finally, recompilation of the invalid objects with:

utlrp

14:16:24 SQL> Rem
14:16:24 SQL> Rem $Header: rdbms/admin/catuppst.sql /main/52 2016/06/14 23:41:26 cmlim Exp $
14:16:24 SQL> Rem
14:16:24 SQL> Rem catuppst.sql
14:16:24 SQL> Rem
14:16:24 SQL> Rem Copyright (c) 2006, 2016, Oracle and/or its affiliates.
14:16:24 SQL> Rem All rights reserved.
14:16:24 SQL> Rem
14:16:24 SQL> Rem    NAME
14:16:24 SQL> Rem        catuppst.sql - CATalog UPgrade PoST-upgrade actions
14:16:24 SQL> Rem
14:16:24 SQL> Rem    DESCRIPTION
14:16:24 SQL> Rem        This post-upgrade script performs remaining upgrade actions that
14:16:24 SQL> Rem        do not require that the database be open in UPGRADE mode.
14:16:24 SQL> Rem        Automatically apply the latest PSU.
14:16:24 SQL> Rem
14:16:24 SQL> Rem    NOTES
14:16:24 SQL> Rem        You must be connected AS SYSDBA to run this script.
14:16:24 SQL> Rem
14:16:24 SQL> Rem    MODIFIED   (MM/DD/YY)
14:16:24 SQL> Rem    cmlim       06/06/16 - bug 23215791: add more DBUA_TIMESTAMPS during db
14:16:24 SQL> Rem                           upgrades
14:16:24 SQL> Rem    anupkk      04/03/16 - Bug 22917286: Moved call to olstrig.sql to
14:16:24 SQL> Rem                           olsdbmig.sql
14:16:24 SQL> Rem    raeburns    02/29/16 - Bug 22820096: revert ALTER TYPE to default
14:16:24 SQL> Rem                           CASCADE
14:16:24 SQL> Rem    rmorant     02/11/16 - Bug22340563 add parallel hint
14:16:24 SQL> Rem    atomar      02/04/16 - move aq action to release specific script
14:16:24 SQL> Rem    raeburns    12/09/15 - Bug 22175911: add SERVEROUTPUT OFF after
14:16:24 SQL> Rem                           catuptabdata.sql
Elapsed: 00:00:00.02
14:16:46 SQL>
14:16:46 SQL> -- DBUA_TIMESTAMP: catuppst.sql finished
14:16:46 SQL> SELECT dbms_registry_sys.time_stamp('CATUPPST') as timestamp from dual;

TIMESTAMP
--------------------------------------------------------------------------------
COMP_TIMESTAMP CATUPPST               2018-01-23 14:16:46
DBUA_TIMESTAMP CATUPPST      FINISHED 2018-01-23 14:16:46
DBUA_TIMESTAMP CATUPPST          NONE 2018-01-23 14:16:46


1 row selected.

Elapsed: 00:00:00.01
14:16:46 SQL>
14:16:46 SQL> Rem Set errorlogging off
14:16:46 SQL> SET ERRORLOGGING OFF;
14:16:46 SQL>
14:16:46 SQL> Rem
14:16:46 SQL> Rem Set _ORACLE_SCRIPT to false
14:16:46 SQL> Rem
14:16:46 SQL> ALTER SESSION SET "_ORACLE_SCRIPT"=false;

Session altered.

Elapsed: 00:00:00.00
14:16:46 SQL>
14:16:46 SQL> Rem *********************************************************************
14:16:46 SQL> Rem END catuppst.sql
14:16:46 SQL> Rem *********************************************************************
14:16:46 SQL>
14:16:46 SQL> @utlrp.sql
14:19:59 SQL> Rem
14:19:59 SQL> Rem $Header: utlrp.sql 24-jul-2003.10:06:51 gviswana Exp $
-----------------------------------------------------------------------------------------
...Starting validation 14:26:50
...Database user "SYS", database schema "APEX_050000", user# "119" 14:26:50
...grant execute on "SYS"."DBMS_CRYPTO_INTERNAL" to APEX_050000 14:26:52
...272 packages
...265 package bodies
...465 tables
...8 functions
...16 procedures
...4 sequences
...497 triggers
...1582 indexes
...255 views
...0 libraries
...14 types
...5 type bodies
...0 operators
...0 index types
...Begin key object existence check 14:26:56
...Completed key object existence check 14:26:56
...Setting DBMS Registry 14:26:56
...Setting DBMS Registry Complete 14:26:56
...Exiting validate 14:26:56

PL/SQL procedure successfully completed.

Elapsed: 00:00:23.99
14:26:56 SQL> SET serveroutput off
14:26:56 SQL>
14:26:56 SQL>
14:26:56 SQL> Rem ===========================================================================
14:26:56 SQL> Rem END utlrp.sql
14:26:56 SQL> Rem ===========================================================================
14:26:56 SQL> 14:26:56 SQL>


Procedures

When the scripts are done, it is time to re-configure the keys:

Re-configure the keys

If you try to firstly change the database type to cluster database, this is what you will get when you try to start the instance with SPFILE residing on the ASM:

[oracle@lparaca dbs]$ ls -lart
total 24
-rw-r--r--  1 oracle oinstall 3079 May 15  2015 init.ora
-rw-rw----  1 oracle oinstall 1544 Jan 23 14:33 hc_orcl_1.dat
drwxr-xr-x 74 oracle oinstall 4096 Jan 23 15:44 ..
-rw-r-----  1 oracle oinstall 1272 Jan 23 16:00 initorcl_1.ora.bkp
drwxr-xr-x  2 oracle oinstall 4096 Jan 23 16:00 .
-rw-r-----  1 oracle oinstall   35 Jan 23 16:00 initorcl_1.ora
[oracle@lparaca dbs]$ cat initorcl_1.ora
SPFILE='+DATA/orcl/spfileorcl.ora'
[oracle@lparaca dbs]$
[oracle@lparaca dbs]$ sqlplus

SQL*Plus: Release 12.1.0.2.0 Production on Tue Jan 23 16:00:41 2018

Copyright (c) 1982, 2014, Oracle.  All rights reserved.

Enter user-name: / as sysdba

Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

SQL> shutdown immediate;
ORA-01507: database not mounted


ORACLE instance shut down.
SQL> startup nomount;
ORA-01078: failure in processing system parameters
ORA-01565: error in identifying file '+DATA/orcl/spfileorcl.ora'
ORA-17503: ksfdopn:10 Failed to open file +DATA/orcl/spfileorcl.ora
ORA-15173: entry 'spfileorcl.ora' does not exist in directory 'orcl'
ORA-06512: at line 4
ORA-06512: at "SYS.X$DBMS_DISKGROUP", line 504
ORA-06512: at line 2
SQL> Disconnected from Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

In order to avoid this, FIRST UPDATE The clusterware keys:

[oracle@lparaca dbs]$ $ORACLE_HOME/bin/srvctl upgrade database -db orcl -o $ORACLE_HOME

And then change the database type:

[oracle@lparaca dbs]$ sqlplus

SQL*Plus: Release 12.1.0.2.0 Production on Tue Jan 23 16:03:19 2018

Copyright (c) 1982, 2014, Oracle.  All rights reserved.

Enter user-name: / as sysdba
Connected to an idle instance.
SQL
SQL>
SQL> startup nomount;
ORACLE instance started.

Total System Global Area 1174405120 bytes
Fixed Size          8619984 bytes
Variable Size     436209712 bytes
Database Buffers          721420288 bytes
Redo Buffers        8155136 bytes
SQL> show parameter cluster

NAME                         TYPE        VALUE
------------------------------------ ----------- ------------------------------
cdb_cluster                  boolean     FALSE
cdb_cluster_name                     string      orcl
cluster_database                     boolean     FALSE
cluster_database_instances           integer     1
cluster_interconnects                string
SQL> alter system set cluster_database=true scope=spfile;

System altered.

SQL> shutdown immediate;
ORA-01507: database not mounted


ORACLE instance shut down.
SQL> Disconnected from Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

Don't forget to update the “/etc/oratab” with the correct home:

[oracle@lparaca dbs]$ vi /etc/oratab
[oracle@lparaca dbs]$ echo $ORACLE_HOME
/u01/app/oracle/product/12.2.0.1/
[oracle@lparaca dbs]$ tail /etc/oratab
# The first and second fields are the system identifier and home
# directory of the database respectively.  The third field indicates
# to the dbstart utility that the database should , "Y", or should not,
# "N", be brought up at system boot time.
#
# Multiple entries with the same $ORACLE_SID are not allowed.
#
#
+ASM1:/u01/app/oracle/grid_12201:N              # line added by Agent
orcl:/u01/app/oracle/product/12.2.0.1/:N        <- Newly added
[oracle@lparaca dbs]$ . oraenv
ORACLE_SID = [orcl_1] ? orcl
The Oracle base remains unchanged with value /u01/app/oracle/product
[oracle@lparaca dbs]$ $ORACLE_HOME/bin/srvctl status database -d orcl
Database is not running.
[oracle@lparaca dbs]$ $ORACLE_HOME/bin/srvctl start database -d orcl
[oracle@lparaca dbs]$ $ORACLE_HOME/bin/srvctl status database -d orcl
Instance orcl_1 is running on node lparacb
Instance orcl_2 is running on node lparaca
[oracle@lparaca dbs]$

Congrats, you have brand new 12.2.0.1 RAC Database:

[oracle@lparaca ~]$ sqlplus

SQL*Plus: Release 12.2.0.1.0 Production on Tue Jan 23 16:21:57 2018

Copyright (c) 1982, 2016, Oracle.  All rights reserved.

Enter user-name: / as sysdba

Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

SQL> select version from v$instance;

VERSION
-----------------
12.2.0.1.0

SQL>