This post will go though the all the steps needed to upgrade a 12.1.0.2 database to a 19c using AUTOUPGRADE.

Source DB:

	[oracle@persephone ~]$ /u01/app/oracle/product/12.1.0/dbhome_1/OPatch/opatch lspatches
	33192628;Database PSU 12.1.0.2.211019,Oracle JavaVM Component (OCT2021)
	32758932;OCW PATCH SET UPDATE 12.1.0.2.210720 (32758932)
	33128590;Database Patch Set Update : 12.1.0.2.211019 (33128590)
	
	OPatch succeeded.
	[oracle@persephone ~]$

1:- Create 19c directory and copy software:

	[oracle@persephone ~]$ mkdir /u01/app/oracle/product/19c/
	[oracle@persephone ~]$ mkdir /u01/app/oracle/product/19c/db_1
	[oracle@persephone ~]$
	
	
	[oracle@persephone ~]$ cd /u01/app/oracle/product/19c/db_1
	[oracle@persephone ~]$ cp -p /PATCHES/19c/LINUX.X64_193000_db_home.zip .
	
	
	** unzip: 
	[oracle@persephone db_1]$ unzip -q LINUX.X64_193000_db_home.zip

2:- Create response file for a silent 19c Instalation:

	** Backup response file:
	
	[oracle@persephone db_1]$ ls -tlr /u01/app/oracle/product/19c/db_1/install/response/db_install.rsp
	-rw-r--r--. 1 oracle oinstall 19932 Feb  6  2019 /u01/app/oracle/product/19c/db_1/install/response/db_install.rsp
	[oracle@persephone db_1]$ cp -p /u01/app/oracle/product/19c/db_1/install/response/db_install.rsp /u01/app/oracle/product/19c/db_1/install/response/db_install.rsp.bck
	[oracle@persephone db_1]$
	
	
	
	** Edit response file and here the differences:
	
	[oracle@persephone ~]$  diff /u01/app/oracle/product/19c/db_1/install/response/db_install.rsp /u01/app/oracle/product/19c/db_1/install/response/db_install.rsp.bck
	29c29
	< oracle.install.option=INSTALL_DB_SWONLY
	---
	> oracle.install.option=
	34c34
	< UNIX_GROUP_NAME=oinstall
	---
	> UNIX_GROUP_NAME=
	41c41
	< INVENTORY_LOCATION=/u01/app/oraInventory
	---
	> INVENTORY_LOCATION=
	45c45
	< ORACLE_HOME=/u01/app/oracle/product/19c/db_1
	---
	> ORACLE_HOME=
	50c50
	< ORACLE_BASE=/u01/app/oracle
	---
	> ORACLE_BASE=
	62c62
	< oracle.install.db.InstallEdition=EE
	---
	> oracle.install.db.InstallEdition=
	79c79
	< oracle.install.db.OSDBA_GROUP=oinstall
	---
	> oracle.install.db.OSDBA_GROUP=
	85c85
	< oracle.install.db.OSOPER_GROUP=oinstall
	---
	> oracle.install.db.OSOPER_GROUP=
	90c90
	< oracle.install.db.OSBACKUPDBA_GROUP=oinstall
	---
	> oracle.install.db.OSBACKUPDBA_GROUP=
	95c95
	< oracle.install.db.OSDGDBA_GROUP=oinstall
	---
	> oracle.install.db.OSDGDBA_GROUP=
	100c100
	< oracle.install.db.OSKMDBA_GROUP=oinstall
	---
	> oracle.install.db.OSKMDBA_GROUP=
	105c105
	< oracle.install.db.OSRACDBA_GROUP=oinstall
	---
	> oracle.install.db.OSRACDBA_GROUP=
	120c120
	< oracle.install.db.rootconfig.executeRootScript=false
	---
	> oracle.install.db.rootconfig.executeRootScript=
	[oracle@persephone ~]$

