Upgrade Oracle 11g to 19c using AutoUpgrade utility

11g to 19c using AutoUpgrade

Hi, in this article we are going to learn how to upgrade the oracle database using the AutoUpgrade utility. The Autoupgrade is a new utility that is introduced in Oracle 19c."11g to 19c using AutoUpgrade"

How do I upgrade Oracle database to 19c?

To upgrade oracle 11g to 19c we are going to following the below steps.

Or Click here to download autoupgrade utility, login with your oracle support login and download the jar file.

My Environment:

In this practive i am using following environment.

  • VMware Workstation
  • Oracle Linux 7
  • Oracle Database 11G currently running
  • Upgrading 11G database to 19c directly
11g to 19c using AutoUpgrade

Read: How to add new disk in Linux

How to use Putty in GUI mode Click Here

Note: After download new auto upgrade utility, replace existing utility with new one.

Step 1: Check autoupgrade utility version

Using the below commands you can check the autoupgrade utility version.

$ /u02/app/oracle/product/19.3.0/db_home/jdk/bin/java -jar /u02/app/oracle/product/19.3.0/db_home/rdbms/admin/autoupgrade.jar -version

Before change autoupgrade utility

11g to 19c using AutoUpgrade

After change autoupgrade utility

auto upgrade utility

Step 2: Check JDK version

As per oracle recommendation the JDK version should be greater than or equals to 1.8, this is the minimum required version.

/u02/app/oracle/product/19.3.0/db_home/jdk/bin/java -version

In my case JDK version is 1.8, check the beow screenshot.

JDK version is 1.8

Step 3: Create Config file for DB upgradation

The DB config file is very important role in DB auto upgradation, use the below command and genrate it.

 /u02/app/oracle/product/19.3.0/db_home/jdk/bin/java -jar /u02/app/oracle/product/19.3.0/db_home/rdbms/admin/autoupgrade.jar -create_sample_file config
config file

In my case my config file created on "/u02/auto_up/sample_config.cfg".

My activity logs are genrating on /u02/auto_up/ location by default. You need to check your log directory.

Step 4: Edit Config file

Now its time to edit config file and add our dataabses details in this file, wather you have multiple databases, you can add all of them in this config file.

Before Change the sample_config file look like this:

$cat /u02/auto_up/sample_config.cfg

Output:

#
# sample config file
#
# build version 19.10.0
# build date    2020/10/23 10:36:46
#
#
# Global configurations
#
# This directory will include the following
#   (1) AutoUpgrade's global directory
#   (2) Any logs, not directly tied to a job
#   (3) Config files
#   (4) progress.json and status.json
global.autoupg_log_dir=/u02/auto_up/upg_logs


#
# Database number 1
#
upg1.dbname=employee
upg1.start_time=NOW
upg1.source_home=/u01/app/oracle/product/11.2.0/dbhome_1
upg1.target_home=/u01/app/oracle/product/19.1.0/dbhome_1
upg1.sid=emp
upg1.log_dir=/u02/auto_up/upg_logs/employee
upg1.upgrade_node=ocptechnology.com
upg1.target_version=19
#upg1.run_utlrp=yes
#upg1.timezone_upg=yes

#
# Database number 2
#
#upg2.dbname=database name
#upg2.start_time=06/08/2022 01:19:27
#upg2.source_home=Path to source version of Oracle database
#upg2.target_home=Path to target version of Oracle database
#upg2.sid=Value of Oracle SID
#upg2.log_dir=Path to log dir
#upg2.upgrade_node=ocptechnology.com # To find out your node name run the hostname utility
#upg2.target_version=12.2
#upg2.run_utlrp=[yes|no]
#upg2.timezone_upg=[yes|no]

#
# You can have as many databases as desired
#
#upgN.dbname=database name
#upgN.start_time=dd/mm/yyyy hh:mm:ss | now
#upgN.source_home=Path to source version of Oracle database
#upgN.target_home=Path to target version of Oracle database
#upgN.sid=Value of Oracle SID
#upgN.log_dir=Path to log dir
#upgN.upgrade_node=upgrade_node # To find out your node name run the hostname utility
#upgN.target_version= 18
#upgN.run_utlrp=[yes|no]
#upgN.timezone_upg=[yes|no]

I have only one database in my environment, so i am going to add its details in config file.

After Editing the config file

After editing my config file its look like below:

Edit config file

Step 5: Analyze the Database

Now its time to analyze the database using the below command.

$/u02/app/oracle/product/19.3.0/db_home/jdk/bin/java -jar /u02/app/oracle/product/19.3.0/db_home/rdbms/admin/autoupgrade.jar -config sample_config.cfg -mode analyze 

Output:

analyze database

The analyze command completed and it is genrated few logs on "/u02/auto_up/upg_logs/employee/ocp/100/prechecks". Here you will se one HTML file which you can open in firfox browser or copy it on your windows system and check the details.

Pre-Check Error

In my case my database is running in No-Archivelog mode, it is fail in pre check. If you performing autoupgrad its need database must be running in Archivelog mode.

pre check error

Pre-Check Recomendation

It giving to gather disctionary stats as recomendation.

pre check recomendation

Step 6: Start upgrading 11g to 19c using AutoUpgrade

Using the below command start upgradation. "11c to 19c using AutoUpgrade"

$/u02/app/oracle/product/19.3.0/db_home/jdk/bin/java -jar /u02/app/oracle/product/19.3.0/db_home/rdbms/admin/autoupgrade.jar -config sample_config.cfg -mode DEPLOY

You can track upgradation status with following logifle:

$tail -100f  /u02/auto_up/upg_logs/employee/ocp/105/autoupgrade_20220806_user.log

