Oracle 19c AutoUpgrade Utility

Hello Friend's,

In this post we will discuss working of oracle's new autoupgrade utility and waht will be steps to upgrade database

from 12.2 to 19c using the new autoupgrade utility.

so lets get sarted .


Source : 

DBname : Aupg
PDB    : PDBUPG
Home   : /oracle/app/orawork/product/12.2.0.1/db_1
Version: 12.2.0.1.0

DB_NAME   HOST_NAME                      DATABASE_ROLE    OPEN_MODE  LOG_MODE     DB_VERSION        LOGINS     DB UP TIME
--------- ------------------------------ ---------------- ---------- ------------ ----------------- ---------- -----------------------------
AUPG      Linux-Mach.database.com        PRIMARY          READ WRITE ARCHIVELOG   12.2.0.1.0        ALLOWED    12-FEB-2021 17:46:51

Target :

Dbname : Aupg
Home   : /oracle/app/orawork/product/19.0.0.0/db_1
Version: 19.3.0.0.0

download the most recent version from MOS Note: 2485457.1 – AutoUpgrade Tool:

As source, the minimum version is Oracle Database 11.2.0.4.

And as target will support upgrade to:

Oracle Database 19.3.0 and newer

Oracle Database 18.5.0 and newer

Oracle Database 12.2.0.1 with Jan 2019 RU and newer

As we have downloaded the auto-upgrade from the MOS link , below command will hep you to check the version of Autoupgrade


[oracle@Linux-Mach oracle]$ $ORACLE_HOME/jdk/bin/java -jar autoupgrade.jar -version
build.hash 8ee6880
build.version 21.1.1
build.date 2020/12/14 14:41:34
build.max_target_version 21
build.supported_target_versions 12.2,18,19,21
build.type production

[oracle@Linux-Mach oracle]$

Prerequisites

You must have Java Development Kit (JDK) 8 or later installed in your source environment.

JDK 8 is installed with every release starting with Oracle Database 12c Release 2 (12.2).

For any release earlier than 12.2, you must either run AutoUpgrade using the Java release in the target Oracle Database,

or you must install JDK 8 on your source database server.

Oracle Database upgrades using the AutoUpgrade utility follow the same upgrade rules that apply to manual Oracle Database upgrades.

Confirm that your source Oracle Database release is supported for upgrade.

With non-CDB to PDB conversion and upgrade, AutoUpgrade can automatically complete both upgrade and conversion when these conditions are met:

The target release CDB must exist.

The target release should be patched to the latest release update (RU) or release update revision (RUR).

In the AutoUpgrade configuration file, where the target CDB system identifier is target_cdb,

you must set the local parameter target_cdb using the following syntax:

target_cdb=target_cdb.

The target_cdb value is the Oracle SID of the CDB into which you are plugging the non-CDB.

-->The autoupgrade utility can be run in a number of different modes.

-->Below are the stages of upgrade

i) Analyze

ii) Fixup

iii) Upgrade

iv) Deploy

Starting with the first

i) Analyze :

As the name suggest this mode analyze the database running preupgrade.jar

but what it dose more that just running preupgrade.jar this mode also analyze (checks) the setup aswell

it will generate 2 file with information about the database

i) sid.html

ii) sid_preupgrade.log

once this mode is complete sucessfully , This will confirm there will the no suprise error in further process of upgrade :)

e.g command : $ORACLE_HOME/jdk/bin/java -jar autoupgrade.jar -config /oracle/config_upgrd.txt -mode analyze

Please follow the below link for practical example of Analyze Mode.

ORACLE AUTOUPGRADE UTILITY ANALYZE MODE PRATICAL

ii) Fixup :

Fixup mode goes a steps ahead of Analyze mode , This mode will have all steps of analyze mode addition to that

this mode will also fixup the errors found in prechecks

e.g same as running preupgrade fixup file in normal upgrade

running fixup will also generate a status log file .

e.g command : $ORACLE_HOME/jdk/bin/java -jar autoupgrade.jar -config /oracle/config_upgrd.txt -mode fixups

Please follow the below link for practical example of Fixup Mode.

ORACLE AUTOUPGRADE UTILITY FIXUP MODE PRACTICAL

iii) Upgrade

This mode of upgrade is diffrient that deploy.

upgrade mode is only for cases where we dont have the source available with us

e.g we have moved database to new server and upgrading on new server

This mode runs the actual database upgrade and postchecks after upgrade