3:- Execute 19c pre-requisites:

	[oracle@persephone ~]$  cd /u01/app/oracle/product/19c/db_1
	[oracle@persephone db_1]$ ./runInstaller -executePrereqs -silent -responseFile /u01/app/oracle/product/19c/db_1/install/response/db_install.rsp
	Launching Oracle Database Setup Wizard...
	
	Prerequisite checks executed successfully.
	[oracle@persephone db_1]$

4:- Install 19c software in silent mode:

	[oracle@persephone db_1]$ ./runInstaller -executePrereqs -silent -responseFile /u01/app/oracle/product/19c/db_1/install/response/db_install.rsp
	Launching Oracle Database Setup Wizard...
	
	Prerequisite checks executed successfully.
	[oracle@persephone db_1]$ ./runInstaller -silent -responseFile /u01/app/oracle/product/19c/db_1/install/response/db_install.rsp
	Launching Oracle Database Setup Wizard...
	
	The response file for this session can be found at:
	/u01/app/oracle/product/19c/db_1/install/response/db_2022-04-25_12-17-06PM.rsp
	
	You can find the log of this install session at:
	/u01/app/oraInventory/logs/InstallActions2022-04-25_12-17-06PM/installActions2022-04-25_12-17-06PM.log
	
	As a root user, execute the following script(s):
			1. /u01/app/oracle/product/19c/db_1/root.sh
	
	Execute /u01/app/oracle/product/19c/db_1/root.sh on the following nodes:
	[persephone]
	
	
	Successfully Setup Software.
	[oracle@persephone db_1]$

5:- Execute root.sh (as root):

	[root@persephone ~]# /u01/app/oracle/product/19c/db_1/root.sh
	Check /u01/app/oracle/product/19c/db_1/install/root_persephone_2022-04-25_12-21-38-592196356.log for the output of root script
	[root@persephone ~]#
	
	[root@persephone ~]# cat /u01/app/oracle/product/19c/db_1/install/root_persephone_2022-04-25_12-21-38-592196356.log
	Performing root user operation.
	
	The following environment variables are set as:
		ORACLE_OWNER= oracle
		ORACLE_HOME=  /u01/app/oracle/product/19c/db_1
	Copying dbhome to /usr/local/bin ...
	Copying oraenv to /usr/local/bin ...
	Copying coraenv to /usr/local/bin ...
	
	Entries will be added to the /etc/oratab file as needed by
	Database Configuration Assistant when a database is created
	Finished running generic part of root script.
	Now product-specific root actions will be performed.
	Oracle Trace File Analyzer (TFA) is available at : /u01/app/oracle/product/19c/db_1/bin/tfactl
	[root@persephone ~]#

6:- Update 19c OPATCH (as root):

	** Opatch (p6880880_190000_Linux-x86-64.zip) unzipped already on /PATCHES/19c/OPatch/
	
	[root@persephone ~]# mv /u01/app/oracle/product/19c/db_1/OPatch /u01/app/oracle/product/19c/db_1/OPatch_bck
	[root@persephone ~]#
	[root@persephone ~]# cp -pr /PATCHES/19c/OPatch/ /u01/app/oracle/product/19c/db_1
	[root@persephone ~]#
	
	[root@persephone ~]# /u01/app/oracle/product/19c/db_1/OPatch/opatch version
	OPatch Version: 12.2.0.1.29
	
	OPatch succeeded.
	[root@persephone ~]#

