Upgrade Oracle 19c DB to 21c using Auto Upgrade utility inprogress

 

Upgrade Oracle 11g to 21c using AutoUpgrade utility:


How do I upgrade Oracle database to 21c?  install the 21c oracle binaries into the server .


  • Oracle Virtual Bix 
  • Oracle Linux 7
  • Oracle Database 19c currently running
  • Upgrading 19c database to 21c directly
Oracle Database 19c on premises is available – and one of the key features is the new Auto Upgrade utility. In the following days I will publish several blog posts explaining and showcasing the new Auto Upgrade.


What is the Auto Upgrade?

The Oracle Database Auto Upgrade utility is a new tiny little command line tool which allows you to upgrade your databases in an unattended way. I call it the Hands-Free Upgrade. The new Auto Upgrade utility in Oracle 19che idea of the tool is to run the prechecks against multiple databases, fix 99% of the potential issues, set a restore point in case something goes wrong – and then upgrade your databases. And of course, do the post upgrade, recompilation and time zone adjustment.

The only thing you need to provide is a config file in text format

Where do you get the Auto Upgrade?

You get it when you install Oracle Database 19c (19.3) or newer. Or – and this is the recommended source, you download the most recent version from MOS Note: 2485457.1 – Auto Upgrade Tool:

To automate the database upgrade process, both before and after starting upgrades, during upgrade deployments, post-upgrade checks, and configuration migration, Oracle has introduced a command-line tool called Auto upgrade Utility. In this blog, in detail, we are going to cover,

19c Database Overview
What is Auto Upgrade Utility?
Benefits of Auto Upgrade Utility
Which database releases are supported?
Auto Upgrade Workflow
High-level Steps For Auto-Upgrade

Oracle introduced the multitenant architecture in 2013 with the Oracle Database 12c version release.  It consists of CDB(Container Database) and PDB (Pluggable Database).

With the release of Oracle Database 19c, Oracle allows you to create three user-created PDBs without any additional multitenant license. Applicable for both Standard Edition (SE2) and Enterprise Edition (EE). Multitenant architecture brings huge administration advantages, especially to minimize patching, upgrade, and cloning. This license change will help accelerate the adoption of the Container Database architecture.

Though the non-CDB architecture was “deprecated” since 12.1, it was available and supported to date. In 20c, the non-CDB architecture is “de-supported” and soon there will not be an option to create a non-CDB database.

What is Auto Upgrade Utility? 

The Oracle Database Auto Upgrade utility is a new command-line tool that allows you to upgrade your databases in an unattended way.  The idea of the tool is to run the prechecks against multiple databases, fix 99% of the potential issues, set a restore point in case something goes wrong – and then upgrade your databases. And of course, do the post-upgrade, recompilation, and time zone adjustment.

Benefits of Auto Upgrade Utility 

  • Enables customers to upgrade one or many Oracle databases at the command-line with a single command and a single configuration file.
  • Will run the pre-upgrade tasks, perform automated fixups where needed, execute the database upgrade, and finish by taking care of post-upgrade tasks.
  • Includes automatic retry and fallback, the possibility to schedule upgrades for future points in time, and the ability to set, change or remove initialization parameters as desired.
  • Saves time and money by upgrading hundreds of databases with one command and replacing bespoke high maintenance upgrade solutions.

Auto Upgrade Workflow 

  • The AutoUpgrade utility is a Java 8 release JAR file which is available by default in Oracle Database homes from release 12.1.0.2 and latest.
  • The path to the Java version in the Oracle home is $ORACLE_HOME/JDK/bin/java -version where the $ORACLE_HOME is the old database home that you are going to upgrade.

Four AutoUpgrade processing modes characterize the actions that AutoUpgrade performs as it runs. For each mode, AutoUpgrade steps are performed in sequence.

  • Analyze Mode: Setup–>Prechecks.
  • Fixups Mode: Setup, Prechecks, and Prefixups.
  • Deploy Mode: Setup, Pre upgrade, Prechecks, guaranteed to restore point (GRP), Prefixups, Drain, DB Upgrade, Post checks, and Post upgrade. You can run your own scripts before the upgrade or after the upgrade, or both before and after the upgrade.
  • Upgrade Mode: Setup, DB Upgrade, Post checks, and Post fixups.

High-level Steps For Auto-Upgrade 

  1. Install Oracle 21.3.0.0 binaries
  2. Prerequisite for Auto upgrade
  3. Create the config file
  4. Analyze the database
  5. Deploy the upgrade
  6. Post upgrade task
AutoUpgrade – Step-by-Step
1. Install Oracle 21.3.0.0 binaries  I have already completed the installation of 21c, 

2. Prerequisite for Autoupgrade 

Download the latest file of autoupgrade.jar

  • The autoupgrade.jar file exists by default, In Oracle Database 19c (19.3) and the later target Oracle homes.
  • The autoupgrade. jar file is available in the Oracle 19c database software in the $ORACLE_HOME/rdbms/admin directory.
  • Before you use AutoUpgrade, Oracle recommends that you download the latest Autoupgrade version available from MOS Note: 2485457.1 – AutoUpgrade Tool.

Replace the autoupgrade.jar with the latest version downloaded.

Java version
Java version should be 8 or later, which is available by default in Oracle Database homes from release 12.1.0.2 and latest.

Java version
Java version should be 8 or later, which is available by default in Oracle Database homes from release 12.1.0.2 and latest.

Advantages of AutoUpgrade Utility:

  • Time saving method (completes the upgrade in a short time)
  • can upgrade multiple Oracle Database deployments at the same time, using a single configuration file, customized as needed for each database deployment.
  • preventing the issues before upgrade.
  • It automatically performs the preupgrade and post upgrade steps/checks.

