• Oracle Database 12c升级到19c(Redhat Linux12.2.0.1 Upgrade to 19.3.0.0)


    目录

    0. Check Compatibility Before Upgrading Oracle Database

    1. Environment

    2. Backup

    3. Run preupgrade script

    4. View Preupgrade log

    5. Verify tablespace sizes for upgrade

    6. Update INITIALIZATION PARAMETERS

    7. Gather DICTIONARY STATS

    8. Purge Recyclebin

    9. Refresh MVs

    10. Run preupgrade_fixups.sql

    11. Verify archive log dest size

    12. Stop LISTENER

    13. Create Flashback Guaranteed Restore Point

    14. Shutdown Database

    15. Copy init and password files from 12c to 19c dbs home

    16. Startup DB in Upgrade mode from 19c home

    17. Run dbupgrade

    18. Starup DB from 19c home

    19. Run utlrp.sql

    20. Run postupgrade_fixups.sql

    21. Upgrade Timezone

    22. Run utlusts.sql

    23. Run catuppst.sql

    24. Re-Run postupgrade_fixups.sql

    25. Reverify INVALID OBJECTS

    26. Drop Restore point

    27. Set COMPATIBALE parameter value to 19.0.0

    28. Verify DBA_REGISTRY

    29. Add TNS Entries in 19c TNS home

    30. Password File – orapwCID

    31. Edit oratab

    32. Back Up the Database


    近两天,因为系统维护的需求,我需将原来的12c数据实例升级到19c,版本号12.2.0.1>19.3.0(12.2.0.3),中间花了较多时间来折腾,不过结果不错,毕竟成功了

    我的系统环境是小红帽Redhat Linux 7.6,参照一些外文资料,具体操作如下

    0. Check Compatibility Before Upgrading Oracle Database

    需了解的Oracle数据库产品什么周期

    1. Environment

    1. Hostname : RAC1.RAJASEKHAR.COM
    2. Database Name : CID
    3. DB VERSION : 12.2.0.1
    4. CDB : NON-CDB, Single Instance
    5. DB Home Path : /u01/app/oracle/product/12.2.0/dbhome_1
    6. Datafile Location : /u01/app/oracle/oradata/CID
    7. Target DB VERSION : 19c (19.4.0.0.0)
    8. Target DB Path : /u01/app/oracle/product/19.0.0/dbhome_1
    9. Upgrade Method : Manual

    PRE-UPGRADE TASKS

    2. Backup

    Database Backup scripts - I have taken already
    
    Sample Backup Database Script: rmanbackup.sh
    
    1. [oracle@rac1 CID]$
    2. [oracle@rac1 CID]$ chmod 775 rmanbackup.sh
    3. [oracle@rac1 CID]$
    4. [oracle@rac1 CID]$ nohup ./rmanbackup.sh & <--- hit ENTER twice.
    TNS Files 
    
    1. [oracle@rac1 ~]$ cd u01/app/oracle/product/12.2.0/dbhome_1/network/admin/
    2. [oracle@rac1 admin]$ cp -p listener.ora sqlnet.ora tnsnames.ora /u01/app/backup/
    PFILE/SPFILE/PASSWORD (orapwSID) FILES 
    
    1. [oracle@rac1 dbs]$ pwd
    2. /u01/app/oracle/product/12.2.0/dbhome_1/dbs
    3. [oracle@rac1 dbs]$ cp -p spfileCID.ora orapwCID /u01/app/backup/
    INVALID OBJECTS 
    
    1. SQL> select count(*) from dba_objects where status='INVALID';
    2. COUNT(*)
    3. ----------
    4. 0 <----
    5. SQL>


    3. Run preupgrade script

    . oraenv  (CID)
    
    /u01/app/oracle/product/12.2.0/dbhome_1/jdk/bin/java -jar /u01/app/oracle/product/19.0.0/dbhome_1/rdbms/admin/preupgrade.jar TERMINAL TEXT
    
    --- OR ---
    
    /u01/app/oracle/product/12.2.0/dbhome_1/jdk/bin/java -jar /u01/app/oracle/product/19.0.0/dbhome_1/rdbms/admin/preupgrade.jar FILE DIR /home/oracle/CID/preupgrade
    1. [oracle@rac1 ~]$ mkdir -p /home/oracle/CID/preupgrade
    2. [oracle@rac1 ~]$
    3. [oracle@rac1 ~]$ . oraenv
    4. ORACLE_SID = [oracle] ? CID
    5. The Oracle base has been set to /u01/app/oracle
    6. [oracle@rac1 ~]$
    7. [oracle@rac1 ~]$ /u01/app/oracle/product/12.2.0/dbhome_1/jdk/bin/java -jar /u01/app/oracle/product/19.0.0/dbhome_1/rdbms/admin/preupgrade.jar FILE DIR /home/oracle/CID/preupgrade
    8. ==================
    9. PREUPGRADE SUMMARY
    10. ==================
    11. /home/oracle/CID/preupgrade/preupgrade.log
    12. /home/oracle/CID/preupgrade/preupgrade_fixups.sql
    13. /home/oracle/CID/preupgrade/postupgrade_fixups.sql
    Execute fixup scripts as indicated below:
    
    Before upgrade:
    
    Log into the database and execute the preupgrade fixups
    
    @/home/oracle/CID/preupgrade/preupgrade_fixups.sql
    After the upgrade:
    
    1. Log into the database and execute the postupgrade fixups
    2. @/home/oracle/CID/preupgrade/postupgrade_fixups.sql
    3. Preupgrade complete: 2020-01-28T20:45:05
    4. [oracle@rac1 ~]$

    4. View Preupgrade log

    [oracle@rac1 ~]$ cat /home/oracle/CID/preupgrade/preupgrade.log
    Report generated by Oracle Database Pre-Upgrade Information Tool Version
    19.0.0.0.0 Build: 1 on 2020-01-28T20:45:05
    
    Upgrade-To version: 19.0.0.0.0
    
    =======================================
    Status of the database prior to upgrade
    =======================================
          Database Name:  CID
         Container Name:  CID
           Container ID:  0
                Version:  12.2.0.1.0
         DB Patch Level:  No Patch Bundle applied
             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
      JServer JAVA Virtual Machine           [to be upgraded]  VALID
      Oracle XDK for Java                    [to be upgraded]  VALID
      Real Application Clusters              [to be upgraded]  OPTION OFF
      Oracle Workspace Manager               [to be upgraded]  VALID
      OLAP Analytic Workspace                [to be upgraded]  VALID
      Oracle Label Security                  [to be upgraded]  VALID
      Oracle Database Vault                  [to be upgraded]  VALID
      Oracle Text                            [to be upgraded]  VALID
      Oracle XML Database                    [to be upgraded]  VALID
      Oracle Java Packages                   [to be upgraded]  VALID
      Oracle Multimedia                      [to be upgraded]  VALID
      Oracle Spatial                         [to be upgraded]  VALID
      Oracle OLAP API                        [to be upgraded]  VALID
    
    ==============
    BEFORE UPGRADE
    ==============
    
      REQUIRED ACTIONS
      ================
      None
    
      RECOMMENDED ACTIONS
      ===================
      1.  (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.
    
      2.  (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
      ================
      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
          ----------                     ----------  -----------
          SYSAUX                             460 MB       500 MB
          SYSTEM                             800 MB       912 MB
          TEMP                                32 MB       150 MB
          UNDOTBS1                            70 MB       439 MB
    
          Minimum tablespace sizes for upgrade are estimates.
    
      4.  Ensure there is additional disk space in LOG_ARCHIVE_DEST_1 for at least
          4618 MB of archived logs.  Check alert log during the upgrade that there
          is no write error to the destination due to lack of disk space.
    
          Archiving cannot proceed if the archive log destination is full during
          upgrade.
    
          Archive Log Destination:
           Parameter    :  LOG_ARCHIVE_DEST_1
           Destination  :  /u01/app/archive/CID
    
          The database has archiving enabled.  The upgrade process will need free
          disk space in the archive log destination(s) to generate archived logs to.
    
      5.  Check the Oracle Backup and Recovery User's Guide for information on how
          to manage an RMAN recovery catalog schema.
    
          If you are using a version of the recovery catalog schema that is older
          than that required by the RMAN client version, then you must upgrade the
          catalog schema.
    
          It is good practice to have the catalog schema the same or higher version
          than the RMAN client version you are using.
    
      ORACLE GENERATED FIXUP SCRIPT
      =============================
      All of the issues in database CID
      which are identified above as BEFORE UPGRADE "(AUTOFIXUP)" can be resolved by
      executing the following
    
        SQL>@/home/oracle/CID/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 19 release
          ships with time zone file version 32.
    
          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 19 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 CID
      which are identified above as AFTER UPGRADE "(AUTOFIXUP)" can be resolved by
      executing the following
    
        SQL>@/home/oracle/CID/preupgrade/postupgrade_fixups.sql
    
    
    [oracle@rac1 ~]$
    


    5. Verify tablespace sizes for upgrade

    ** Tablespace Auto extend ON and max size also set, hence no action taken.
    
    DATABASE - Bright DBA
    
    
    1. TABLESPACE_NAME AUT FILE_NAME TOTAL_SPACE FREE_SPACE Free% MAX_SPACE
    2. ----------------- --- ------------------------------------------ ----------- ---------- ---------- ----------
    3. SYSAUX YES /u01/app/oracle/oradata/CID/sysaux01.dbf 460 23 5.08 31.9999847
    4. SYSTEM YES /u01/app/oracle/oradata/CID/system01.dbf 800 4 .48 31.9999847
    5. UNDOTBS1 YES /u01/app/oracle/oradata/CID/undotbs01.dbf 70 3 4.2 31.9999847
    6. USERS YES /u01/app/oracle/oradata/CID/users01.dbf 5 4 80 31.9999847
    7. ***************** ----------- ---------- ----------
    8. sum 1335 34 127.999939
    9. SQL>


    6. Update INITIALIZATION PARAMETERS

    In this test scenario, noting to update as per preupgrade.log. Hence no action taken.
    


    7. Gather DICTIONARY STATS

    1. SQL> SET ECHO ON;
    2. SQL> SET SERVEROUTPUT ON;
    3. SQL> EXECUTE DBMS_STATS.GATHER_DICTIONARY_STATS;
    4. PL/SQL procedure successfully completed.
    5. SQL>


    8. Purge Recyclebin

    SQL> PURGE DBA_RECYCLEBIN;
    
    DBA Recyclebin purged.
    
    SQL>
    


    9. Refresh MVs

    *** Before upgrading Oracle Database, you must wait until all materialized views have completed refreshing.
    Run the following SQL query:
    
    1. SQL> SELECT o.name FROM sys.obj$ o, sys.user$ u, sys.sum$ s WHERE o.type# = 42 AND bitand(s.mflags, 8) =8;
    2. no rows selected
    3. SQL>
    4. SQL> declare
    5. list_failures integer(3) :=0;
    6. begin
    7. DBMS_MVIEW.REFRESH_ALL_MVIEWS(list_failures,'C','', TRUE, FALSE);
    8. end;
    9. /
    10. PL/SQL procedure successfully completed.
    11. SQL>


    10. Run preupgrade_fixups.sql

    1. SQL> @/home/oracle/CID/preupgrade/preupgrade_fixups.sql
    2. SQL> REM
    3. SQL> REM Oracle PRE-Upgrade Fixup Script
    4. SQL> REM
    5. SQL> REM Auto-Generated by: Oracle Preupgrade Script
    6. SQL> REM Version: 19.0.0.0.0 Build: 1
    7. SQL> REM Generated on: 2020-01-28 20:45:02
    8. SQL> REM
    9. SQL> REM Source Database: CID
    10. SQL> REM Source Database Version: 12.2.0.1.0
    11. SQL> REM For Upgrade to Version: 19.0.0.0.0
    12. SQL> REM
    13. SQL>
    14. SQL> REM
    15. SQL> REM Setup Environment
    16. SQL> REM
    17. SQL> SET ECHO OFF SERVEROUTPUT ON FORMAT WRAPPED TAB OFF LINESIZE 200;
    18. Executing Oracle PRE-Upgrade Fixup Script
    19. Auto-Generated by: Oracle Preupgrade Script
    20. Version: 19.0.0.0.0 Build: 1
    21. Generated on: 2020-01-28 20:45:02
    22. For Source Database: CID
    23. Source Database Version: 12.2.0.1.0
    24. For Upgrade to Version: 19.0.0.0.0
    25. Preup Preupgrade
    26. Action Issue Is
    27. Number Preupgrade Check Name Remedied Further DBA Action
    28. ------ ------------------------ ---------- --------------------------------
    29. 1. dictionary_stats YES None.
    30. 2. pre_fixed_objects YES None.
    31. 3. tablespaces_info NO Informational only.
    32. Further action is optional.
    33. 4. min_archive_dest_size NO Informational only.
    34. Further action is optional.
    35. 5. rman_recovery_version NO Informational only.
    36. Further action is optional.
    37. The fixup scripts have been run and resolved what they can. However,
    38. there are still issues originally identified by the preupgrade that
    39. have not been remedied and are still present in the database.
    40. Depending on the severity of the specific issue, and the nature of
    41. the issue itself, that could mean that your database is not ready
    42. for upgrade. To resolve the outstanding issues, start by reviewing
    43. the preupgrade_fixups.sql and searching it for the name of
    44. the failed CHECK NAME or Preupgrade Action Number listed above.
    45. There you will find the original corresponding diagnostic message
    46. from the preupgrade which explains in more detail what still needs
    47. to be done.
    48. PL/SQL procedure successfully completed.
    49. SQL>


    11. Verify archive log dest size

    *** Please verify free space on ALL LOG_ARCHIVE_DEST_ locations including ALL standby destinations
    1. SQL> archive log list
    2. Database log mode Archive Mode
    3. Automatic archival Enabled
    4. Archive destination /u01/app/archive/CID
    5. Oldest online log sequence 1
    6. Next log sequence to archive 2
    7. Current log sequence 2
    8. SQL>
    9. SQL> !df -h /u01/app/archive/CID
    10. Filesystem Size Used Avail Use% Mounted on
    11. /dev/sda5 67G 35G 33G 52% /u01 <----
    12. SQL>


    12. Stop LISTENER

    1. [oracle@rac1 ~]$ ps -ef | grep tns
    2. root 15 2 0 20:01 ? 00:00:00 [netns]
    3. oracle 3943 1 0 20:08 ? 00:00:00 /u01/app/oracle/product/12.2.0/dbhome_1/bin/tnslsnr LISTENER_CID -inherit
    4. oracle 16771 3093 0 21:03 pts/1 00:00:00 grep --color=auto tns
    5. [oracle@rac1 ~]$ lsnrctl stop LISTENER_CID
    6. LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 28-JAN-2020 21:03:14
    7. Copyright (c) 1991, 2016, Oracle. All rights reserved.
    8. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=rac1.rajasekhar.com)(PORT=1524)))
    9. The command completed successfully
    10. [oracle@rac1 ~]$
    11. [oracle@rac1 ~]$ ps -ef | grep tns
    12. root 15 2 0 20:01 ? 00:00:00 [netns]
    13. oracle 16812 3093 0 21:03 pts/1 00:00:00 grep --color=auto tns
    14. [oracle@rac1 ~]$


    13. Create Flashback Guaranteed Restore Point

    *** NO need to enable Flashback Database from 11.2.0.1 onwards
    *** Database MUST be in Archive Log mode
    *** MUST NOT change the compatible parameter to higher version
    1. SQL> select flashback_on from v$database;
    2. FLASHBACK_ON
    3. ------------------
    4. NO <-----
    5. SQL> select name,open_mode,log_mode from v$database;
    6. NAME OPEN_MODE LOG_MODE
    7. --------- -------------------- ------------
    8. CID READ WRITE ARCHIVELOG
    9. SQL> show parameter compatible
    10. NAME TYPE VALUE
    11. ------------------------------------ ----------- ------------------------------
    12. compatible string 12.2.0 <----
    13. noncdb_compatible boolean FALSE
    14. SQL>
    15. SQL> show parameter recovery
    16. NAME TYPE VALUE
    17. ------------------------------------ ----------- ------------------------------
    18. db_recovery_file_dest string
    19. db_recovery_file_dest_size big integer 0
    20. recovery_parallelism integer 0
    21. remote_recovery_file_dest string
    22. SQL>
    23. SQL>!mkdir -p /u01/app/oracle/fast_recovery_area
    24. SQL> alter system set db_recovery_file_dest_size=10G;
    25. System altered.
    26. SQL> alter system set db_recovery_file_dest='/u01/app/oracle/fast_recovery_area';
    27. System altered.
    28. SQL> show parameter recovery
    29. NAME TYPE VALUE
    30. ------------------------------------ ----------- ------------------------------
    31. db_recovery_file_dest string /u01/app/oracle/fast_recovery_area
    32. db_recovery_file_dest_size big integer 10G
    33. recovery_parallelism integer 0
    34. remote_recovery_file_dest string
    35. SQL>
    36. SQL> select * from V$restore_point;
    37. no rows selected
    38. SQL>
    39. SQL> create restore point pre_upgrade guarantee flashback database;
    40. Restore point created.
    41. SQL>
    42. SQL> col name for a20
    43. col GUARANTEE_FLASHBACK_DATABASE for a10
    44. col TIME for a60
    45. set lines 190
    46. select NAME,GUARANTEE_FLASHBACK_DATABASE,TIME from V$restore_point;
    47. NAME GUARANTEE_ TIME
    48. -------------------- ---------- ------------------------------------------------------------
    49. PRE_UPGRADE YES 28-JAN-20 09.05.50.000000000 PM
    50. SQL>

    UPGRADE TASK

    14. Shutdown Database

    1. SQL> SELECT NAME,OPEN_MODE FROM V$DATABASE;
    2. NAME OPEN_MODE
    3. -------------------- --------------------
    4. CID READ WRITE
    5. SQL> SHUT IMMEDIATE;
    6. Database closed.
    7. Database dismounted.
    8. ORACLE instance shut down.
    9. SQL>

    15. Copy init and password files from 12c to 19c dbs home

    1. [oracle@rac1 ~]$ cd /u01/app/oracle/product/12.2.0/dbhome_1/dbs
    2. [oracle@rac1 dbs]$ ls -ltr *CID*
    3. -rw-r-----. 1 oracle oinstall 24 Jan 28 20:08 lkCID
    4. -rw-r-----. 1 oracle oinstall 3584 Jan 28 20:11 orapwCID <---
    5. -rw-r-----. 1 oracle oinstall 3584 Jan 28 21:05 spfileCID.ora <---
    6. -rw-rw----. 1 oracle oinstall 1544 Jan 28 21:07 hc_CID.dat
    7. [oracle@rac1 dbs]$
    8. [oracle@rac1 dbs]$ cp orapwCID spfileCID.ora /u01/app/oracle/product/19.0.0/dbhome_1/dbs/
    9. [oracle@rac1 dbs]$
    10. [oracle@rac1 dbs]$ ls -ltr /u01/app/oracle/product/19.0.0/dbhome_1/dbs/*CID*
    11. -rw-r-----. 1 oracle oinstall 3584 Jan 28 21:10 /u01/app/oracle/product/19.0.0/dbhome_1/dbs/spfileCID.ora
    12. -rw-r-----. 1 oracle oinstall 3584 Jan 28 21:10 /u01/app/oracle/product/19.0.0/dbhome_1/dbs/orapwCID
    13. [oracle@rac1 dbs]$

    16. Startup DB in Upgrade mode from 19c home

    1. [oracle@rac1 ~]$ export ORACLE_HOME=/u01/app/oracle/product/19.0.0/dbhome_1
    2. [oracle@rac1 ~]$ export ORACLE_SID=CID
    3. [oracle@rac1 ~]$ PATH=/u01/app/oracle/product/19.0.0/dbhome_1/bin:$PATH; export PATH
    4. [oracle@rac1 ~]$ which sqlplus
    5. /u01/app/oracle/product/19.0.0/dbhome_1/bin/sqlplus
    6. [oracle@rac1 ~]$ sqlplus / as sysdba
    7. SQL*Plus: Release 19.0.0.0.0 - Production on Tue Jan 28 21:13:24 2020
    8. Version 19.4.0.0.0
    9. Copyright (c) 1982, 2019, Oracle. All rights reserved.
    10. Connected to an idle instance.
    11. SQL> startup upgrade;
    12. ORACLE instance started.
    13. Total System Global Area 1560277408 bytes
    14. Fixed Size 8896928 bytes
    15. Variable Size 939524096 bytes
    16. Database Buffers 603979776 bytes
    17. Redo Buffers 7876608 bytes
    18. Database mounted.
    19. Database opened.
    20. SQL>
    21. SQL> select name,open_mode,cdb,version,status from v$database,v$instance;
    22. NAME OPEN_MODE CDB VERSION STATUS
    23. --------- -------------------- --- ----------------- ------------
    24. CID READ WRITE NO 19.0.0.0.0 OPEN MIGRATE <---
    25. SQL>

    17. Run dbupgrade

    You can run the upgrade using either of the following commands. The second is actually just a shorthand for the former.
    
    # Regular upgrade command
    
    1. [oracle@rac1 ~]$ mkdir -p /home/oracle/whileupgrade
    2. [oracle@rac1 ~]$ cd /u01/app/oracle/product/19.0.0/dbhome_1/rdbms/admin
    3. [oracle@rac1 ~]$ nohup /u01/app/oracle/product/19.0.0/dbhome_1/perl/bin/perl catctl.pl -l /home/oracle/whileupgrade -n 4 catupgrd.sql &
    --- OR ---
    
    # Shorthand command
    
    1. [oracle@rac1 ~]$ cd /u01/app/oracle/product/19.0.0/dbhome_1/bin/
    2. [oracle@rac1 bin]$ ls -ltr dbupgrade
    3. -rwxr-x---. 1 oracle oinstall 3136 Apr 17 2019 dbupgrade
    4. [oracle@rac1 bin]$
    5. [oracle@rac1 bin]$ nohup ./dbupgrade & <--- Hit ENTER twice
    6. [1] 22584
    7. [oracle@rac1 bin]$ nohup: ignoring input and appending output to ânohup.outâ
    8. [oracle@rac1 bin]$ jobs -l
    9. [1]+ 22584 Running nohup ./dbupgrade & <----
    10. [oracle@rac1 bin]$
    11. [oracle@rac1 bin]$ disown
    12. [oracle@rac1 bin]$
    13. [oracle@rac1 bin]$ ps -ef | grep -i catctl.pl
    14. oracle 22589 22584 0 21:33 pts/1 00:00:03 /u01/app/oracle/product/19.0.0/dbhome_1/perl/bin/perl -I/u01/app/oracle/product/19.0.0/dbhome_1/perl/lib /u01/app/oracle/product/19.0.0/dbhome_1/rdbms/admin/catctl.pl /u01/app/oracle/product/19.0.0/dbhome_1/rdbms/admin/catupgrd.sql
    15. oracle 24991 3093 0 21:40 pts/1 00:00:00 grep --color=auto -i catctl.pl
    16. [oracle@rac1 bin]$
    Monitor upgrade log under below location

    18. Starup DB from 19c home

    1. [oracle@rac1 ~]$ export ORACLE_HOME=/u01/app/oracle/product/19.0.0/dbhome_1
    2. [oracle@rac1 ~]$ export ORACLE_SID=CID
    3. [oracle@rac1 ~]$ PATH=/u01/app/oracle/product/19.0.0/dbhome_1/bin:$PATH; export PATH
    4. [oracle@rac1 ~]$ which sqlplus
    5. /u01/app/oracle/product/19.0.0/dbhome_1/bin/sqlplus
    6. [oracle@rac1 ~]$ sqlplus / as sysdba
    7. SQL*Plus: Release 19.0.0.0.0 - Production on Tue Jan 28 22:25:18 2020
    8. Version 19.4.0.0.0
    9. Copyright (c) 1982, 2019, Oracle. All rights reserved.
    10. Connected to an idle instance.
    11. SQL> startup;
    12. ORACLE instance started.
    13. Total System Global Area 1560277408 bytes
    14. Fixed Size 8896928 bytes
    15. Variable Size 1174405120 bytes
    16. Database Buffers 369098752 bytes
    17. Redo Buffers 7876608 bytes
    18. Database mounted.
    19. Database opened.
    20. SQL> select name,open_mode,cdb,version,status from v$database,v$instance;
    21. NAME OPEN_MODE CDB VERSION STATUS
    22. --------- -------------------- --- ----------------- ------------
    23. CID READ WRITE NO 19.0.0.0.0 OPEN <-----
    24. SQL>
    25. SQL> col COMP_ID for a10
    26. col COMP_NAME for a40
    27. col VERSION for a15
    28. set lines 180
    29. set pages 999
    30. select COMP_ID,COMP_NAME,VERSION,STATUS from dba_registry;
    31. COMP_ID COMP_NAME VERSION STATUS
    32. ---------- ---------------------------------------- --------------- --------------------------------------------
    33. CATALOG Oracle Database Catalog Views 19.0.0.0.0 UPGRADED
    34. CATPROC Oracle Database Packages and Types 19.0.0.0.0 UPGRADED
    35. JAVAVM JServer JAVA Virtual Machine 19.0.0.0.0 UPGRADED
    36. XML Oracle XDK 19.0.0.0.0 UPGRADED
    37. CATJAVA Oracle Database Java Packages 19.0.0.0.0 UPGRADED
    38. APS OLAP Analytic Workspace 19.0.0.0.0 UPGRADED
    39. RAC Oracle Real Application Clusters 19.0.0.0.0 UPGRADED
    40. XDB Oracle XML Database 19.0.0.0.0 UPGRADED
    41. OWM Oracle Workspace Manager 19.0.0.0.0 UPGRADED
    42. CONTEXT Oracle Text 19.0.0.0.0 UPGRADED
    43. ORDIM Oracle Multimedia 19.0.0.0.0 UPGRADED
    44. SDO Spatial 19.0.0.0.0 LOADING
    45. XOQ Oracle OLAP API 19.0.0.0.0 UPGRADED
    46. OLS Oracle Label Security 19.0.0.0.0 UPGRADED
    47. DV Oracle Database Vault 19.0.0.0.0 UPGRADED
    48. 15 rows selected.
    49. SQL>

    POST-UPGRADE TASKS WHEN DBUA USING

    19. Run utlrp.sql

    Run catcon.pl to start utlrp.sql, and to recompile any remaining invalid objects.
    
    $ORACLE_HOME/perl/bin/perl catcon.pl -n 1 -e -b utlrp -d '''.''' utlrp.sql
    
    -- OR ---

    20. Run postupgrade_fixups.sql

    1. SQL> @/home/oracle/CID/preupgrade/postupgrade_fixups.sql
    2. Session altered.
    3. PL/SQL procedure successfully completed.
    4. PL/SQL procedure successfully completed.
    5. PL/SQL procedure successfully completed.
    6. Package created.
    7. No errors.
    8. Package body created.
    9. PL/SQL procedure successfully completed.
    10. No errors.
    11. Package created.
    12. No errors.
    13. Package body created.
    14. No errors.
    15. Executing Oracle POST-Upgrade Fixup Script
    16. Auto-Generated by: Oracle Preupgrade Script
    17. Version: 19.0.0.0.0 Build: 1
    18. Generated on: 2020-01-28 20:45:05
    19. For Source Database: CID
    20. Source Database Version: 12.2.0.1.0
    21. For Upgrade to Version: 19.0.0.0.0
    22. Preup Preupgrade
    23. Action Issue Is
    24. Number Preupgrade Check Name Remedied Further DBA Action
    25. ------ ------------------------ ---------- --------------------------------
    26. 6. old_time_zones_exist NO Manual fixup recommended.
    27. 7. post_dictionary YES None.
    28. 8. post_fixed_objects NO Informational only.
    29. Further action is optional.
    30. The fixup scripts have been run and resolved what they can. However,
    31. there are still issues originally identified by the preupgrade that
    32. have not been remedied and are still present in the database.
    33. Depending on the severity of the specific issue, and the nature of
    34. the issue itself, that could mean that your database upgrade is not
    35. fully complete. To resolve the outstanding issues, start by reviewing
    36. the postupgrade_fixups.sql and searching it for the name of
    37. the failed CHECK NAME or Preupgrade Action Number listed above.
    38. There you will find the original corresponding diagnostic message
    39. from the preupgrade which explains in more detail what still needs
    40. to be done.
    41. PL/SQL procedure successfully completed.
    42. Session altered.
    43. SQL>

    21. Upgrade Timezone

    For releases (18c, 19c), the timezone upgrade scripts are included in the target ORACLE_HOME under rdbms/admin directory
    
    The following scripts get delivered with Oracle Database 18c onward
    
        $ORACLE_HOME/rdbms/admin/utltz_countstats.sql
        Script to gives how much TIMESTAMP WITH TIME ZONE data there is in a database using stats info. No restart required.
        
        $ORACLE_HOME/rdbms/admin/utltz_countstar.sql
        Script to approximate how much TIMESTAMP WITH TIME ZONE data there is in a database using a COUNT(*) for each table that has a TSTZ column. This script is useful when using DBMS_DST package or the scripts of utlz_upg_check.sql and utlz_upg_apply.sql scripts.
        
        $ORACLE_HOME/rdbms/admin/utltz_upg_check.sql
        Time zone upgrade check script
        
        $ORACLE_HOME/rdbms/admin/utltz_upg_apply.sql
        Time zone apply script. Warning: This script will restart the database and adjust time zone data.
    
    1. [oracle@rac1 ~]$ cd /u01/app/oracle/product/19.0.0/dbhome_1/rdbms/admin/
    2. [oracle@rac1 admin]$ ls -ltr utltz_countstats.sql utltz_countstar.sql utltz_upg_check.sql utltz_upg_apply.sql
    3. -rw-r--r--. 1 oracle oinstall 8317 Feb 25 2017 utltz_countstats.sql
    4. -rw-r--r--. 1 oracle oinstall 7423 Feb 25 2017 utltz_countstar.sql
    5. -rw-r--r--. 1 oracle oinstall 33684 Sep 9 2017 utltz_upg_check.sql
    6. -rw-r--r--. 1 oracle oinstall 21526 Sep 9 2017 utltz_upg_apply.sql
    7. [oracle@rac1 admin]$
    8. SQL> SELECT version FROM v$timezone_file;
    9. VERSION
    10. ----------
    11. 26 <-----
    12. SQL>
    13. SQL> @/u01/app/oracle/product/19.0.0/dbhome_1/rdbms/admin/utltz_upg_check.sql
    14. Session altered.
    15. INFO: Starting with RDBMS DST update preparation.
    16. INFO: NO actual RDBMS DST update will be done by this script.
    17. INFO: If an ERROR occurs the script will EXIT sqlplus.
    18. INFO: Doing checks for known issues ...
    19. INFO: Database version is 19.0.0.0 .
    20. INFO: Database RDBMS DST version is DSTv26 .
    21. INFO: No known issues detected.
    22. INFO: Now detecting new RDBMS DST version.
    23. A prepare window has been successfully started.
    24. INFO: Newest RDBMS DST version detected is DSTv32 .
    25. INFO: Next step is checking all TSTZ data.
    26. INFO: It might take a while before any further output is seen ...
    27. A prepare window has been successfully ended.
    28. INFO: A newer RDBMS DST version than the one currently used is found.
    29. INFO: Note that NO DST update was yet done.
    30. INFO: Now run utltz_upg_apply.sql to do the actual RDBMS DST update.
    31. INFO: Note that the utltz_upg_apply.sql script will
    32. INFO: restart the database 2 times WITHOUT any confirmation or prompt.
    33. Session altered.
    34. SQL>
    35. SQL> @/u01/app/oracle/product/19.0.0/dbhome_1/rdbms/admin/utltz_upg_apply.sql
    36. Session altered.
    37. INFO: If an ERROR occurs, the script will EXIT SQL*Plus.
    38. INFO: The database RDBMS DST version will be updated to DSTv32 .
    39. WARNING: This script will restart the database 2 times
    40. WARNING: WITHOUT asking ANY confirmation.
    41. WARNING: Hit control-c NOW if this is not intended.
    42. INFO: Restarting the database in UPGRADE mode to start the DST upgrade.
    43. Database closed.
    44. Database dismounted.
    45. ORACLE instance shut down.
    46. ORACLE instance started.
    47. Total System Global Area 1560277408 bytes
    48. Fixed Size 8896928 bytes
    49. Variable Size 1191182336 bytes
    50. Database Buffers 352321536 bytes
    51. Redo Buffers 7876608 bytes
    52. Database mounted.
    53. Database opened.
    54. INFO: Starting the RDBMS DST upgrade.
    55. INFO: Upgrading all SYS owned TSTZ data.
    56. INFO: It might take time before any further output is seen ...
    57. An upgrade window has been successfully started.
    58. INFO: Restarting the database in NORMAL mode to upgrade non-SYS TSTZ data.
    59. Database closed.
    60. Database dismounted.
    61. ORACLE instance shut down.
    62. ORACLE instance started.
    63. Total System Global Area 1560277408 bytes
    64. Fixed Size 8896928 bytes
    65. Variable Size 1191182336 bytes
    66. Database Buffers 352321536 bytes
    67. Redo Buffers 7876608 bytes
    68. Database mounted.
    69. Database opened.
    70. INFO: Upgrading all non-SYS TSTZ data.
    71. INFO: It might take time before any further output is seen ...
    72. INFO: Do NOT start any application yet that uses TSTZ data!
    73. INFO: Next is a list of all upgraded tables:
    74. Table list: "GSMADMIN_INTERNAL"."AQ$_CHANGE_LOG_QUEUE_TABLE_S"
    75. Number of failures: 0
    76. Table list: "GSMADMIN_INTERNAL"."AQ$_CHANGE_LOG_QUEUE_TABLE_L"
    77. Number of failures: 0
    78. Table list: "MDSYS"."SDO_DIAG_MESSAGES_TABLE"
    79. Number of failures: 0
    80. Table list: "DVSYS"."SIMULATION_LOG$"
    81. Number of failures: 0
    82. Table list: "DVSYS"."AUDIT_TRAIL$"
    83. Number of failures: 0
    84. INFO: Total failures during update of TSTZ data: 0 .
    85. An upgrade window has been successfully ended.
    86. INFO: Your new Server RDBMS DST version is DSTv32 .
    87. INFO: The RDBMS DST update is successfully finished.
    88. INFO: Make sure to exit this SQL*Plus session.
    89. INFO: Do not use it for timezone related selects.
    90. Session altered.
    91. SQL>
    92. SQL> SELECT version FROM v$timezone_file;
    93. VERSION
    94. ----------
    95. 32 <----
    96. 1 row selected.
    97. SQL>


    22. Run utlusts.sql

    *** Note: utluNNNs.sql is replaced by utlusts.sql in 19c version 
    *** Note: In 19c Earlier version utluNNNs.sql is replaced by utlusts.sql
    *** Run utlusts.sql as many times as you want, at any time after the upgrade is completed. 
    *** utlusts.sql reads the view called dba_registry_log and displays the upgrade results for the database components.
    
    1. SQL> @/u01/app/oracle/product/19.0.0/dbhome_1/rdbms/admin/utlusts.sql TEXT
    2. Oracle Database Release 19 Post-Upgrade Status Tool 01-29-2020 01:41:3
    3. Database Name: CID
    4. Component Current Full Elapsed Time
    5. Name Status Version HH:MM:SS
    6. Oracle Server VALID 19.4.0.0.0 00:18:01
    7. JServer JAVA Virtual Machine VALID 19.4.0.0.0 00:02:29
    8. Oracle XDK VALID 19.4.0.0.0 00:01:12
    9. Oracle Database Java Packages VALID 19.4.0.0.0 00:00:13
    10. OLAP Analytic Workspace VALID 19.4.0.0.0 00:00:19
    11. Oracle Label Security VALID 19.4.0.0.0 00:00:11
    12. Oracle Database Vault VALID 19.4.0.0.0 00:00:32
    13. Oracle Text VALID 19.4.0.0.0 00:00:43
    14. Oracle Workspace Manager VALID 19.4.0.0.0 00:00:37
    15. Oracle Real Application Clusters OPTION OFF 19.4.0.0.0 00:00:01
    16. Oracle XML Database VALID 19.4.0.0.0 00:01:49
    17. Oracle Multimedia VALID 19.4.0.0.0 00:00:55
    18. Spatial VALID 19.4.0.0.0 00:07:19
    19. Oracle OLAP API VALID 19.4.0.0.0 00:00:14
    20. Datapatch 00:08:34
    21. Final Actions 00:08:43
    22. Post Upgrade 00:00:12
    23. Post Compile 00:04:58
    24. Total Upgrade Time: 00:49:07
    25. Database time zone version is 32. It meets current release needs.
    26. SQL>


    23. Run catuppst.sql

    /*
    In 12c:
    Oracle Database Upgrade Utilities
    You must run this script, either through DBUA or manually, if you perform a manual upgrade.
    
    DBUA automatically runs catuppst.sql. You only must run this script separately for manual upgrades.
    
    Do not run this in UPGRADE mode. Run catuppst.sql, located in the ORACLE_HOME/rdbms/admin directory, to perform remaining upgrade actions that do not require the database to be in UPGRADE mode. If an Oracle bundle patch or patch set update (PSU or BP) is installed in the Oracle home, then this script automatically applies that patch set update to the database.
    
    Caution: If you perform a manual upgrade, and you do not run catuppst.sql, then your database suffers performance degradation over time.
    */
    *** Actually it will run as part of upgrade. We have reviewed catupgrd0.log and below is the output... found catuppst.sql ran and don't see errors.
    /*
    
    1. Rem catuppst.sql
    2. Rem
    3. Rem Copyright (c) 2006, 2018, Oracle and/or its affiliates.
    4. Rem All rights reserved.
    5. Rem
    6. Rem NAME
    7. Rem catuppst.sql - CATalog UPgrade PoST-upgrade actions
    8. Rem
    9. Rem DESCRIPTION
    10. Rem This post-upgrade script performs remaining upgrade actions that
    11. Rem do not require that the database be open in UPGRADE mode.
    12. Rem Automatically apply the latest PSU.
    13. Rem
    14. Rem NOTES
    15. Rem You must be connected AS SYSDBA to run this script.
    16. ..
    17. ..
    18. 22:19:59 SQL> -- DBUA_TIMESTAMP: catuppst.sql finished
    19. 22:19:59 SQL> SELECT dbms_registry_sys.time_stamp('CATUPPST') as timestamp from dual;
    20. TIMESTAMP
    21. --------------------------------------------------------------------------------
    22. COMP_TIMESTAMP CATUPPST 2020-01-28 22:19:59
    23. DBUA_TIMESTAMP CATUPPST FINISHED 2020-01-28 22:19:59
    24. DBUA_TIMESTAMP CATUPPST NONE 2020-01-28 22:19:59
    */
    *** If we had no errors, the "catuppst.sql" script would have been run as part of the upgrade. we need to run it manually if did have errors.
    *** However can run one more time make sure no errors during execution.
    
    1. SQL> @/u01/app/oracle/product/19.0.0/dbhome_1/rdbms/admin/catuppst.sql
    2. TIMESTAMP
    3. --------------------------------------------------------------------------------
    4. COMP_TIMESTAMP DBRESTART 2020-01-29 02:24:23
    5. DBUA_TIMESTAMP DBRESTART FINISHED 2020-01-29 02:24:23
    6. DBUA_TIMESTAMP DBRESTART NONE 2020-01-29 02:24:23
    7. TIMESTAMP
    8. --------------------------------------------------------------------------------
    9. DBUA_TIMESTAMP CATUPPST STARTED 2020-01-29 02:24:23
    10. TIMESTAMP
    11. --------------------------------------------------------------------------------
    12. COMP_TIMESTAMP POSTUP_BGN 2020-01-29 02:24:23
    13. DBUA_TIMESTAMP POSTUP_BGN FINISHED 2020-01-29 02:24:23
    14. DBUA_TIMESTAMP POSTUP_BGN NONE 2020-01-29 02:24:23
    15. TIMESTAMP
    16. --------------------------------------------------------------------------------
    17. COMP_TIMESTAMP CATREQ_BGN 2020-01-29 02:24:23
    18. DBUA_TIMESTAMP CATREQ_BGN FINISHED 2020-01-29 02:24:23
    19. DBUA_TIMESTAMP CATREQ_BGN NONE 2020-01-29 02:24:23
    20. catrequtlmg: b_StatEvt = TRUE
    21. catrequtlmg: b_SelProps = FALSE
    22. catrequtlmg: b_UpgradeMode = FALSE
    23. catrequtlmg: b_InUtlMig = FALSE
    24. TIMESTAMP
    25. --------------------------------------------------------------------------------
    26. COMP_TIMESTAMP CATREQ_END 2020-01-29 02:24:23
    27. DBUA_TIMESTAMP CATREQ_END FINISHED 2020-01-29 02:24:23
    28. DBUA_TIMESTAMP CATREQ_END NONE 2020-01-29 02:24:23
    29. catuppst: Dropping library DBMS_DDL_INTERNAL_LIB
    30. catuppst: Dropping view _CURRENT_EDITION_OBJ_MIG
    31. catuppst: Dropping view _ACTUAL_EDITION_OBJ_MIG
    32. catuppst: Dropping view DBA_PART_KEY_COLUMNS_V$_MIG
    33. catuppst: Dropping view DBA_SUBPART_KEY_COLUMNS_V$_MIG
    34. catuppst: Dropping table OBJ$MIG
    35. catuppst: Dropping table USER$MIG
    36. catuppst: Dropping table COL$MIG
    37. catuppst: Dropping table CLU$MIG
    38. catuppst: Dropping table CON$MIG
    39. catuppst: Dropping table BOOTSTRAP$MIG
    40. catuppst: Dropping table TAB$MIG
    41. catuppst: Dropping table TS$MIG
    42. catuppst: Dropping table IND$MIG
    43. catuppst: Dropping table ICOL$MIG
    44. catuppst: Dropping table LOB$MIG
    45. catuppst: Dropping table COLTYPE$MIG
    46. catuppst: Dropping table SUBCOLTYPE$MIG
    47. catuppst: Dropping table NTAB$MIG
    48. catuppst: Dropping table REFCON$MIG
    49. catuppst: Dropping table OPQTYPE$MIG
    50. catuppst: Dropping table ICOLDEP$MIG
    51. catuppst: Dropping table VIEWTRCOL$MIG
    52. catuppst: Dropping table ATTRCOL$MIG
    53. catuppst: Dropping table TYPE_MISC$MIG
    54. catuppst: Dropping table LIBRARY$MIG
    55. catuppst: Dropping table ASSEMBLY$MIG
    56. catuppst: Dropping table TSQ$MIG
    57. catuppst: Dropping table FET$MIG
    58. TIMESTAMP
    59. --------------------------------------------------------------------------------
    60. COMP_TIMESTAMP POSTUP_END 2020-01-29 02:24:24
    61. DBUA_TIMESTAMP POSTUP_END FINISHED 2020-01-29 02:24:24
    62. DBUA_TIMESTAMP POSTUP_END NONE 2020-01-29 02:24:24
    63. TIMESTAMP
    64. --------------------------------------------------------------------------------
    65. COMP_TIMESTAMP CATUPPST 2020-01-29 02:24:24
    66. DBUA_TIMESTAMP CATUPPST FINISHED 2020-01-29 02:24:24
    67. DBUA_TIMESTAMP CATUPPST NONE 2020-01-29 02:24:24
    68. SQL>

    24. Re-Run postupgrade_fixups.sql

    1. SQL> @/home/oracle/CID/preupgrade/postupgrade_fixups.sql
    2. No errors.
    3. No errors.
    4. No errors.
    5. No errors.
    6. Executing Oracle POST-Upgrade Fixup Script
    7. Auto-Generated by: Oracle Preupgrade Script
    8. Version: 19.0.0.0.0 Build: 1
    9. Generated on: 2020-01-28 20:45:05
    10. For Source Database: CID
    11. Source Database Version: 12.2.0.1.0
    12. For Upgrade to Version: 19.0.0.0.0
    13. Preup Preupgrade
    14. Action Issue Is
    15. Number Preupgrade Check Name Remedied Further DBA Action
    16. ------ ------------------------ ---------- --------------------------------
    17. 6. old_time_zones_exist YES None.
    18. 7. post_dictionary YES None.
    19. 8. post_fixed_objects NO Informational only.
    20. Further action is optional.
    21. The fixup scripts have been run and resolved what they can. However,
    22. there are still issues originally identified by the preupgrade that
    23. have not been remedied and are still present in the database.
    24. Depending on the severity of the specific issue, and the nature of
    25. the issue itself, that could mean that your database upgrade is not
    26. fully complete. To resolve the outstanding issues, start by reviewing
    27. the postupgrade_fixups.sql and searching it for the name of
    28. the failed CHECK NAME or Preupgrade Action Number listed above.
    29. There you will find the original corresponding diagnostic message
    30. from the preupgrade which explains in more detail what still needs
    31. to be done.
    32. SQL>

    25. Reverify INVALID OBJECTS

    1. SQL> select count(*) from dba_objects where status='INVALID';
    2. COUNT(*)
    3. ----------
    4. 0 <-----
    5. SQL>

    26. Drop Restore point

    1. SQL> col name for a20
    2. col GUARANTEE_FLASHBACK_DATABASE for a10
    3. col TIME for a60
    4. set lines 190
    5. select NAME,GUARANTEE_FLASHBACK_DATABASE,TIME from V$restore_point;
    6. NAME GUARANTEE_ TIME
    7. -------------------- ---------- ------------------------------------------------------------
    8. PRE_UPGRADE YES 28-JAN-20 09.05.50.000000000 PM
    9. SQL>
    10. SQL> !ls -ltr /u01/app/oracle/fast_recovery_area/CID/flashback
    11. total 1433680
    12. -rw-r-----. 1 oracle oinstall 209723392 Jan 28 21:39 o1_mf_h30dfg5q_.flb
    13. -rw-r-----. 1 oracle oinstall 209723392 Jan 28 21:52 o1_mf_h30dfkos_.flb
    14. -rw-r-----. 1 oracle oinstall 209723392 Jan 28 21:56 o1_mf_h30gdpcm_.flb
    15. -rw-r-----. 1 oracle oinstall 209723392 Jan 28 22:12 o1_mf_h30h4zjr_.flb
    16. -rw-r-----. 1 oracle oinstall 209723392 Jan 28 22:15 o1_mf_h30hdtcw_.flb
    17. -rw-r-----. 1 oracle oinstall 209723392 Jan 28 22:15 o1_mf_h30jhoxw_.flb
    18. -rw-r-----. 1 oracle oinstall 209723392 Jan 29 02:35 o1_mf_h30jc0ct_.flb
    19. SQL>
    20. SQL> drop restore point PRE_UPGRADE;
    21. Restore point dropped.
    22. SQL> select NAME,GUARANTEE_FLASHBACK_DATABASE,TIME from V$restore_point;
    23. no rows selected
    24. SQL>
    25. SQL> !ls -ltr /u01/app/oracle/fast_recovery_area/CID/flashback
    26. total 0 <---
    27. SQL>

    27. Set COMPATIBALE parameter value to 19.0.0

    Warning: If the value of COMPATIBLE parameter is changed to 19.0.0 then if for some reasons database needs to be downgraded to 12.2.0.1 the DBA would not have any option other than export/import to downgrade the database. But if this parameter is left unchanged for sometime to see how the database performs after upgrade then it is very easy and fast to downgrade the database if for some reason it is required to be downgraded.

    If you change COMPATIBLE you can directly drop your restore points as they are useless. You can’t use Flashback Database to restore point back across a compatibility change of your database.

    1. SQL> show parameter COMPATIBLE
    2. NAME TYPE VALUE
    3. ------------------------------------ ----------- ------------------------------
    4. compatible string 12.2.0
    5. noncdb_compatible boolean FALSE
    6. SQL>
    7. SQL> ALTER SYSTEM SET COMPATIBLE = '19.0.0' SCOPE=SPFILE;
    8. System altered.
    9. SQL> shut immediate;
    10. Database closed.
    11. Database dismounted.
    12. ORACLE instance shut down.
    13. SQL>
    14. SQL> startup;
    15. ORACLE instance started.
    16. Total System Global Area 1560277408 bytes
    17. Fixed Size 8896928 bytes
    18. Variable Size 1191182336 bytes
    19. Database Buffers 352321536 bytes
    20. Redo Buffers 7876608 bytes
    21. Database mounted.
    22. Database opened.
    23. SQL>
    24. SQL> show parameter COMPATIBLE
    25. NAME TYPE VALUE
    26. ------------------------------------ ----------- ------------------------------
    27. compatible string 19.0.0 <----
    28. noncdb_compatible boolean FALSE
    29. SQL>

    28. Verify DBA_REGISTRY

    1. SQL> col COMP_ID for a10
    2. col COMP_NAME for a40
    3. col VERSION for a15
    4. set lines 180
    5. set pages 999
    6. select COMP_ID,COMP_NAME,VERSION,STATUS from dba_registry;
    7. COMP_ID COMP_NAME VERSION STATUS
    8. ---------- ---------------------------------------- --------------- --------------------------------------------
    9. CATALOG Oracle Database Catalog Views 19.0.0.0.0 VALID
    10. CATPROC Oracle Database Packages and Types 19.0.0.0.0 VALID
    11. JAVAVM JServer JAVA Virtual Machine 19.0.0.0.0 VALID
    12. XML Oracle XDK 19.0.0.0.0 VALID
    13. CATJAVA Oracle Database Java Packages 19.0.0.0.0 VALID
    14. APS OLAP Analytic Workspace 19.0.0.0.0 VALID
    15. RAC Oracle Real Application Clusters 19.0.0.0.0 OPTION OFF
    16. XDB Oracle XML Database 19.0.0.0.0 VALID
    17. OWM Oracle Workspace Manager 19.0.0.0.0 VALID
    18. CONTEXT Oracle Text 19.0.0.0.0 VALID
    19. ORDIM Oracle Multimedia 19.0.0.0.0 VALID
    20. SDO Spatial 19.0.0.0.0 VALID
    21. XOQ Oracle OLAP API 19.0.0.0.0 VALID
    22. OLS Oracle Label Security 19.0.0.0.0 VALID
    23. DV Oracle Database Vault 19.0.0.0.0 VALID
    24. 15 rows selected.
    25. SQL>

    29. Add TNS Entries in 19c TNS home

    1. [oracle@rac1 admin]$ cat listener.ora
    2. # listener.ora Network Configuration File: /u01/app/oracle/product/19.0.0/dbhome_1/network/admin/listener.ora
    3. # Generated by Oracle configuration tools.
    4. LISTENER_CID =
    5. (DESCRIPTION_LIST =
    6. (DESCRIPTION =
    7. (ADDRESS = (PROTOCOL = TCP)(HOST = rac1.rajasekhar.com)(PORT = 1524))
    8. )
    9. )
    10. SID_LIST_LISTENER_CID =
    11. (SID_LIST =
    12. (SID_DESC =
    13. (GLOBAL_DBNAME = CID.rajasekhar.com)
    14. (ORACLE_HOME = /u01/app/oracle/product/19.0.0/dbhome_1)
    15. (SID_NAME = CID)
    16. )
    17. )
    18. [oracle@rac1 admin]$
    19. [oracle@rac1 admin]$ cat tnsnames.ora
    20. # tnsnames.ora Network Configuration File: /u01/app/oracle/product/19.0.0/dbhome_1/network/admin/tnsnames.ora
    21. # Generated by Oracle configuration tools.
    22. LISTENER_CID =
    23. (ADDRESS = (PROTOCOL = TCP)(HOST = rac1.rajasekhar.com)(PORT = 1524))
    24. CID =
    25. (DESCRIPTION =
    26. (ADDRESS = (PROTOCOL = TCP)(HOST = rac1.rajasekhar.com)(PORT = 1524))
    27. (CONNECT_DATA =
    28. (SERVER = DEDICATED)
    29. (SERVICE_NAME = CID.rajasekhar.com)
    30. )
    31. )
    32. [oracle@rac1 admin]$
    33. [oracle@rac1 admin]$ cat sqlnet.ora
    34. # sqlnet.ora Network Configuration File: /u01/app/oracle/product/19.0.0/dbhome_1/network/admin/sqlnet.ora
    35. # Generated by Oracle configuration tools.
    36. NAMES.DIRECTORY_PATH= (TNSNAMES, ONAMES, HOSTNAME)
    37. [oracle@rac1 admin]$
    38. [oracle@rac1 admin]$ lsnrctl start LISTENER_CID
    39. LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 29-JAN-2020 03:16:28
    40. Copyright (c) 1991, 2019, Oracle. All rights reserved.
    41. Starting /u01/app/oracle/product/19.0.0/dbhome_1/bin/tnslsnr: please wait...
    42. TNSLSNR for Linux: Version 19.0.0.0.0 - Production
    43. System parameter file is /u01/app/oracle/product/19.0.0/dbhome_1/network/admin/listener.ora
    44. Log messages written to /u01/app/oracle/diag/tnslsnr/rac1/listener_cid/alert/log.xml
    45. Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=rac1.rajasekhar.com)(PORT=1524)))
    46. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=rac1.rajasekhar.com)(PORT=1524)))
    47. STATUS of the LISTENER
    48. ------------------------
    49. Alias LISTENER_CID
    50. Version TNSLSNR for Linux: Version 19.0.0.0.0 - Production
    51. Start Date 29-JAN-2020 03:16:28
    52. Uptime 0 days 0 hr. 0 min. 10 sec
    53. Trace Level off
    54. Security ON: Local OS Authentication
    55. SNMP OFF
    56. Listener Parameter File /u01/app/oracle/product/19.0.0/dbhome_1/network/admin/listener.ora
    57. Listener Log File /u01/app/oracle/diag/tnslsnr/rac1/listener_cid/alert/log.xml
    58. Listening Endpoints Summary...
    59. (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=rac1.rajasekhar.com)(PORT=1524)))
    60. Services Summary...
    61. Service "CID.rajasekhar.com" has 1 instance(s).
    62. Instance "CID", status UNKNOWN, has 1 handler(s) for this service...
    63. The command completed successfully
    64. [oracle@rac1 admin]$
    65. [oracle@rac1 admin]$ tnsping cid
    66. TNS Ping Utility for Linux: Version 19.0.0.0.0 - Production on 29-JAN-2020 03:16:50
    67. Copyright (c) 1997, 2019, Oracle. All rights reserved.
    68. Used parameter files:
    69. /u01/app/oracle/product/19.0.0/dbhome_1/network/admin/sqlnet.ora
    70. Used TNSNAMES adapter to resolve the alias
    71. Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = rac1.rajasekhar.com)(PORT = 1524)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = CID.rajasekhar.com)))
    72. OK (0 msec)
    73. [oracle@rac1 admin]$

    30. Password File – orapwCID

    1. *** REMOTE_LOGIN_PASSWORDFILE=EXCLUSIVE
    2. *** Password file orapwCID copied automatically during upgrade process.
    3. No action taken.
    4. [oracle@rac1 dbs]$ pwd
    5. /u01/app/oracle/product/19.0.0/dbhome_1/dbs
    6. [oracle@rac1 dbs]$ ls -ltr orapwCID
    7. -rw-r-----. 1 oracle oinstall 3584 Jan 28 22:26 orapwCID <----
    8. [oracle@rac1 dbs]$
    9. SQL> show parameter password
    10. NAME TYPE VALUE
    11. ------------------------------------ ----------- ------------------------------
    12. remote_login_passwordfile string EXCLUSIVE
    13. SQL>

    31. Edit oratab

    1. [oracle@rac1 ~]$ cat /etc/oratab | grep -i CID
    2. #CID:/u01/app/oracle/product/12.2.0/dbhome_1:N
    3. CID:/u01/app/oracle/product/19.0.0/dbhome_1:N
    4. [oracle@rac1 ~]$


    32. Back Up the Database

    cat rmanbackup_19c.sh
    Sample Database Backup Script:
    
    rmanbackup_19c.sh
    
    
    1. [oracle@rac1 AFTER_UPGRADE_19C]$ cat backup_db.log
    2. Recovery Manager: Release 19.0.0.0.0 - Production on Wed Jan 29 03:41:08 2020 Version 19.4.0.0.0 Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved. RMAN>
    3. connected to target database: CID (DBID=3899729854)
    4. RMAN> 2> 3> 4> 5> 6> 7> 8>
    5. using target database control file instead of recovery catalog
    6. allocated channel: t1
    7. channel t1: SID=79 device type=DISK
    8. allocated channel: t2
    9. channel t2: SID=82 device type=DISK
    10. allocated channel: t3
    11. channel t3: SID=80 device type=DISK
    12. Starting backup at 29-JAN-20
    13. channel t1: starting full datafile backup set
    14. channel t1: specifying datafile(s) in backup set
    15. input datafile file number=00001 name=/u01/app/oracle/oradata/CID/system01.dbf
    16. input datafile file number=00003 name=/u01/app/oracle/oradata/CID/sysaux01.dbf
    17. channel t1: starting piece 1 at 29-JAN-20
    18. channel t2: starting full datafile backup set
    19. channel t2: specifying datafile(s) in backup set
    20. input datafile file number=00004 name=/u01/app/oracle/oradata/CID/undotbs01.dbf
    21. input datafile file number=00007 name=/u01/app/oracle/oradata/CID/users01.dbf
    22. channel t2: starting piece 1 at 29-JAN-20
    23. channel t2: finished piece 1 at 29-JAN-20
    24. piece handle=/u01/app/backup/CID/AFTER_UPGRADE_19C/database_CID_02un5nen_2 tag=TAG20200129T034111 comment=NONE
    25. channel t2: backup set complete, elapsed time: 00:00:15
    26. channel t1: finished piece 1 at 29-JAN-20
    27. piece handle=/u01/app/backup/CID/AFTER_UPGRADE_19C/database_CID_01un5nen_1 tag=TAG20200129T034111 comment=NONE
    28. channel t1: backup set complete, elapsed time: 00:00:26
    29. Finished backup at 29-JAN-20
    30. Starting Control File and SPFILE Autobackup at 29-JAN-20
    31. piece handle=/u01/app/oracle/fast_recovery_area/CID/autobackup/2020_01_29/o1_mf_s_1030938097_h313ml67_.bkp comment=NONE
    32. Finished Control File and SPFILE Autobackup at 29-JAN-20
    33. released channel: t1
    34. released channel: t2
    35. released channel: t3
    36. RMAN>
    37. sql statement: alter system archive log current
    38. RMAN> 2> 3> 4> 5> 6> 7> 8>
    39. allocated channel: a1
    40. channel a1: SID=79 device type=DISK
    41. allocated channel: a2
    42. channel a2: SID=82 device type=DISK
    43. allocated channel: a3
    44. channel a3: SID=80 device type=DISK
    45. Starting backup at 29-JAN-20
    46. current log archived
    47. channel a1: starting archived log backup set
    48. channel a1: specifying archived log(s) in backup set
    49. input archived log thread=1 sequence=1 RECID=1 STAMP=1030914018
    50. input archived log thread=1 sequence=2 RECID=2 STAMP=1030916097
    51. input archived log thread=1 sequence=3 RECID=3 STAMP=1030916252
    52. input archived log thread=1 sequence=4 RECID=4 STAMP=1030916367
    53. input archived log thread=1 sequence=5 RECID=5 STAMP=1030916430
    54. input archived log thread=1 sequence=6 RECID=6 STAMP=1030916704
    55. input archived log thread=1 sequence=7 RECID=7 STAMP=1030916941
    56. input archived log thread=1 sequence=8 RECID=8 STAMP=1030917153
    57. input archived log thread=1 sequence=9 RECID=9 STAMP=1030917188
    58. channel a1: starting piece 1 at 29-JAN-20
    59. channel a2: starting archived log backup set
    60. channel a2: specifying archived log(s) in backup set
    61. input archived log thread=1 sequence=10 RECID=10 STAMP=1030917335
    62. input archived log thread=1 sequence=11 RECID=11 STAMP=1030917430
    63. input archived log thread=1 sequence=12 RECID=12 STAMP=1030917598
    64. input archived log thread=1 sequence=13 RECID=13 STAMP=1030917716
    65. input archived log thread=1 sequence=14 RECID=14 STAMP=1030917786
    66. input archived log thread=1 sequence=15 RECID=15 STAMP=1030917852
    67. input archived log thread=1 sequence=16 RECID=16 STAMP=1030917938
    68. input archived log thread=1 sequence=17 RECID=17 STAMP=1030918034
    69. input archived log thread=1 sequence=18 RECID=18 STAMP=1030918175
    70. channel a2: starting piece 1 at 29-JAN-20
    71. channel a3: starting archived log backup set
    72. channel a3: specifying archived log(s) in backup set
    73. input archived log thread=1 sequence=19 RECID=19 STAMP=1030918283
    74. input archived log thread=1 sequence=20 RECID=20 STAMP=1030918326
    75. input archived log thread=1 sequence=21 RECID=21 STAMP=1030918365
    76. input archived log thread=1 sequence=22 RECID=22 STAMP=1030918454
    77. input archived log thread=1 sequence=23 RECID=23 STAMP=1030918512
    78. input archived log thread=1 sequence=24 RECID=24 STAMP=1030918594
    79. input archived log thread=1 sequence=25 RECID=25 STAMP=1030919293
    80. input archived log thread=1 sequence=26 RECID=26 STAMP=1030927180
    81. input archived log thread=1 sequence=27 RECID=27 STAMP=1030935285
    82. input archived log thread=1 sequence=28 RECID=28 STAMP=1030938102
    83. channel a3: starting piece 1 at 29-JAN-20
    84. channel a1: finished piece 1 at 29-JAN-20
    85. piece handle=/u01/app/backup/CID/AFTER_UPGRADE_19C/arch_CID_04un5nfn_4 tag=TAG20200129T034143 comment=NONE
    86. channel a1: backup set complete, elapsed time: 00:02:16
    87. channel a1: starting archived log backup set
    88. channel a1: specifying archived log(s) in backup set
    89. input archived log thread=1 sequence=29 RECID=29 STAMP=1030938103
    90. channel a1: starting piece 1 at 29-JAN-20
    91. channel a2: finished piece 1 at 29-JAN-20
    92. piece handle=/u01/app/backup/CID/AFTER_UPGRADE_19C/arch_CID_05un5nfn_5 tag=TAG20200129T034143 comment=NONE
    93. channel a2: backup set complete, elapsed time: 00:02:18
    94. channel a3: finished piece 1 at 29-JAN-20
    95. piece handle=/u01/app/backup/CID/AFTER_UPGRADE_19C/arch_CID_06un5nfo_6 tag=TAG20200129T034143 comment=NONE
    96. channel a3: backup set complete, elapsed time: 00:02:17
    97. channel a1: finished piece 1 at 29-JAN-20
    98. piece handle=/u01/app/backup/CID/AFTER_UPGRADE_19C/arch_CID_07un5nk1_7 tag=TAG20200129T034143 comment=NONE
    99. channel a1: backup set complete, elapsed time: 00:00:03
    100. Finished backup at 29-JAN-20
    101. Starting Control File and SPFILE Autobackup at 29-JAN-20
    102. piece handle=/u01/app/oracle/fast_recovery_area/CID/autobackup/2020_01_29/o1_mf_s_1030938246_h313rjrj_.bkp comment=NONE
    103. Finished Control File and SPFILE Autobackup at 29-JAN-20
    104. released channel: a1
    105. released channel: a2
    106. released channel: a3
    107. RMAN> 2> 3> 4> 5>
    108. allocated channel: c1
    109. channel c1: SID=79 device type=DISK
    110. Starting backup at 29-JAN-20
    111. channel c1: starting full datafile backup set
    112. channel c1: specifying datafile(s) in backup set
    113. including standby control file in backup set
    114. channel c1: starting piece 1 at 29-JAN-20
    115. channel c1: finished piece 1 at 29-JAN-20
    116. piece handle=/u01/app/backup/CID/AFTER_UPGRADE_19C/Control_CID_09un5nkm_9 tag=TAG20200129T034422 comment=NONE
    117. channel c1: backup set complete, elapsed time: 00:00:01
    118. Finished backup at 29-JAN-20
    119. Starting Control File and SPFILE Autobackup at 29-JAN-20
    120. piece handle=/u01/app/oracle/fast_recovery_area/CID/autobackup/2020_01_29/o1_mf_s_1030938266_h313rv5m_.bkp comment=NONE
    121. Finished Control File and SPFILE Autobackup at 29-JAN-20
    122. released channel: c1
    123. RMAN>
    Recovery Manager complete.
    
    [oracle@rac1 AFTER_UPGRADE_19C]$
  • 相关阅读:
    【MM小贴士】从 purchase 到 payment 全流程演示
    Linux网络随笔
    一百八十八、Hive——HiveSQL查询表中的日期是星期几(亲测,附截图)
    提交代码出现error Empty block statement no-empty,代码却没报错?
    Selenium4+Python3系列(五) - 多窗口处理之句柄切换
    【深度学习】GPU使用教程
    分享一款嵌入式开源按键框架代码工程MultiButton
    9.2 【MySQL】独立表空间结构
    下载stm32f4xx标准外设库
    C#NET6基于MailKit 进行邮件发送通知
  • 原文地址:https://blog.csdn.net/kping0306/article/details/127737131