7:- Apply desired Release Update (RU) to your new 19c ORACLE_HOME:

	** we are going to install here OCT 21 (p33248471_190000_Linux-x86-64.zip)

	patch already unzipped here:
	
	[oracle@persephone ~]$ ls -tlr /PATCHES/19c/33248471
	total 1364
	drwxr-xr-x. 4 oracle oinstall      67 Sep 15  2021 33192694
	-rw-rw-r--. 1 oracle oinstall 1368035 Oct 15  2021 PatchSearch.xml
	drwxr-x---. 8 oracle oinstall    4096 Oct 15  2021 33182768
	-rw-r--r--. 1 oracle oinstall   22594 Oct 19  2021 README.html
	[oracle@persephone ~]$
	
	
	[oracle@persephone ~]$ unset ORACLE_BASE
	[oracle@persephone ~]$ unset ORACLE_HOME
	[oracle@persephone ~]$ unset ORACLE_SID
	[oracle@persephone ~]$
	
	
	[oracle@persephone ~]$ /u01/app/oracle/product/19c/db_1/OPatch/opatch apply -oh /u01/app/oracle/product/19c/db_1 -local /PATCHES/19c/33248471/33182768/33208123
	...
	Patch 33208123 successfully applied.
	Sub-set patch [29585399] has become inactive due to the application of a super-set patch [33208123].
	Please refer to Doc ID 2161861.1 for any possible further required actions.
	Log file location: /u01/app/oracle/product/19c/db_1/cfgtoollogs/opatch/opatch2022-04-25_12-42-55PM_1.log
	
	OPatch succeeded.
	[oracle@persephone ~]$
	
	
	
	[oracle@persephone ~]$ /u01/app/oracle/product/19c/db_1/OPatch/opatch apply -oh /u01/app/oracle/product/19c/db_1 -local /PATCHES/19c/33248471/33182768/33192793
	...
	Patch 33192793 successfully applied.
	Sub-set patch [29517242] has become inactive due to the application of a super-set patch [33192793].
	Please refer to Doc ID 2161861.1 for any possible further required actions.
	Log file location: /u01/app/oracle/product/19c/db_1/cfgtoollogs/opatch/opatch2022-04-25_12-44-30PM_1.log
	
	OPatch succeeded.
	[oracle@persephone ~]$




	**Apply OJVM patch 


	[oracle@persephone ~]$ /u01/app/oracle/product/19c/db_1/OPatch/opatch apply -oh /u01/app/oracle/product/19c/db_1 -local /PATCHES/19c/33248471/33192694
	...
	Patch 33192694 successfully applied.
	Log file location: /u01/app/oracle/product/19c/db_1/cfgtoollogs/opatch/opatch2022-04-25_12-58-02PM_1.log
	
	OPatch succeeded.
	[oracle@persephone ~]$
	
	
	
	
	[oracle@persephone ~]$ /u01/app/oracle/product/19c/db_1/OPatch/opatch lspatches
	33192694;OJVM RELEASE UPDATE: 19.13.0.0.211019 (33192694)
	33192793;Database Release Update : 19.13.0.0.211019 (33192793)
	33208123;OCW RELEASE UPDATE 19.13.0.0.0 (33208123)
	
	OPatch succeeded.
	[oracle@persephone ~]$

8:- UPDATE autoupgrade.jar file to the latest available from “AutoUpgrade Tool (Doc ID 2485457.1)”

	** This is very important to avoid possible errors from old versions

	[oracle@persephone ~]$ /u01/app/oracle/product/19c/db_1/jdk/bin/java -jar /u01/app/oracle/product/19c/db_1/rdbms/admin/autoupgrade.jar -version
	build.hash 57ab246
	build.version 21.1.3
	build.date 2021/04/21 13:32:13
	build.max_target_version 21
	build.supported_target_versions 12.2,18,19,21
	build.type production
	
	[oracle@persephone ~]$
	
	
	
	
	[oracle@persephone ~]$ cp -p /PATCHES/19c/autoupgrade.jar /u01/app/oracle/product/19c/db_1/rdbms/admin/
	[oracle@persephone ~]$
	
	[oracle@persephone ~]$ /u01/app/oracle/product/19c/db_1/jdk/bin/java -jar /u01/app/oracle/product/19c/db_1/rdbms/admin/autoupgrade.jar -version
	build.hash 081e3f7
	build.version 21.3.211115
	build.date 2021/11/15 11:57:54
	build.max_target_version 21
	build.supported_target_versions 12.2,18,19,21
	build.type production
	
	[oracle@persephone ~]$

