Upgrade Oracle 11 to 19c for Windows—Part Two

Oracle® 19c Database is the latest release of a widely adopted automation database in the market and enterprises. Stability is an important element of the Oracle Database 19c component of the Oracle Database 12c (Release 12.2) family of products. In this two-part blog post series, I cover installing and upgrading version 19c.


This part of the two-part series focuses on upgrading Oracle Database from to 19c in Windows®. This manual method does not use the Database Upgrade Assistant (DBUA).

For installation steps, refer to Part One of this series. I installed binaries on my 19c Oracle home directory, ORACLE_HOME=d:\app\product\19.0.0\dbhome_1.

Use the following steps to upgrade Oracle Database to 19c:

Note: You should have a valid backup before upgrading in case something goes wrong during the upgrade process.

Step 1: Stage the installation file

Stage the 19.3 Relational Database Management System (RDBMS) install file so you can proceed with the upgrade.

Step 2: Pre-upgrade steps

Run the following steps to complete the pre-upgrade process:

Step 2.0: Preparation
  1. Download the Oracle Database Pre-Upgrade Utility by using metalink note 884522.1. To run the pre-upgrade tool, run the following code:

    set ORACLE_HOME=d:\app\product\\dbhome_1 set ORACLE_BASE=d:\app set ORACLE_SID=ABC set PATH=%ORACLE_HOME%\bin;%PATH% %ORACLE_HOME%\jdk\bin\java -jar <top_dir>\preupgrade.jar TERMINAL TEXT -u sys -p <sys_password>

  2. Check the output in d:\app\cfgtoollogs\ABC\preupgrade\preupgrade.txt, review the pre-upgrade log file and fix any errors.

  3. You can run the pre-upgrade fixups script for all the parts with AUTOFIXUP in the logs. For example, to run d:\app\cfgtoologs\ABC\preupgrade\preupgrade_fixups.sql, execute the following code:

    cd d:
    cd d:\app\cfgtoollogs\ABC\preupgrade sqlplus sys/ as sysdba @preupgrade_fixups.sql

  4. Review the output from the preupgrade_fixups.sql and perform any remaining manual steps.

Step 2.1: Back up pfile

Run the following command to take backup of pfile:

SQL> create pfile='d:\app\init_ABC.ora' from spfile;
Step 2.2: Remove invalid objects

Run the utlrp.sql script from SQL Plus to compile invalid objects. Make sure no invalid objects remain in sys/system schema. Save all other invalid objects in a separate table to match during the post-upgrade steps later on.

SQL> create table system.invalids_before_upgrade as select * From dba_invalid_objects;
Step 2.3: Remove the EM repository

Remove the EM repository by using the following steps:

Copy the emremove.sql script from 19c home to 11 g home:

copy d:\app\product\19.0.0\dbhome_1\rdbms\admin\emremove.sql  d:\app\product\\dbhome_1\rdbms\admin
cd d:\app\product\\dbhome_1\rdbms\admin
sqlplus sys/<password> as sysdba
Step 2.4: Remove the OLAP catalog

Remove OLAP catalog by using the following steps:

cd d:\app\product\\dbhome_1\olap\admin\
sqlplus sys/<password> as sysdba @catnoamd.sql
Step 2.5: Remove APEX

If you are not using Application Express (APEX), you can remove it by running the following commands:

cd d:\app\product\\dbhome_1\apex
sqlplus sys/<password> as sysdba @apxremov.sql
drop package htmldb_system;
drop public synonym htmldb_system;
Step 2.6: Purge the RECYCLEBIN

Purge the DBA RECYCLEBIN by using the following command:

Step 2.7: Collect Dictionary statistics

Gather Dictionary stats by using the following command:


Re-run the pre-upgrade tool to confirm that everything is ready.

Step 3.0: Upgrade Steps

Run the following upgrade steps to perform the upgrade:

Step 3.1: Perform the upgrade

