Oracle 12c upgrade, speeding up the apex part

Let’s have a look at what part of oracle upgrade process takes most of the time. This is test environment with very simple database created from the oltp template.

Notice that Oracle server takes 22 minutes to upgrade and APEX part takes 54.59 minutes! We don’t want to waste almost 1h of production downtime window.

upgrade2

It would be nice to switch this part completely off, the most fastest way to do something is to not to do it at all. However I didn’t find a supported way to skip this part yet.

The workaround is to install the newest version of APEX beforehand.

After instaling the APEX from here: http://www.oracle.com/technetwork/developer-tools/apex/downloads/index.html, the upgrade time looks much better. The APEX part completely been skipped.

upgrade3

 

Oracle 12c Upgrade: How to adjust the number of parallel threads

Starting from 12c, the upgrade script catctl.pl runs in parallel. We can use -n option to adjust the number of threads of the process. It looks like that by default it takes the number of cpu available.

<br />Analyzing file catupgrd.sql
Log files in /u01/app/oracle/product/12.1.0.2/rdbms/admin
catcon: ALL catcon-related output will be written to catupgrd_catcon_4747.lst
catcon: See catupgrd*.log files for output generated by scripts
catcon: See catupgrd_*.lst files for spool files, if any
Number of Cpus        = 4
SQL Process Count     = 0
New SQL Process Count = 4

Setting high value could produce more contention that benefit. This is something we need to test before production. To set the number of threads, -n option is used. In this example I use 1 thread only.

<br />$ORACLE_HOME/perl/bin/perl catctl.pl -n 1 catupgrd.sql

Argument list for [catctl.pl]
SQL Process Count n = 1
SQL PDB Process Count N = 0
Input Directory d = 0
Phase Logging Table t = 0
Log Dir l = 0
Script s = 0
Serial Run S = 0
Upgrade Mode active M = 0
Start Phase p = 0
End Phase P = 0
Log Id i = 0
Run in c = 0
Do not run in C = 0
Echo OFF e = 1
No Post Upgrade x = 0
Reverse Order r = 0
Open Mode Normal o = 0
Debug catcon.pm z = 0
Debug catctl.pl Z = 0
Display Phases y = 0
Child Process I = 0

catctl.pl version: 12.1.0.2.0
Oracle Base = /u01/app/oracle

Analyzing file catupgrd.sql
Log files in /u01/app/oracle/product/12.1.0.2/rdbms/admin
catcon: ALL catcon-related output will be written to catupgrd_catcon_6258.lst
catcon: See catupgrd*.log files for output generated by scripts
catcon: See catupgrd_*.lst files for spool files, if any
Number of Cpus = 4
SQL Process Count = 1