9:- Prepare UPGRADE (create config file):

	FROM: 	/u01/app/oracle/product/12.1.0/dbhome_1
	TO: 	/u01/app/oracle/product/19c/db_1
	
	
	** create config file:
	
	[oracle@persephone ~]$  java -jar /u01/app/oracle/product/19c/db_1/rdbms/admin/autoupgrade.jar -create_sample_file config
	Created sample configuration file /home/oracle/sample_config.cfg
	[oracle@persephone ~]$
	
	
	** edit /home/oracle/sample_config.cfg with these details:
	
	[oracle@persephone ~]$ cat /home/oracle/sample_config.cfg
	global.autoupg_log_dir=/home/oracle/logs
	global.target_home=/u01/app/oracle/product/19c/db_1
	global.target_version=19
	
	#
	# Database number 1
	#
	upg1.dbname=dbtest
	upg1.start_time=NOW
	upg1.source_home=/u01/app/oracle/product/12.1.0/dbhome_1
	upg1.sid=dbtest
	[oracle@persephone ~]$

10:- Analyze UPGRADE:

	** Make sure PDB$SEED is open to avoid warning
	
	SQL> alter session set "_oracle_script"=true;
	Session altered.
	SQL> alter pluggable database PDB$SEED open read only;
	Pluggable database altered.
	SQL> show pdbs
		CON_ID CON_NAME                       OPEN MODE  RESTRICTED
	---------- ------------------------------ ---------- ----------
			2 PDB$SEED                       READ ONLY  NO
			3 PDBTEST                        READ WRITE NO
	SQL>



	[oracle@persephone ~]$ java -jar /u01/app/oracle/product/19c/db_1/rdbms/admin/autoupgrade.jar -config sample_config.cfg -mode analyze
	AutoUpgrade is not fully tested on OpenJDK 64-Bit Server VM, Oracle recommends to use Java HotSpot(TM)
	AutoUpgrade 21.3.211115 launched with default options
	Processing config file ...
	+--------------------------------+
	| Starting AutoUpgrade execution |
	+--------------------------------+
	1 databases will be analyzed
	Type 'help' to list console commands
	upg> lsj
	+----+-------+---------+---------+-------+--------------+--------+----------------------------+
	|Job#|DB_NAME|    STAGE|OPERATION| STATUS|    START_TIME| UPDATED|                     MESSAGE|
	+----+-------+---------+---------+-------+--------------+--------+----------------------------+
	| 103| dbtest|PRECHECKS|PREPARING|RUNNING|22/04/25 13:38|13:38:57|Loading database information|
	+----+-------+---------+---------+-------+--------------+--------+----------------------------+
	Total jobs 1
	
	upg> Job 103 completed
	------------------- Final Summary --------------------
	Number of databases            [ 1 ]
	
	Jobs finished                  [1]
	Jobs failed                    [0]
	Jobs pending                   [0]
	
	Please check the summary report at:
	/home/oracle/logs/cfgtoollogs/upgrade/auto/status/status.html
	/home/oracle/logs/cfgtoollogs/upgrade/auto/status/status.log
	[oracle@persephone ~]$
	
	
	
	** No errors:
	
	[oracle@persephone ~]$ tail /home/oracle/logs/cfgtoollogs/upgrade/auto/status/status.log
	[Version After Upgrade]  19.13.0.0.0
	------------------------------------------
	[Stage Name]    PRECHECKS
	[Status]        SUCCESS
	[Start Time]    2022-04-25 13:38:49
	[Duration]      0:00:58
	[Log Directory] /home/oracle/logs/dbtest/103/prechecks
	[Detail]        /home/oracle/logs/dbtest/103/prechecks/dbtest_preupgrade.log
					Precheck passed and no manual intervention needed
	------------------------------------------
	[oracle@persephone ~]$