Run the following steps to upgrade:

  1. Shut down the Oracle 11g Database.

  2. After shutting down the Oracle Database, open CMD with the admin option and remove all Oracle 11g Windows services by running the following steps from the command prompt:

    set ORACLE_HOME=d:\app\product\19.0.0\dbhome_1 set PATH=%ORACLE_HOME%\bin;%PATH% set ORACLE_SID=ABC sc delete OracleJobSchedulerABC sc delete OracleMTSRecoveryService sc delete OracleServiceABC sc delete OracleVssWriterABC

  3. Create the Oracle 19c Windows service by running the following commands:

    d:\app\product\19.0.0\dbhome_1\bin\ORADIM -NEW -SID ABC -SYSPWD ********* -STARTMODE AUTO -PFILE D:\app\product\19.0.0\dbhome_1\database\INITABC.ORA

  4. After the process creates the Oracle 19c windows services, start the services.

Step 3.2: Start Oracles Database

Start Oracle Database from 19C environment in upgrade mode.

After Oracle Database starts in the upgrade mode, perform the following steps:

  1. Run the following command:

    cd d:\app\product\19.0.0\dbhome_1\bin

  2. Execute the dbupgrade utility from the Windows command prompt.

  3. After the upgrade completes, start the database and run the following command:

    SQL> @?\rdbms\admin\utlrp.sql

Step 4.0: Post-upgrade steps

If the upgrade succeeds, run the post-upgrade fixup script:

d:\ cd d:\app\cfgtoollogs\ABC\preupgrade
sqlplus sys/<password> as sysdba @postupgrade_fixups.sql
Step 4.1: Upgrade the time zone

After you run the post-upgrade fixup scripts, run the following commands to upgrade the time zone:

sqlplus / as sysdba <<EOF
-- Check current settings.
SELECT * FROM v$timezone_file;
-- Begin upgrade to the latest version.
  l_tz_version PLS_INTEGER;
  l_tz_version := DBMS_DST.get_latest_timezone_version;
  DBMS_OUTPUT.put_line('l_tz_version=' || l_tz_version);
-- Do the upgrade.
  DBMS_OUTPUT.put_line('DBMS_DST.upgrade_database : l_failures=' || l_failures);
  DBMS_OUTPUT.put_line('DBMS_DST.end_upgrade : l_failures=' || l_failures);
-- Validate time zone.
SELECT * FROM v$timezone_file;

COLUMN property_name FORMAT A30
COLUMN property_value FORMAT A20

SELECT property_name, property_value
FROM   database_properties
WHERE  property_name LIKE 'DST_%'
ORDER BY property_name;
SQL> select TZ_VERSION from registry$database; 

If the TZ_VERSION shows the old version, run the following commands:

SQL>update registry$database set TZ_VERSION = (select version FROM v$timezone_file);
SQL>select TZ_VERSION from registry$database;
Step 4.2: Collect object statistics

Gather the fixed object stats by running the following commands:

sqlplus / as sysdba <<EOF
Step 4.3 : Collect dictionary statistics

Gather dictionary statistics after the upgrade by running the following statement:

Step 4.4: Validate fixed issues

Run utlusts.sql to verify that no issues remain:

d:\app\product\19.0.0\dbhome_1\rdbms\admin\utlusts.sql TEXT  
Step 4.5: Compare invalid objects

Match all invalid objects to the list you saved in Step 2.2.

Step 4.6: Clean up

To complete the upgrade, perform the following steps:

  1. Copy listener.ora, tnsnames.ora, and sqlnet.ora from the Oracle 11g Oracle home directory to the Oracle 19c Oracle home directory and change the oracle_home parameters accordingly.

  2. Place all these files in d:\app\product\19.0.0\dbhome_1\network\admin.

Note: Keep compatible= in case you need to downgrade the Oracle Database to 11g.


The preceding steps help you easily upgrade Oracle Database in Windows version to 19c.

Learn more about our Database services.

Use the Feedback tab to make any comments or ask questions. You can also start a conversation with us.

post avatar
Pradeep Rai

I am currently an Oracle DBA with 18 years of experience and am well versed with the Oracle technologies. I am also looking into cloud database infrastructure. I also have experience with other than Oracle databases such as Mongo dB and Cassandra.

Share this information: