Oracle Database Patching with AutoUpgrade

Oracle Database Patching with AutoUpgrade in Offline Environments

In my previous post, I showcased how to use AutoUpgrade for downloading Oracle patches. The key takeaway was that AutoUpgrade can be used solely for downloading patches , even from behind a proxy server and across platforms, such as downloading Linux patches from a Windows host.

In previous post, we’ve downloaded all the required setups, we can proceed to use Autoupgrade utility to patch our Oracle Database software for updating it to the desired Release Update level (19.27). The motto of this post is:

I’ll demonstrate how you can patch your Oracle Database in offline environments using previously downloaded files, making it ideal for air-gapped or isolated systems.

If your database server has internet access, you can combine these two steps into one. For a detailed guide, refer to Marcus Vinicius Miguel Pedro’s post, AutoUpgrade-Composer: Downloading and Applying the N-2 RU with Deploy Mode. It also demonstrates how to use AutoUpgrade Composer to prepare your configuration file easily.

I will provide all the steps I followed, including the checks I performed, some of which may be optional or unnecessary in your environment, as well as any actions I completed manually.

Follow a version-specific naming convention.

We will create a seperate log directory and a directory to store patches.

We will copy the setup files and the latest version of AutoUpgrade.jar to the patch directory from the Windows host where we downloaded them in the previous blog post, or you may have manually downloaded them from MOS.

In addition to the setup files we downloaded, we will also need the autoupgrade.jar file and the Oracle Database 19.3 base version ZIP file: LINUX.X64_193000_db_home.zip.

In this example, since we will not be downloading anything, the keystore parameter is not required. If you are running Enterprise Edition in ARCHIVELOG mode, you may choose to create a Guaranteed Restore Point. AutoUpgrade can automatically drop it after patching using the option patch1.drop_grp_after_patching=YES, but I prefer to handle that manually under my control.

You can run this command while the database is running. No additional Java installation is needed, you can use the Java binary located under the current Oracle Database home.

You can run this command while the database is running. Use the tasks and status commands to track progress. The process will unzip the Database Base Release (19.3) ZIP file LINUX.X64_193000_db_home.zip into the new ORACLE_HOME, then apply the Release Update and the defined patches. After that, it will shut down the running database instance, start it from the new ORACLE_HOME, and apply the SQL patches using datapatch. The listener will continue running from the old ORACLE_HOME, this is normal since AutoUpgrade does not modify it , but your database will be serving from the new ORACLE_HOME with the updated release. Here is the command that does all the trick. What a big command !

Unless the oracle user has sudo privileges or the sudo command is configured to run without a password, you will need to run the root.sh script manually, since a new ORACLE_HOME is created. Otherwise, AutoUpgrade will execute it automatically. In our case, I ran it manually.

Since the listener is running from old ORACLE_HOME, we will start it from the new ORACLE_HOME.

At this point, We may drop restore point if everything runs smoothly since we have set drop_grp_after_patching=NO , for this reason we will do it manually.

In our environment, no scripts are directly dependent on the Oracle Database Home patch itself; they all rely on the ORACLE_HOME environment variable set in the .bashrc file. Therefore, I will simply update this variable to point to the new ORACLE_HOME, and everything will work as expected.

If you are using pure unified auditing, do not forget the relink new ORACLE_HOME with unified_auditing option is set to on. We will shutdown the database, relink the new home and start the database.

If you have any custom site profile configurations, make sure to copy them from the old ORACLE_HOME to the new ORACLE_HOME.

At this point, the patching operation is actually complete. However, I will share the checks I performed, which will shed light on the tasks AutoUpgrade executed automatically.

I verified whether the SQL patches (Datapatch) were applied. This step was automatically handled by the AutoUpgrade utility.

I checked the Network configuration files (tnsnames.ora, sqlnet.ora, and listener.ora) and confirmed that they were correctly copied to the new ORACLE_HOME. This task was also performed automatically by the AutoUpgrade utility.

I checked for any invalid objects after the patching process and found none. It appears that AutoUpgrade handled this step as well by automatically running utlrp.sql.

I checked the parameter file and password file under the dbs directory, and confirmed they were already copied to the new ORACLE_HOME. This step was also handled automatically by the AutoUpgrade utility.

I checked the contents of the ORATAB configuration file (/etc/oratab) and confirmed that the ORACLE_HOME values for the database instances had also been updated.

Initially, I was looking for any operations that AutoUpgrade might have missed during the patching process, but it kept surprising me by handling every task automatically.

At this point, I expected something to be left undone and was almost certain that the utlfixdir.sql script, commonly forgotten by DBAs for modifying Oracle-managed directories, would still need to be run. But it had already been executed. All the directories were updated to the new ORACLE_HOME. You may check with the command provided below.

Finally, I checked whether the RMAN packages and procedures were compiled with new version, and they were. You can verify this by checking the last_ddl_time of the SYS.DBMS_BACKUP_RESTORE and SYS.DBMS_RCVMAN packages. In the content of the SYS.DBMS_BACKUP_RESTORE package, you will find the line:

Actually, based on my prior patching experience, DBAs may forget some post-patching tasks, but it seems that AutoUpgrade does not.

Patching Oracle Database in offline environments is no longer a complex task thanks to AutoUpgrade. By using previously downloaded files and following a structured approach, you can perform out-of-place patching with minimal manual intervention. AutoUpgrade takes care of most tasks automatically, from applying datapatch to copying network configuration files, making it a reliable and efficient solution even in air-gapped systems. Just remember to perform a few final checks, like updating environment variables.

Hope it helps.


Discover More from Osman DİNÇ


Comments

Leave your comment