11:- Deploy UPGRADE:

	[oracle@persephone ~]$ date
	Mon 25 Apr 13:42:36 BST 2022
	
	[oracle@persephone ~]$  java -jar /u01/app/oracle/product/19c/db_1/rdbms/admin/autoupgrade.jar -config sample_config.cfg -mode deploy
	AutoUpgrade is not fully tested on OpenJDK 64-Bit Server VM, Oracle recommends to use Java HotSpot(TM)
	AutoUpgrade 21.3.211115 launched with default options
	Processing config file ...
	+--------------------------------+
	| Starting AutoUpgrade execution |
	+--------------------------------+
	1 databases will be processed
	Type 'help' to list console commands
	upg> lsj
	+----+-------+-----+---------+-------+--------------+--------+-------+
	|Job#|DB_NAME|STAGE|OPERATION| STATUS|    START_TIME| UPDATED|MESSAGE|
	+----+-------+-----+---------+-------+--------------+--------+-------+
	| 104| dbtest|  GRP|EXECUTING|RUNNING|22/04/25 13:42|13:43:00|       |
	+----+-------+-----+---------+-------+--------------+--------+-------+
	Total jobs 1
	
	upg> status
	---------------- Config -------------------
	User configuration file    [/home/oracle/sample_config.cfg]
	General logs location      [/home/oracle/logs/cfgtoollogs/upgrade/auto]
	Mode                       [DEPLOY]
	DB upg fatal errors        ORA-00600,ORA-07445
	DB Post upgrade abort time [60] minutes
	DB upg abort time          [1440] minutes
	DB restore abort time      [120] minutes
	DB GRP abort time          [3] minutes
	------------------------ Jobs ------------------------
	Total databases in configuration file [1]
	Total Non-CDB being processed         [0]
	Total CDB being processed             [1]
	Jobs finished successfully            [0]
	Jobs finished/aborted                 [0]
	Jobs in progress                      [1]
	Jobs stage summary
		Job ID: 104
		DB name: dbtest
			SETUP             <1 min
			GRP               <1 min
			PREUPGRADE        <1 min
			PRECHECKS         <1 min
			PREFIXUPS         <1 min (IN PROGRESS)
	------------ Resources ----------------
	Threads in use                        [37]
	JVM used memory                       [73] MB
	CPU in use                            [13%]
	Processes in use                      [23]
	
	upg>


	** Monitor job

12:- Resume UPGRADE If for some reason your connection is lost:

	If for some reason your connection is lost and process stops, we can see this on upgrade logs:


	[oracle@persephone ~]$ tail -f /home/oracle/logs/dbtest/104/autoupgrade_20220425_user.log
	2022-04-25 21:26:57.748 INFO 65%Upgraded CDB$ROOT
	2022-04-25 21:29:58.213 INFO 65%Upgraded CDB$ROOT
	2022-04-25 21:32:58.620 INFO 65%Upgraded CDB$ROOT
	2022-04-25 21:35:59.206 INFO 65%Upgraded CDB$ROOT
	2022-04-25 21:38:59.670 INFO 65%Upgraded CDB$ROOT
	2022-04-25 21:42:00.171 INFO 65%Upgraded CDB$ROOT
	2022-04-25 21:45:00.611 INFO 65%Upgraded CDB$ROOT
	2022-04-25 21:48:00.973 INFO 70%Upgraded CDB$ROOT
	2022-04-25 21:51:01.351 INFO 70%Upgraded CDB$ROOT
	2022-04-25 21:51:33.095 ERROR Upgrade terminated due to a system shutdown or CTRL+C for [dbtest]


	** resume (run exactly the same command):

	[oracle@persephone ~]$  java -jar /u01/app/oracle/product/19c/db_1/rdbms/admin/autoupgrade.jar -config sample_config.cfg -mode deploy
	AutoUpgrade is not fully tested on OpenJDK 64-Bit Server VM, Oracle recommends to use Java HotSpot(TM)
	Previous execution found loading latest data
	Total jobs recovered: 1
	+--------------------------------+
	| Starting AutoUpgrade execution |
	+--------------------------------+
	Type 'help' to list console commands
	upg> lsj
	+----+-------+---------+---------+-------+--------------+--------+-------+
	|Job#|DB_NAME|    STAGE|OPERATION| STATUS|    START_TIME| UPDATED|MESSAGE|
	+----+-------+---------+---------+-------+--------------+--------+-------+
	| 104| dbtest|DBUPGRADE|EXECUTING|RUNNING|22/04/25 13:42|22:20:06|Running|
	+----+-------+---------+---------+-------+--------------+--------+-------+
	Total jobs 1
	
	upg>
	
	
	
	upg> lsj
	+----+-------+---------+---------+-------+--------------+--------+--------------------+
	|Job#|DB_NAME|    STAGE|OPERATION| STATUS|    START_TIME| UPDATED|             MESSAGE|
	+----+-------+---------+---------+-------+--------------+--------+--------------------+
	| 104| dbtest|DBUPGRADE|EXECUTING|RUNNING|22/04/25 13:42|22:24:13|70%Upgraded CDB$ROOT|
	+----+-------+---------+---------+-------+--------------+--------+--------------------+
	Total jobs 1
	
	upg> 

