Running the post upgrade SQL scripts

The post upgrade scripts complete the upgrade from Oracle 12c to Oracle 18c

About this task

Run the following post-upgrade SQL scripts.

Procedure

  1. Log in as oracle user.
  2. Start the database with the following command:
    $ sqlplus " / as sysdba"
    SQL*Plus: Release 18.0.0.0.0 - Production on Fri Mar 22 05:32:36 2019
    Version 18.4.0.0.0
    Copyright (c) 1982, 2018, Oracle. All rights reserved.
    Connected to an idle instance.
    
    SQL> startup
    ORACLE instance started.
    
    Total System Global Area 2097148152 bytes
    Fixed Size                  8757496 bytes
    Variable Size             553648128 bytes
    Database Buffers         1241513984 bytes
    Redo Buffers              293228544 bytes
    Database mounted.
    Database opened.
    
    SQL> exit
    Disconnected from Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
    Version 18.4.0.0.0
  3. Run the catcon.pl script to start the utlrp.sql, which recompile any remaining invalid objects.
    $ cd $ORACLE_HOME/rdbms/admin
    $ $ORACLE_HOME/perl/bin/perl catcon.pl -n 1 -e -b utlrp -d '''.''' utlrp.sql
    
    catcon::set_log_file_base_path: ALL catcon-related output will be written to [/appl/oracle/product/18.0.0/db_1/rdbms/admin/utlrp_catcon_17301534.lst]
    catcon::set_log_file_base_path: catcon: See [/appl/oracle/product/18.0.0/db_1/rdbms/admin/utlrp*.log] files for output generated by scripts
    catcon::set_log_file_base_path: catcon: See [/appl/oracle/product/18.0.0/db_1/rdbms/admin/utlrp_*.lst] files for spool files, if any
    catcon.pl: completed successfully
  4. Log in to SQL*Plus and run postupgrade_fixups.sql from $ORACLE_BASE/cfgtoollogs/<SID>/preupgrade.
    Note: The default value for SID is vtdb.
    For example:
    $ cd $ORACLE_BASE/cfgtoollogs/vtdb/preupgrade
    $ sqlplus " / as sysdba"
    
    SQL*Plus: Release 18.0.0.0.0 - Production on Fri Mar 22 05:39:26 2019
    Version 18.4.0.0.0
    
    Copyright (c) 1982, 2018, Oracle.  All rights reserved.
    
    Connected to:
    Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
    Version 18.4.0.0.0
    
    SQL> @postupgrade_fixups.sql
    For example, the following output result from the @postupgrade_fixups.sql:
    ------------
    Preup                             Preupgrade
    Action                            Issue Is
    Number  Preupgrade Check Name     Remedied    Further DBA Action
    ------  ------------------------  ----------  --------------------------------
        4.  depend_usr_tables         YES         None.
        5.  old_time_zones_exist      NO          Manual fixup recommended.
        6.  post_dictionary           YES         None.
        7.  post_fixed_objects        NO          Informational only.
                                                  Further action is optional.
    ----------------
    

    See Upgrading Timezone to fix the old_time_zones_exist issue.

  5. Run the utlu122s.sql script.
    SQL> @$ORACLE_HOME/rdbms/admin/utlu122s.sql
    Oracle Database Release 18 Post-Upgrade Status Tool    03-22-2019 05:52:1
    
    Component                               Current         Full     Elapsed Time
    Name                                    Status          Version  HH:MM:SS
    
    Oracle Server                             VALID      18.4.0.0.0  00:12:50
    JServer JAVA Virtual Machine              VALID      18.4.0.0.0  00:07:03
    Oracle XDK                                VALID      18.4.0.0.0  00:01:39
    Oracle Database Java Packages             VALID      18.4.0.0.0  00:00:19
    Oracle Workspace Manager                  VALID      18.4.0.0.0  00:00:49
    Oracle Real Application Clusters     OPTION OFF      18.4.0.0.0  00:00:00
    Oracle XML Database                       VALID      18.4.0.0.0  00:01:54
    Upgrade Datapatch                                                00:01:35
    Final Actions                                                    00:04:39
    Post Upgrade                                                     00:00:19
    Post Upgrade Datapatch                                           00:00:20
    Post Compile                                                     00:02:52
    
    Total Upgrade Time: 00:33:30
    
    Database time zone version is 31. It meets current release needs.
    
    Summary Report File = /appl/oracle/product/18.0.0/db_1/cfgtoollogs/vtdb/upgrade20190322044506/upg_summary.log
    
    
    SQL> exit
    Check the utlu122s0.log file that is generated when the script is run. The log file provides the upgrade results.
  6. As virtuo user, update the ${HOME}/.profile file as follows:
    1. Update the ORACLE_HOME path in ${HOME}/.profile file as follows:
      From
      /appl/oracle/product/12.1.0.2.0/db_1
      To:
      /appl/oracle/product/18.0.0/db_1
    2. Source the .profile file to apply the changes by using the following command:
      $ source ~/.profile
    3. Open a new console and run the following command to ensure that all variables are pointing to correct ORACLE_HOME 18c:
      $ env
  7. As virtuo user, run the copy_jdbc_libs_18c script to copy the JDBC driver files.
    $ /var/install/sbin/copy_jdbc_libs_18c
    Copying database JDBC library files...
    Copying database library files...
    Done.

    Check that the JDBC files are copied

    • From:
      /appl/oracle/product/18.0.0/db_1/jlib/orai18n.jar
      To:
      /appl/virtuo/lib/tp/oraclecharsets.jar
    • From:
      /appl/oracle/product/18.0.0/db_1/jdbc/lib/ojdbc8.jar
      To:
      /appl/virtuo/lib/tp/oraclejdbc.jar