AUTOUPGRADE PROCESSING MODES:

Generally AutoUpgrade processes in four modes, they are ,

  • Analyze

It performs a read only pre-upgrade analysis of databases before upgrade and detects any issues which may prevent the successful completion of upgradation.it should be run in the source database like normal operations.

  • Fixups

In Fixups mode it checks the same as it have done in the analyze mode, so that it can identify issues that require fixing. In Fixup Mode, the AutoUpgrade utility detects and identifies both fixes that require manual intervention and AutoUpgrade utility can clear the fixduring upgrade.

  • Deploy

In deploy mode it confirms that our database has been successfully upgraded and it copies the sqlnet.ora, listener.ora, tnsnames.ora from source to target home.

  • Upgrade

An upgrade completes with either deploy or upgrade, after this we can run our post upgrade checks.in this we can run our custom scripts on the upgraded databases in accordance with the configuration file that we have created. After this the upgraded oracle database starts with a new oracle home.

AutoUpgrade utility jobs pass through a series of phases, called stages, during which specific actions are performed.

AutoUpgrade has the following stages,

SETUP
PREUPGRADE
PRECHECKS
GRP
PREFIXUPS
DRAIN
DBUPGRADE
POSTCHECKS
POSTFIXUPS
POSTUPGRADE

All the Analyze logs are created under autoupg_log_dir

-----Implementation steps for Auto upgrade tool here in this case we are upgrading the database to 21c from 19c using Auto upgrade utility ----------

Download

The most recent version of Auto Upgrade can be downloaded via this link: version 20240905.

Step 1: Check autoupgrade utility version Here is My environment details : 




Verify the autoupgrade version 

/u01/app/oracle/product/21.3.0/dbhome_1/jdk/bin/java -jar /u01/app/oracle/product/21.3.0/dbhome_1/rdbms/admin/autoupgrade.jar -version



[oracle@19cnode01 ~]$ cd /u01/app/oracle/product/21.3.0/dbhome_1/rdbms/admin
[oracle@19cnode01 admin]$ ls -ltr autoupgrade.jar
-rw-r----- 1 oracle oinstall 2973275 Apr 22  2021 autoupgrade.jar
[oracle@19cnode01 admin]$

Download the latest autoupgrade.jar file and replace it with the default one as below.

mv  /u01/app/oracle/product/21.3.0/dbhome_1/rdbms/admin/autoupgrade.jar  autoupgrade.jar.old
cd /u01/soft/21c
cp  autoupgrade.jar /u01/app/oracle/product/21.3.0/dbhome_1/rdbms/admin


[oracle@19cnode01 soft]$ /u01/app/oracle/product/21.3.0/dbhome_1/jdk/bin/java -jar /u01/app/oracle/product/21.3.0/dbhome_1/rdbms/admin/autoupgrade.jar -version
build.version 24.6.240905
build.date 2024/09/05 11:30:40 -0400
build.hash 0ca273885
build.hash_date 2024/09/05 11:23:06 -0400
build.supported_target_versions 12.2,18,19,21,23
build.type production
build.label (HEAD, tag: v24.6, origin/stable_devel, stable_devel)
build.MOS_NOTE 2485457.1
build.MOS_LINK https://support.oracle.com/epmos/faces/DocumentDisplay?id=2485457.1

[oracle@19cnode01 soft]$



Step 2: Check JDK version


[oracle@19cnode01 ~]$ /u01/app/oracle/product/21.3.0/dbhome_1/jdk/bin/java -version



Step 3: Create Config file for DB upgradation

[oracle@19cnode01 ~]$ /u01/app/oracle/product/21.3.0/dbhome_1/jdk/bin/java -jar /u01/app/oracle/product/21.3.0/dbhome_1/rdbms/admin/autoupgrade.jar -create_sample_file config
Created sample configuration file /home/oracle/sample_config.cfg
[oracle@19cnode01 ~]$



Step 4: Edit Config file




Step 5: Analyze the Database


[oracle@19cnode01 soft]$ /u01/app/oracle/product/21.3.0/dbhome_1/jdk/bin/java -jar /u01/app/oracle/product/21.3.0/dbhome_1/rdbms/admin/autoupgrade.jar -config sample_config.cfg -mode analyze
AutoUpgrade 24.6.240905 launched with default internal options
Processing config file ...
+--------------------------------+
| Starting AutoUpgrade execution |
+--------------------------------+
1 Non-CDB(s) will be analyzed
Type 'help' to list console commands
upg> lsj




/u01/soft/autoupgrade/ORCL/orcl1/100/prechecks
[oracle@19cnode01 prechecks]$ ls -ltr
total 472
-rw-r----- 1 oracle oinstall 351766 Sep 21 16:31 prechecks_orcl1.log
-rw-r----- 1 oracle oinstall  13898 Sep 21 16:31 orcl_checklist.xml
-rw-r----- 1 oracle oinstall  14651 Sep 21 16:31 orcl_checklist.json
-rw-r----- 1 oracle oinstall   4415 Sep 21 16:31 orcl_checklist.cfg
-rw-r----- 1 oracle oinstall  35889 Sep 21 16:31 orcl_preupgrade.html
-rw-r----- 1 oracle oinstall  35707 Sep 21 16:31 upgrade.xml
-rw-r----- 1 oracle oinstall  16004 Sep 21 16:31 orcl_preupgrade.log
[oracle@19cnode01 prechecks]$
































































































































































































































































Comments

Popular posts from this blog

MY NOTEPAD

Oracle OEM Holistic Patch