13:- UPGRADE Finishes:

	upg> status
	---------------- Config -------------------
	User configuration file    [/home/oracle/sample_config.cfg]
	General logs location      [/home/oracle/logs/cfgtoollogs/upgrade/auto]
	Mode                       [DEPLOY]
	DB upg fatal errors        ORA-00600,ORA-07445
	DB Post upgrade abort time [60] minutes
	DB upg abort time          [1440] minutes
	DB restore abort time      [120] minutes
	DB GRP abort time          [3] minutes
	------------------------ Jobs ------------------------
	Total databases in configuration file [1]
	Total Non-CDB being processed         [0]
	Total CDB being processed             [1]
	Jobs finished successfully            [0]
	Jobs finished/aborted                 [0]
	Jobs in progress                      [1]
	Jobs stage summary
		Job ID: 104
		DB name: dbtest
			SETUP             <1 min
			GRP               <1 min
			PREUPGRADE        <1 min
			PRECHECKS         <1 min
			PREFIXUPS         20 min
			DRAIN             2 min
			DBUPGRADE         142 min
			POSTCHECKS        <1 min
			POSTFIXUPS        38 min (IN PROGRESS)
	------------ Resources ----------------
	Threads in use                        [37]
	JVM used memory                       [48] MB
	CPU in use                            [13%]
	Processes in use                      [19]
	
	upg> ------------------- Final Summary --------------------
	Number of databases            [ 1 ]
	
	Jobs finished                  [1]
	Jobs failed                    [0]
	Jobs pending                   [0]
	
	---- Drop GRP at your convenience once you consider it is no longer needed ----
	Drop GRP from dbtest: drop restore point AUTOUPGRADE_9212_DBTEST121020
	
	
	Please check the summary report at:
	/home/oracle/logs/cfgtoollogs/upgrade/auto/status/status.html
	/home/oracle/logs/cfgtoollogs/upgrade/auto/status/status.log
	[oracle@persephone ~]$

DB is now up and running on 19c home, it also automatically copied password files, tnsnames.ora, sqlnet.ora…. After checking everything is as expected, we should delete the restore point.

SQL> select * from registry$history;

ACTION_TIME                    ACTION          NAMESPACE  VERSION                          ID COMMENTS                                           BUNDLE_SERIES
------------------------------ --------------- ---------- ------------------------ ---------- -------------------------------------------------- ---------------
                               BOOTSTRAP       DATAPATCH  12.1.0.2                            RDBMS_12.1.0.2.0DBPSU_LINUX.X64_161210
12-APR-22 14.51.22.516985      jvmpsu.sql      SERVER     12.1.0.2.211019OJVMPSU            0 RAN jvmpsu.sql
                               BOOTSTRAP       DATAPATCH  19                                  RDBMS_19.13.0.0.0DBRU_LINUX.X64_211004
26-APR-22 00.29.28.850784      UPGRADE         SERVER     19.0.0.0.0                          Upgraded from 12.1.0.2.0 to 19.13.0.0.0

SQL>
Last modified: 27 April 2022

Author

Comments

Write a Reply or Comment

Your email address will not be published.