but the mode doesnot create any restore point nor does drain any load

e.g command : $ORACLE_HOME/jdk/bin/java -jar autoupgrade.jar -config /oracle/config_upgrd.txt -mode upgrade

iv) Deploy

This mode is one of the most important modes of all, I will say it's an all-inclusive mode does all things in one

such as prechecks ,creating restore point ,upgrade , post-checks

it can be called as unattended mode no interventions needed

e.g command : $ORACLE_HOME/jdk/bin/java -jar autoupgrade.jar -config /oracle/config_upgrd.txt -mode deploy

Please follow the below link for practical example of Deploy Mode.

ORACLE AUTOUPGRADE UTILITY DEPLOY MODE PRATICAL

Below Given are the examples of config file used for the autoupgrade utility.


Config_upgrd.txt

# Global logging directory pertains to all jobs
#
global.autoupg_log_dir=/oracle/autoupgrade        # Top level logging directory (Required)

#
# Db 1
#
pupg1.dbname=Aupg                               
pupg1.source_home=/oracle/app/orawork/product/12.2.0.1/db_1
pupg1.target_home=/oracle/app/orawork/product/19.0.0.0/db_1
pupg1.sid=Aupg                                  
pupg1.start_time=NOW                                          #we can also specify a perticular time e.g  12/02/2021 18:00:00                     
pupg1.log_dir=/oracle/autoupgrade/Aupg
pupg1.upgrade_node=Linux-Mach.database.com                   
pupg1.run_utlrp=yes  
pupg1.timezone_upg=yes 
pupg1.target_version=12.2
or

E.g 2 

global.autoupg_log_dir=/oracle/autoupgrade
global.target_home=/oracle/app/orawork/product/19.0.0.0/db_1
global.target_version=19

#
# Database1 
#
pupg1.dbname=Aupg
pupg1.start_time=NOW
pupg1.source_home=/oracle/app/orawork/product/12.2.0.1/db_1
pupg1.sid=Aupg
pupg1.log_dir=/oracle/autoupgrade/Aupg
pupg1.upgrade_node=Linux-Mach.database.com 
pupg1.run_utlrp=yes  
pupg1.timezone_upg=yes 
pupg1.target_version=12.2


pupg1.sid=CDB1
pupg1.target_cdb=CDB2
pupg1.pdbs=pdbupg,pdbimpex
pupg1.source_home=/oracle/app/orawork/product/12.2.0.1/db_1
pupg1.target_home=/oracle/app/orawork/product/19.0.0.0/db_1
pupg1.target_pdb_name.pdbupg=upgrade

--> Changing the Start Time

The AutoUpgrade parameter start_time is an optional parameter. If you don’t set it, the upgrade will start immediately.

In the below given examples config we use start_time=NOW .

But you can adjust the start_time as well. The format is DD/MM/YYYY HH24:MI:SS.

For example, you can set it to:

pupg1.start_time=14/02/2021 6:00:00

pupg1.start_time=18/02/2021 18:30:30

pupg1.start_time=20/02/2021 5:18:30

--> Adding scripts before and after

-->How execute a script before and after the upgrade.

we used in these two global parameters, which can be used as local parameters as well on a per-DB basis:

global.before_action=/oracle/scripts/before.sh

global.after_action=/oracle/scripts/after.sh

pupg1.before_action=/oracle/scripts/before_DB12.sh

pupg1.after_action=/oracle/scripts/after_DB12.sh

--> Remove Underscores and Events

There are instances whee we need t remove the _ parameter for the upgrade , but normally we dont touch the parameter usually given to set by app team

best example is the sap enviornment

below is the example given for the same:

--> global.remove_underscore_parameters=yes

This is a global-only parameter.We can go for the perdb level also making changes in config file

By default, we’ll keep underscores and events in the spfile.

--> Postpone Recompilation

There are situations where we dont want to recompile the data after upgrade automatically.

There could be n no or reason may vary from dba to dba

--> prefix.run_utlrp=no

This is a local parameter you need to set on a per-database level.

--> Postpone Time Zone Adjustment

depends on what to do or what not we do upgrade the time zone after the db upgrade usually but we also have an option

here if we want autoupgrade to take care or timezone upgrade also of we want to do it manually

-- > prefix.timezone_upg=no

This is a local parameter. It needs to be set on a per-database level.


Hope This Helps .


Regards

Sultan Khan

Previous
Next Post »