Output:

AutoUpgrade tool launched with default options
Processing config file ...
+--------------------------------+
| Starting AutoUpgrade execution |
+--------------------------------+
1 databases will be processed
Type 'help' to list console commands
upg>
upg>
upg> lsj
+----+-------+---------+---------+-------+--------------+--------+----------------------------+
|Job#|DB_NAME|    STAGE|OPERATION| STATUS|    START_TIME| UPDATED|                     MESSAGE|
+----+-------+---------+---------+-------+--------------+--------+----------------------------+
| 105|    ocp|PRECHECKS|PREPARING|RUNNING|22/08/06 01:51|01:51:17|Loading database information|
+----+-------+---------+---------+-------+--------------+--------+----------------------------+
Total jobs 1

upg>
upg> lsj
+----+-------+---------+---------+-------+--------------+--------+-------------+
|Job#|DB_NAME|    STAGE|OPERATION| STATUS|    START_TIME| UPDATED|      MESSAGE|
+----+-------+---------+---------+-------+--------------+--------+-------------+
| 105|    ocp|PREFIXUPS|EXECUTING|RUNNING|22/08/06 01:51|01:51:28|Remaining 6/6|
+----+-------+---------+---------+-------+--------------+--------+-------------+
Total jobs 1

upg>
upg>
upg> lsj
+----+-------+---------+---------+-------+--------------+--------+-------------+
|Job#|DB_NAME|    STAGE|OPERATION| STATUS|    START_TIME| UPDATED|      MESSAGE|
+----+-------+---------+---------+-------+--------------+--------+-------------+
| 105|    ocp|PREFIXUPS|EXECUTING|RUNNING|22/08/06 01:51|01:51:28|Remaining 6/6|
+----+-------+---------+---------+-------+--------------+--------+-------------+
Total jobs 1
upg> lsj
+----+-------+---------+---------+-------+--------------+--------+------------+
|Job#|DB_NAME|    STAGE|OPERATION| STATUS|    START_TIME| UPDATED|     MESSAGE|
+----+-------+---------+---------+-------+--------------+--------+------------+
| 105|    ocp|DBUPGRADE|EXECUTING|RUNNING|22/08/06 01:51|02:16:46|91%Upgraded |
+----+-------+---------+---------+-------+--------------+--------+------------+
Total jobs 1


upg> lsj
+----+-------+---------+---------+-------+--------------+--------+------------+
|Job#|DB_NAME|    STAGE|OPERATION| STATUS|    START_TIME| UPDATED|     MESSAGE|
+----+-------+---------+---------+-------+--------------+--------+------------+
| 105|    ocp|DBUPGRADE|EXECUTING|RUNNING|22/08/06 01:51|02:21:01|95%Upgraded |
+----+-------+---------+---------+-------+--------------+--------+------------+
Total jobs 1

upg>
upg>
upg> lsj
+----+-------+---------+---------+-------+--------------+--------+-----------+
|Job#|DB_NAME|    STAGE|OPERATION| STATUS|    START_TIME| UPDATED|    MESSAGE|
+----+-------+---------+---------+-------+--------------+--------+-----------+
| 105|    ocp|DBUPGRADE|EXECUTING|RUNNING|22/08/06 01:51|02:22:54|0%Compiled |
+----+-------+---------+---------+-------+--------------+--------+-----------+
Total jobs 1

upg>
upg>
upg> lsj
+----+-------+---------+---------+-------+--------------+--------+------------+
|Job#|DB_NAME|    STAGE|OPERATION| STATUS|    START_TIME| UPDATED|     MESSAGE|
+----+-------+---------+---------+-------+--------------+--------+------------+
| 105|    ocp|DBUPGRADE|EXECUTING|RUNNING|22/08/06 01:51|02:25:57|97%Compiled |
+----+-------+---------+---------+-------+--------------+--------+------------+
Total jobs 1

upg> lsj
+----+-------+----------+---------+-------+--------------+--------+-------------+
|Job#|DB_NAME|     STAGE|OPERATION| STATUS|    START_TIME| UPDATED|      MESSAGE|
+----+-------+----------+---------+-------+--------------+--------+-------------+
| 105|    ocp|POSTFIXUPS|EXECUTING|RUNNING|22/08/06 01:51|02:29:44|Remaining 1/3|
+----+-------+----------+---------+-------+--------------+--------+-------------+
Total jobs 1

upg>
upg>
upg> Job 105 completed
------------------- Final Summary --------------------
Number of databases            [ 1 ]

Jobs finished successfully     [1]
Jobs failed                    [0]
Jobs pending                   [0]
------------- JOBS FINISHED SUCCESSFULLY -------------
Job 105 for ocp

---- Drop GRP at your convenience once you consider it is no longer needed ----
Drop GRP from ocp: drop restore point AUTOUPGRADE_9212_OCP112040

Step 7: After upgradation

Check the below details and drop restore point. "11c to 19c using AutoUpgrade"

SQL>select version from v$timezone_file;
SQL>select name,open_mode,version,statu from v$database,v$instance;
SQL>select name from v$restore_point; 
SQL>drop restore point AUTOUPGRADE_9212_OCP112040;
11g to 19c using AutoUpgrade

Finally our database succesfully upgraded. Thanks for reading.

Can we directly upgrade from 11g to 19c?

Yes we can directly upgrade from 11g to 19c. Read

How do I run an auto upgrade jar?

Read this article carefully.

How do I upgrade to Oracle 19c?

Using manual method or auto upgrade method.

Connect with us on Social Network 👇

One thought on “Upgrade Oracle 11g to 19c using AutoUpgrade utility

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to Top