Thursday, 19 August 2021

Out-of-Place updating the Developer VM Oracle Database to 19.12

This is an update to my post on out-of-place patching to 19.11. The mechanism is identical, but I added a few steps, so better use this one.

In my last post "Enabling Blockchain Tables and SQL Table Macros with 19.10 Patch for the Developer VM Database", I described how to update the Database via OPatch. Now 19.11. and 19.12. do not have that much new features for developers, this post is only to show how to use out-of-place updating alternatively. Find more information on this on Mike Dietrich's Blog, I will only cover what I need to update the Developer VM.

Create a new directory for the new database home, in my case

mkdir /u01/app/oracle/product/19.12.0/dbhome_3
cd /u01/app/oracle/product/19.12.0/dbhome_3/
unzip ~/ddrive/Install/Linux-x64/LINUX.X64_193000_db_home.zip

As for the first installation, get the Oracle Database 19c 19.3.0 Base Release and unpack it to that directory. 

Create a separate directory for the patch like

mkdir /u01/app/oracle/patches/32904851

Get patch #32545013 for the 19.11 RU and unpack it to that directory. That needs at least OPatch 12.2.0.1.24. Get the latest OPatch via Patch 6880880 (which is .27 at the time of writing). 

mv OPatch OPatch.old
unzip ~/ddrive/Install/Linux-x64/opatch-12-2-0-1-27-p6880880_210000_Linux-x86-64.zip

Rename the OPatch directory to something like OPatch.old, create a new OPatch directory and unzip Patch 6880880 to that.

As we are running OEL 8.x, we need to give the installer a little hint

export CV_ASSUME_DISTID=OEL7.8

Now we can go to the newly created ORACLE_HOME and run the installer. Better unset all variables pointing to the old home.

unset ORABASE_EXEC
unset ORACLE_HOME
unset ORAHOME
cd /u01/app/oracle/product/19.12.0/dbhome_3
./runInstaller -applyRU /u01/app/oracle/patches/32545013/

This will apply the 19.12 RU during the install. If  you need any specific one-off patches, these can be applied using the "-applyOneOffs" option, see Mike Dietrich's Blog. Click through the installer and choose only to install the software without creating a new database.

After the installer has finished, modify /etc/oratab to point to the new ORACLE_HOME

Copy the contents from /u01/app/oracle/product/19.0.0/dbhome_1/dbs to /u01/app/oracle/product/19.12.0/dbhome_2/dbs . Also copy the contents of  /u01/app/oracle/product/19.0.0/network/admin to /u01/app/oracle/product/19.0.12/network/admin .
Change the ORACLE_HOME variable in .bashrc and /etc/oratab to point to the new home. 
Source .bashrc double check the environment variables. Start the listener and the database. Finally run the data patch.

cd $ORACLE_HOME/OPatch
./datapatch -verbose

As this is meant to be a VM for testing and development, it makes sense to also enable the optimizer patches. Mike Dietrich wrote some interesting articles on this, for more information, go directly to his Blog.

execute dbms_optim_bundle.enable_optim_fixes('ON','BOTH', 'YES');

For earlier versions, we would need an extra step. But on 19.12, all we need to enable the optimizer patches is to run rbms_optim_bundle.enable_optim_fixes. 

@?/rdbms/admin/dbmsoptim.sql
@?/rdbms/admin/prvtoptim.plb

If you get an error, because rdbms_optim_bundle is not valid, first run both above scripts and run enable_optim_fixes again.
Have fun with 19.12.

And if you are really sure, not to go back to the old version (better wait a few days), do not forget to run .../deinstall/deinstall from the old ORACLE_HOME.