Tuesday, July 15, 2025

Oracle Database upgrade from 12c to 19c

  • Introduction: As Oracle 19c stands as the Long-Term Support (LTS) release in Oracle’s database roadmap, upgrading from Oracle 12c is not merely a version shift—it’s a strategic move to maintain support, unlock advanced features, and ensure long-term performance, stability, and compliance. In this article, we will see how to upgrade the database from 12c to 19c step by step.

  • Methods of Upgradation:
    1. Using DBUA (Database Upgrade Assistant)
    2. Using Manual method
    In this article we will use DBUA for upgrade.

  • Prerequisites:
    • 12c binary installed with database.
    • 19c binary installed without database.
    • Sufficient disk space for tablespace & archive growth.
    • Minimum 6 hrs downtime for Production database.
  • Environment:
Source Database
Hostname devdb.oraeasy.com
Database Name DEVDB
Database Version 12c(12.2.0.1)
CDB/PDB Yes, Single Instance
Oracle Home /u01/app/oracle/product/12c/db_1
Datafile Location /u01/app/oracle/oradata/devdb

Target Database
Database Version 19c (19.3.0.0.0)
Oracle Home /u01/app/oracle/product/19c/db_home
  • Now proceed for upgradation activity step by step:

  • 1. Take precheck at source.
    First create a table with test user so that data can be validated post upgradation:
    
    
    SQL> show user
    USER is "TEST"
    SQL>
    SQL> def
    DEFINE _DATE           = "09-JUL-25" (CHAR)
    DEFINE _CONNECT_IDENTIFIER = "DEVDBPDB" (CHAR)
    DEFINE _USER           = "TEST" (CHAR)
    DEFINE _PRIVILEGE      = "" (CHAR)
    DEFINE _SQLPLUS_RELEASE = "1202000100" (CHAR)
    DEFINE _EDITOR         = "vi" (CHAR)
    DEFINE _O_VERSION      = "Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production" (CHAR)
    DEFINE _O_RELEASE      = "1202000100" (CHAR)
    SQL>
    SQL> CREATE TABLE COMPANY (EMP_ID INT,NAME VARCHAR(255), COMPANY VARCHAR(255));
    
    Table created.
    
    SQL>
    SQL> INSERT INTO COMPANY VALUES (101,'Yash','WIPRO');
    
    1 row created.
    
    SQL>
    SQL> INSERT INTO COMPANY VALUES (102,'Vijay','AIRTEL');
    
    1 row created.
    
    SQL> INSERT INTO COMPANY VALUES (103,'Riya','TCS');
    
    1 row created.
    
    SQL> commit;
    
    Commit complete.
    
    SQL> select count(*) from COMPANY;
    
      COUNT(*)
    ----------
             3
    
    SQL> exit
    Disconnected from Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
    
    Now take Precheck like Tablespace, Invalid object count & Registery Components:
    
    SQL> show pdbs
    
        CON_ID CON_NAME                       OPEN MODE  RESTRICTED
    ---------- ------------------------------ ---------- ----------
             2 PDB$SEED                       READ ONLY  NO
             3 DEVDBPDB                       READ WRITE NO
             
    SQL> set lines 200 pages 1000
    SQL> select t.tablespace,  t.totalspace as " Totalspace(MB)",
    round((t.totalspace-nvl(fs.freespace,0)),2) as "Used Space(MB)",
    nvl(fs.freespace,0) as "Freespace(MB)",
    round(((t.totalspace-nvl(fs.freespace,0))/t.totalspace)*100,2) as "%Used",
    round((nvl(fs.freespace,0)/t.totalspace)*100,2) as "% Free"
    from
    (select round(sum(d.bytes)/(1024*1024)) as totalspace,d.tablespace_name tablespace
    from dba_data_files d
    group by d.tablespace_name) t,
    (select round(sum(f.bytes)/(1024*1024)) as freespace,f.tablespace_name tablespace
    from dba_free_space f
    group by f.tablespace_name) fs
    where t.tablespace=fs.tablespace (+)
    order by "% Free";
    SQL>  
    
    TABLESPACE                      Totalspace(MB) Used Space(MB) Freespace(MB)      %Used     % Free
    ------------------------------ --------------- -------------- ------------- ---------- ----------
    SYSTEM                                     800            796             4       99.5         .5
    UNDOTBS1                                    70             66             4      94.29       5.71
    SYSAUX                                     470            442            28      94.04       5.96
    USERS                                        5              1             4         20         80
    
    SQL> select count(*) from dba_objects where status='INVALID';
    
      COUNT(*)
    ----------
             0
             
    SQL> col COMP_ID for a10
    SQL> col COMP_NAME for a40
    SQL> col VERSION for a15
    SQL> set lines 180
    SQL> set pages 9998
    SQL> select COMP_ID,COMP_NAME,VERSION,STATUS from dba_registry;
    
    COMP_ID    COMP_NAME                                VERSION         STATUS
    ---------- ---------------------------------------- --------------- ---------------
    CATALOG    Oracle Database Catalog Views            12.2.0.1.0      VALID
    CATPROC    Oracle Database Packages and Types       12.2.0.1.0      VALID
    JAVAVM     JServer JAVA Virtual Machine             12.2.0.1.0      VALID
    XML        Oracle XDK                               12.2.0.1.0      VALID
    CATJAVA    Oracle Database Java Packages            12.2.0.1.0      VALID
    APS        OLAP Analytic Workspace                  12.2.0.1.0      VALID
    RAC        Oracle Real Application Clusters         12.2.0.1.0      OPTION OFF
    XDB        Oracle XML Database                      12.2.0.1.0      VALID
    OWM        Oracle Workspace Manager                 12.2.0.1.0      VALID
    CONTEXT    Oracle Text                              12.2.0.1.0      VALID
    ORDIM      Oracle Multimedia                        12.2.0.1.0      VALID
    SDO        Spatial                                  12.2.0.1.0      VALID
    XOQ        Oracle OLAP API                          12.2.0.1.0      VALID
    OLS        Oracle Label Security                    12.2.0.1.0      VALID
    DV         Oracle Database Vault                    12.2.0.1.0      VALID
    
    15 rows selected.
    
    SQL> alter session set container=DEVDBPDB;
    
    Session altered.
    
    SQL> show pdbs
    
        CON_ID CON_NAME                       OPEN MODE  RESTRICTED
    ---------- ------------------------------ ---------- ----------
             3 DEVDBPDB                       READ WRITE NO
    
    SQL> set lines 200 pages 1000
    SQL> select t.tablespace,  t.totalspace as " Totalspace(MB)",
    round((t.totalspace-nvl(fs.freespace,0)),2) as "Used Space(MB)",
    nvl(fs.freespace,0) as "Freespace(MB)",
    round(((t.totalspace-nvl(fs.freespace,0))/t.totalspace)*100,2) as "%Used",
    round((nvl(fs.freespace,0)/t.totalspace)*100,2) as "% Free"
    from
    (select round(sum(d.bytes)/(1024*1024)) as totalspace,d.tablespace_name tablespace
    from dba_data_files d
    group by d.tablespace_name) t,
    (select round(sum(f.bytes)/(1024*1024)) as freespace,f.tablespace_name tablespace
    from dba_free_space f
    group by f.tablespace_name) fs
    where t.tablespace=fs.tablespace (+)
    order by "% Free";
    SQL>  
    
    SQL> select count(*) from dba_objects where status='INVALID';
    
      COUNT(*)
    ----------
             0
    
    SQL> select COMP_ID,COMP_NAME,VERSION,STATUS from dba_registry;
    
    COMP_ID    COMP_NAME                                VERSION         STATUS
    ---------- ---------------------------------------- --------------- -----------------
    CATALOG    Oracle Database Catalog Views            12.2.0.1.0      VALID
    CATPROC    Oracle Database Packages and Types       12.2.0.1.0      VALID
    JAVAVM     JServer JAVA Virtual Machine             12.2.0.1.0      VALID
    XML        Oracle XDK                               12.2.0.1.0      VALID
    CATJAVA    Oracle Database Java Packages            12.2.0.1.0      VALID
    APS        OLAP Analytic Workspace                  12.2.0.1.0      VALID
    RAC        Oracle Real Application Clusters         12.2.0.1.0      OPTION OFF
    XDB        Oracle XML Database                      12.2.0.1.0      VALID
    OWM        Oracle Workspace Manager                 12.2.0.1.0      VALID
    CONTEXT    Oracle Text                              12.2.0.1.0      VALID
    ORDIM      Oracle Multimedia                        12.2.0.1.0      VALID
    SDO        Spatial                                  12.2.0.1.0      VALID
    XOQ        Oracle OLAP API                          12.2.0.1.0      VALID
    OLS        Oracle Label Security                    12.2.0.1.0      VALID
    DV         Oracle Database Vault                    12.2.0.1.0      VALID
    
    15 rows selected.
    
    2. Now we need to perform few steps before the upgradation. Below steps should be performed on CDB & each PDBs.
    
    
    

    ==> Gather Dictonary stats.

    SQL> SET ECHO ON; SQL> SET SERVEROUTPUT ON; SQL> EXECUTE DBMS_STATS.GATHER_DICTIONARY_STATS; PL/SQL procedure successfully completed.

    ==> Recycle bin purging.

    SQL> PURGE DBA_RECYCLEBIN; DBA Recyclebin purged.

    ==> Refresh Materlized views.

    SQL> declare list_failures integer(3) :=0; begin DBMS_MVIEW.REFRESH_ALL_MVIEWS(list_failures,'C','', TRUE, FALSE); end; / PL/SQL procedure successfully completed.

    ==> Create a guarnteed flashback restore point for rollback.

    SQL> archive log list Database log mode Archive Mode Automatic archival Enabled Archive destination USE_DB_RECOVERY_FILE_DEST Oldest online log sequence 2 Next log sequence to archive 4 Current log sequence 4 SQL> SQL> select flashback_on from v$database; FLASHBACK_ON ------------------ NO SQL> shut immediate; Database closed. Database dismounted. ORACLE instance shut down. SQL> SQL> startup mount ORACLE instance started. Total System Global Area 1174405120 bytes Fixed Size 8792056 bytes Variable Size 436209672 bytes Database Buffers 721420288 bytes Redo Buffers 7983104 bytes Database mounted. SQL> SQL> alter database flashback on; Database altered. SQL> SQL> alter database open; Database altered. SQL> select flashback_on from v$database; FLASHBACK_ON ------------------ YES SQL> select name,open_mode,log_mode from v$database; NAME OPEN_MODE LOG_MODE --------- -------------------- ------------ DEVDB READ WRITE ARCHIVELOG SQL> show parameter compatible NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ compatible string 12.2.0 noncdb_compatible boolean FALSE SQL> show parameter recovery NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ db_recovery_file_dest string /u01/app/oracle/fast_recovery_ area/devdb db_recovery_file_dest_size big integer 5G db_unrecoverable_scn_tracking boolean TRUE recovery_parallelism integer 0 remote_recovery_file_dest string SQL> SQL> SQL> alter system set db_recovery_file_dest_size=15G; System altered. SQL> show parameter reco NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ db_recovery_file_dest string /u01/app/oracle/fast_recovery_ area/devdb db_recovery_file_dest_size big integer 15G db_unrecoverable_scn_tracking boolean TRUE recovery_parallelism integer 0 remote_recovery_file_dest string SQL> SQL> select * from V$restore_point; no rows selected. SQL> create restore point pre_upgrade12c guarantee flashback database; Restore point created. SQL> SQL> col name for a20 SQL> col GUARANTEE_FLASHBACK_DATABASE for a10 SQL> col TIME for a60 SQL> set lines 190 SQL> select NAME,GUARANTEE_FLASHBACK_DATABASE,TIME from V$restore_point; NAME GUARANTEE_ TIME -------------------- ---------- ------------------------------------------------------------ PRE_UPGRADE12C YES 10-JUL-25 09.29.38.000000000 PM SQL>
    3. Now run the preupgrade script.
    
    [oracle@devdb ~]$ mkdir preupgrade
    [oracle@devdb ~]$ cd preupgrade/
    [oracle@devdb preupgrade]$ pwd
    /home/oracle/preupgrade
    
    [oracle@devdb ~]$ /u01/app/oracle/product/12c/db_1/jdk/bin/java -jar  /u01/app/oracle/product/19c/db_home/rdbms/admin/preupgrade.jar FILE DIR /home/oracle/preupgrade
    
    ==================
    PREUPGRADE SUMMARY
    ==================
      /home/oracle/preupgrade/preupgrade.log
      /home/oracle/preupgrade/preupgrade_fixups.sql
      /home/oracle/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 /home/oracle/preupgrade/ -b preup_devdb /home/oracle/preupgrade/preupgrade_fixups.sql
    
    2. Review logs under /home/oracle/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 /home/oracle/preupgrade/ -b postup_devdb /home/oracle/preupgrade/postupgrade_fixups.sql
    
    2. Review logs under /home/oracle/preupgrade/
    
    Preupgrade complete: 2025-07-10T21:36:37
    
    4. Now run the preupgrade_fixups.sql for CDB & each PDBs. Below output is for CDB only.
    
    SQL> @/home/oracle/preupgrade/preupgrade_fixups.sql
    Executing Oracle PRE-Upgrade Fixup Script
    
    Auto-Generated by:       Oracle Preupgrade Script
                             Version: 19.0.0.0.0 Build: 1
    Generated on:            2025-07-10 21:35:02
    
    For Source Database:     DEVDB
    Source Database Version: 12.2.0.1.0
    For Upgrade to Version:  19.0.0.0.0
    
    Executing in container:  CDB$ROOT
    
    Preup                             Preupgrade
    Action                            Issue Is
    Number  Preupgrade Check Name     Remedied    Further DBA Action
    ------  ------------------------  ----------  --------------------------------
        1.  min_recovery_area_size    YES         None.
        2.  pre_fixed_objects         YES         None.
        3.  tablespaces_info          NO          Informational only.
                                                  Further action is optional.
        4.  cycle_number              NO          Informational only.
                                                  Further action is optional.
        5.  rman_recovery_version     NO          Informational only.
                                                  Further action is optional.
    
    The fixup scripts have been run and resolved what they can. However,
    there are still issues originally identified by the preupgrade that
    have not been remedied and are still present in the database.
    Depending on the severity of the specific issue, and the nature of
    the issue itself, that could mean that your database is not ready
    for upgrade.  To resolve the outstanding issues, start by reviewing
    the preupgrade_fixups.sql and searching it for the name of
    the failed CHECK NAME or Preupgrade Action Number listed above.
    There you will find the original corresponding diagnostic message
    from the preupgrade which explains in more detail what still needs
    to be done.
    
    PL/SQL procedure successfully completed.
    
    
    Session altered.
    
    
    5. Now run the DBUA from 19c Oracle Home.
    
    [oracle@devdb bin]$ pwd
    /u01/app/oracle/product/19c/db_home/bin
    [oracle@devdb bin]$ /u01/app/oracle/product/19c/db_home/bin/./dbua
    Logs directory:  /u01/app/oracle/cfgtoollogs/dbua/upgrade2025-07-11_07-41-14AM
    
    
    Now a GUI window will appear. Follow the below steps.

    Verify the database name, ORACLE HOME, and provide the crdential. Then click Next.

    Click Next

    Wait till precheck gets completed.

    Click on Fix & Check Again.

    Click Next.

    Click Next.

    Select the Guarnteed Flashback point. Click Next.

    We can create listener later, so click Next.

    Click Next.

    Click Finish.

    Now monitor the progress.







    Now upgrade has been completed. Review the summary.

    Click Close.

    6. Now run the postupgrade_fixups.sql for CDB & each PDBs.
    
    SQL> show pdbs
    
        CON_ID CON_NAME                       OPEN MODE  RESTRICTED
    ---------- ------------------------------ ---------- ----------
             2 PDB$SEED                       READ ONLY  NO
             3 DEVDBPDB                       READ WRITE NO
    
    SQL> @/home/oracle/preupgrade/postupgrade_fixups.sql
    
    Session altered.
    
    
    PL/SQL procedure successfully completed.
    
    
    Commit complete.
    
    
    Session altered.
    
    
    PL/SQL procedure successfully completed.
    
    
    PL/SQL procedure successfully completed.
    
    
    Package created.
    
    No errors.
    
    Package body created.
    
    
    PL/SQL procedure successfully completed.
    
    No errors.
    
    
    
    
    
    Package created.
    
    No errors.
    
    Package body created.
    
    No errors.
    Executing Oracle POST-Upgrade Fixup Script
    
    Auto-Generated by:       Oracle Preupgrade Script
                             Version: 19.0.0.0.0 Build: 1
    Generated on:            2025-07-10 21:35:20
    
    For Source Database:     DEVDB
    Source Database Version: 12.2.0.1.0
    For Upgrade to Version:  19.0.0.0.0
    
    Executing in container:  CDB$ROOT
    
    Preup                             Preupgrade
    Action                            Issue Is
    Number  Preupgrade Check Name     Remedied    Further DBA Action
    ------  ------------------------  ----------  --------------------------------
        6.  old_time_zones_exist      YES         None.
        7.  dir_symlinks              YES         None.
        8.  post_dictionary           YES         None.
        9.  post_fixed_objects        NO          Informational only.
                                                  Further action is optional.
    
    The fixup scripts have been run and resolved what they can. However,
    there are still issues originally identified by the preupgrade that
    have not been remedied and are still present in the database.
    Depending on the severity of the specific issue, and the nature of
    the issue itself, that could mean that your database upgrade is not
    fully complete.  To resolve the outstanding issues, start by reviewing
    the postupgrade_fixups.sql and searching it for the name of
    the failed CHECK NAME or Preupgrade Action Number listed above.
    There you will find the original corresponding diagnostic message
    from the preupgrade which explains in more detail what still needs
    to be done.
    
    PL/SQL procedure successfully completed.
    
    
    Session altered.
    
    
    
    SQL> 
    SQL> 
    SQL> 
    SQL> alter session set container=DEVDBPDB;
    
    SQL> @/home/oracle/preupgrade/postupgrade_fixups.sql
    
    Session altered.
    
    
    PL/SQL procedure successfully completed.
    
    
    Commit complete.
    
    
    Session altered.
    
    
    PL/SQL procedure successfully completed.
    
    
    PL/SQL procedure successfully completed.
    
    
    Package created.
    
    No errors.
    
    Package body created.
    
    
    PL/SQL procedure successfully completed.
    
    No errors.
    
    
    
    
    
    Package created.
    
    No errors.
    
    Package body created.
    
    No errors.
    Executing Oracle POST-Upgrade Fixup Script
    
    Auto-Generated by:       Oracle Preupgrade Script
                             Version: 19.0.0.0.0 Build: 1
    Generated on:            2025-07-10 21:35:20
    
    For Source Database:     DEVDB
    Source Database Version: 12.2.0.1.0
    For Upgrade to Version:  19.0.0.0.0
    
    Executing in container:  DEVDBPDB
    
    Preup                             Preupgrade
    Action                            Issue Is
    Number  Preupgrade Check Name     Remedied    Further DBA Action
    ------  ------------------------  ----------  --------------------------------
        3.  old_time_zones_exist      YES         None.
        4.  dir_symlinks              YES         None.
        5.  post_dictionary           YES         None.
        6.  post_fixed_objects        NO          Informational only.
                                                  Further action is optional.
    
    The fixup scripts have been run and resolved what they can. However,
    there are still issues originally identified by the preupgrade that
    have not been remedied and are still present in the database.
    Depending on the severity of the specific issue, and the nature of
    the issue itself, that could mean that your database upgrade is not
    fully complete.  To resolve the outstanding issues, start by reviewing
    the postupgrade_fixups.sql and searching it for the name of
    the failed CHECK NAME or Preupgrade Action Number listed above.
    There you will find the original corresponding diagnostic message
    from the preupgrade which explains in more detail what still needs
    to be done.
    
    PL/SQL procedure successfully completed.
    
    
    Session altered.
    
    
    
    7. Now perform the postcheck.
    
    [oracle@devdb bin]$ sqlplus / as sysdba
    
    SQL*Plus: Release 19.0.0.0.0 - Production on Fri Jul 11 12:18:16 2025
    Version 19.3.0.0.0
    
    Copyright (c) 1982, 2019, Oracle.  All rights reserved.
    
    
    Connected to:
    Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
    Version 19.3.0.0.0
    
    SQL> show pdbs
    
        CON_ID CON_NAME                       OPEN MODE  RESTRICTED
    ---------- ------------------------------ ---------- ----------
             2 PDB$SEED                       READ ONLY  NO
             3 DEVDBPDB                       READ WRITE NO
    SQL>
    SQL> SELECT version FROM v$timezone_file;
    
       VERSION
    ----------
            32
    
    SQL> select count(1) from dba_objects where status='INVALID';
    
      COUNT(1)
    ----------
             0
    
    SQL>
    SQL> col COMP_ID for a10
    SQL> col COMP_NAME for a40
    SQL> col VERSION for a15
    SQL> set lines 180
    SQL> set pages 999
    SQL> select COMP_ID,COMP_NAME,VERSION,STATUS from dba_registry;
    
    COMP_ID    COMP_NAME                                VERSION         STATUS
    ---------- ---------------------------------------- --------------- --------------------------------------------
    CATALOG    Oracle Database Catalog Views            19.0.0.0.0      VALID
    CATPROC    Oracle Database Packages and Types       19.0.0.0.0      VALID
    JAVAVM     JServer JAVA Virtual Machine             19.0.0.0.0      VALID
    XML        Oracle XDK                               19.0.0.0.0      VALID
    CATJAVA    Oracle Database Java Packages            19.0.0.0.0      VALID
    APS        OLAP Analytic Workspace                  19.0.0.0.0      VALID
    RAC        Oracle Real Application Clusters         19.0.0.0.0      OPTION OFF
    XDB        Oracle XML Database                      19.0.0.0.0      VALID
    OWM        Oracle Workspace Manager                 19.0.0.0.0      VALID
    CONTEXT    Oracle Text                              19.0.0.0.0      VALID
    ORDIM      Oracle Multimedia                        19.0.0.0.0      VALID
    SDO        Spatial                                  19.0.0.0.0      VALID
    XOQ        Oracle OLAP API                          19.0.0.0.0      VALID
    OLS        Oracle Label Security                    19.0.0.0.0      VALID
    DV         Oracle Database Vault                    19.0.0.0.0      VALID
    
    15 rows selected.
    
    SQL>
    SQL> alter session set container=DEVDBPDB;
    
    Session altered.
    
    SQL>
    SQL> SELECT version FROM v$timezone_file;
    
     VERSION
    --------
          32
    
    SQL> select count(1) from dba_objects where status='INVALID';
    
      COUNT(1)
    ----------
             0
    
    SQL> select COMP_ID,COMP_NAME,VERSION,STATUS from dba_registry;
    
    COMP_ID    COMP_NAME                                VERSION                        STATUS
    ---------- ---------------------------------------- ------------------------------ --------------------------------------------
    CATALOG    Oracle Database Catalog Views            19.0.0.0.0                     VALID
    CATPROC    Oracle Database Packages and Types       19.0.0.0.0                     VALID
    JAVAVM     JServer JAVA Virtual Machine             19.0.0.0.0                     VALID
    XML        Oracle XDK                               19.0.0.0.0                     VALID
    CATJAVA    Oracle Database Java Packages            19.0.0.0.0                     VALID
    APS        OLAP Analytic Workspace                  19.0.0.0.0                     VALID
    RAC        Oracle Real Application Clusters         19.0.0.0.0                     OPTION OFF
    XDB        Oracle XML Database                      19.0.0.0.0                     VALID
    OWM        Oracle Workspace Manager                 19.0.0.0.0                     VALID
    CONTEXT    Oracle Text                              19.0.0.0.0                     VALID
    ORDIM      Oracle Multimedia                        19.0.0.0.0                     VALID
    SDO        Spatial                                  19.0.0.0.0                     VALID
    XOQ        Oracle OLAP API                          19.0.0.0.0                     VALID
    OLS        Oracle Label Security                    19.0.0.0.0                     VALID
    DV         Oracle Database Vault                    19.0.0.0.0                     VALID
    
    15 rows selected.
    
    
    

    Please note if you find any registery component invalid then run @ORACLE_HOME/rdbms/admin/utlrp.sql to compile the component.

    8. Now drop the flashback restore point.
    
    
    SQL> col name for a20
    SQL> col GUARANTEE_FLASHBACK_DATABASE for a10
    SQL> col TIME for a60
    SQL> set lines 190
    SQL> select NAME,GUARANTEE_FLASHBACK_DATABASE,TIME from V$restore_point;SQL> SQL> SQL> SQL>
    
    NAME                 GUARANTEE_ TIME
    -------------------- ---------- ------------------------------------------------------------
    PRE_UPGRADE12C       YES        10-JUL-25 09.29.38.000000000 PM
    
    SQL>
    SQL> drop restore point PRE_UPGRADE12C;
    
    Restore point dropped.
    
    SQL> select NAME,GUARANTEE_FLASHBACK_DATABASE,TIME from V$restore_point;
    
    no rows selected
    
    SQL>
    
    9. Now update COMPATIBLE parameter.
    
    SQL>  show parameter COMPATIBLE
    
    NAME                                 TYPE        VALUE
    ------------------------------------ ----------- ------------------------------
    compatible                           string      12.2.0
    noncdb_compatible                    boolean     FALSE
    SQL>
    SQL>  ALTER SYSTEM SET COMPATIBLE = '19.0.0' SCOPE=SPFILE;
    
    System altered.
    
    SQL> shut immediate;
    Database closed.
    Database dismounted.
    ORACLE instance shut down.
    SQL>
    
    SQL> startup
    ORACLE instance started.
    
    Total System Global Area 1174405120 bytes
    Fixed Size                  9134080 bytes
    Variable Size             771751936 bytes
    Database Buffers          385875968 bytes
    Redo Buffers                7643136 bytes
    Database mounted.
    Database opened.
    SQL>
    SQL> show parameter COMPATIBLE
    
    NAME                                 TYPE        VALUE
    ------------------------------------ ----------- ------------------------------
    compatible                           string      19.0.0
    noncdb_compatible                    boolean     FALSE
    SQL>
    SQL> select name,open_mode,version from v$database,v$instance;
    
    NAME                 OPEN_MODE            VERSION
    -------------------- -------------------- ---------------
    DEVDB                READ WRITE           19.0.0.0.0
    
    SQL>
    
    10. Now update the environment for 19c. Also create a listener. Refer Create listener using NETCA
    
    [oracle@devdb ~]$ cat .bash_profile
    # .bash_profile
    
    # Get the aliases and functions
    if [ -f ~/.bashrc ]; then
            . ~/.bashrc
    fi
    
    # User specific environment and startup programs
    ORACLE_HOME=/u01/app/oracle/product/19c/db_home
    export ORACLE_HOME
    ORACLE_BASE=/u01/app/oracle
    export ORACLE_BASE
    ORACLE_SID=devdb
    export ORACLE_SID
    LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib:.
    export LD_LIBRARY_PATH
    LIBPATH=$ORACLE_HOME/lib32:$ORACLE_HOME/lib:/usr/lib:/lib
    export LIBPATH
    TNS_ADMIN=${ORACLE_HOME}/network/admin
    export TNS_ADMIN
    PATH=$ORACLE_HOME/bin:$PATH:.
    export PATH
    
    
    [oracle@devdb ~]$
    [oracle@devdb ~]$ lsnrctl status LISTENER
    
    LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 10-JUL-2025 22:37:31
    
    Copyright (c) 1991, 2019, Oracle.  All rights reserved.
    
    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=devdb)(PORT=1521)))
    STATUS of the LISTENER
    ------------------------
    Alias                     LISTENER
    Version                   TNSLSNR for Linux: Version 19.0.0.0.0 - Production
    Start Date                10-JUL-2025 22:37:11
    Uptime                    0 days 0 hr. 1 min. 23 sec
    Trace Level               off
    Security                  ON: Local OS Authentication
    SNMP                      OFF
    Listener Parameter File   /u01/app/oracle/product/19c/db_home/network/admin/listener.ora
    Listener Log File         /u01/app/oracle/diag/tnslsnr/devdb/listener/alert/log.xml
    Listening Endpoints Summary...
      (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=devdb.oraeasy.com)(PORT=1521)))
      (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
    Services Summary...
    Service "396c6dec59d53653e0650deef82416fe" has 1 instance(s).
      Instance "devdb", status READY, has 1 handler(s) for this service...
    Service "4700a987085a3dfae05387e5e50a8c7b" has 1 instance(s).
      Instance "devdb", status READY, has 1 handler(s) for this service...
    Service "devdb" has 1 instance(s).
      Instance "devdb", status READY, has 1 handler(s) for this service...
    Service "devdbXDB" has 1 instance(s).
      Instance "devdb", status READY, has 1 handler(s) for this service...
    Service "devdbpdb" has 1 instance(s).
      Instance "devdb", status READY, has 1 handler(s) for this service...
    The command completed successfully
    
    11. Now verify the table data.
    
    [oracle@devdb ~]$ sqlplus test@DEVDBPDB
    
    SQL*Plus: Release 19.0.0.0.0 - Production on Sun Jul 13 22:38:06 2025
    Version 19.3.0.0.0
    
    Copyright (c) 1982, 2019, Oracle.  All rights reserved.
    
    Enter password:
    Last Successful login time: Wed Jul 09 2025 20:26:11 +05:30
    
    Connected to:
    Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
    Version 19.3.0.0.0
    
    SQL>
    SQL> show user
    USER is "TEST"
    SQL>
    SQL> def
    DEFINE _DATE           = "10-JUL-25" (CHAR)
    DEFINE _CONNECT_IDENTIFIER = "DEVDBPDB" (CHAR)
    DEFINE _USER           = "TEST" (CHAR)
    DEFINE _PRIVILEGE      = "" (CHAR)
    DEFINE _SQLPLUS_RELEASE = "1903000000" (CHAR)
    DEFINE _EDITOR         = "vi" (CHAR)
    DEFINE _O_VERSION      = "Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
    Version 19.3.0.0.0" (CHAR)
    DEFINE _O_RELEASE      = "1903000000" (CHAR)
    SQL>
    SQL> select count(*) from COMPANY;
    
      COUNT(*)
    ----------
             3
    
    SQL>
    

    Now 12c to 19c upgrade activity has been successfully completed.


    Thanks for visiting!!

    0 comments:

    Post a Comment