The Easiest Way to Download the Latest OPatch

I just saw a post on LinkedIn about the OPatch page on My Oracle Support stating it was the worst experience ever!

I had a look and I agree there’s room for improvement (possibly an understatement). I’ll see if I can find someone to give it a polish.

In the meantime, let me show you a much better to download the latest OPatch. Using AutoUpgrade in download mode.

How to Download OPatch

I download from my Mac, but Windows or Linux would do fine as well.

  1. I download the latest version of AutoUpgrade:

    wget https://download.oracle.com/otn-pub/otn_software/autoupgrade.jar
    
  2. I create an AutoUpgrade config file called get-patches:

    global.global_log_dir=/Users/daniel/orcl/autoupgrade/logs
    global.keystore=/Users/daniel/orcl/autoupgrade/keystore
    global.folder=/Users/daniel/Downloads/patches
    
    patch1.platform=LINUX.X64
    patch1.target_version=19
    patch1.patch=OPATCH
    
    • I use the platform parameter to instruct AutoUpgrade to find OPatch for Linux.
    • I want OPatch for an 19c database and I specify that with target_version.
    • I just want OPatch, so I set patch=OPATCH.
  3. I’ve already used AutoUpgrade to download patches, so my My Oracle Support credentials are already stored in the AutoUpgrade keystore. If you’ve never used AutoUpgrade to download patches, follow the instructions below (see Creating an AutoUpgrade Keystore).

  4. I download the patches by starting AutoUpgrade in download mode:

    java -jar autoupgrade.jar -config get-patches -patch -mode download
    
  5. AutoUpgrade finds and downloads the right version of OPatch:

    AutoUpgrade Patching 26.3.260401 launched with default internal options
    Processing config file ...
    Loading AutoUpgrade Patching keystore
    AutoUpgrade Patching keystore is loaded
    
    Connected to MOS - Searching for specified patches
    
    ------------------------------------------------------
    Downloading files to /Users/daniel/Downloads/patches
    ------------------------------------------------------
    OPatch 12.2.0.1.51 for DB 19.0.0.0.0 (Apr 2026)
       File: p6880880_190000_Linux-x86-64.zip - VALIDATED
    ------------------------------------------------------
    
  6. That’s it! Is it really that easy? Yes, it is…

Happy patching!

What About the Other Platforms and Releases?

  • You can download for more platforms by adding:
    patch2.platform=WINDOWS.X64
    patch2.target_version=19
    patch2.patch=OPATCH
    
    patch3.platform=AIX.x64
    patch3.target_version=19
    patch3.patch=OPATCH
    
  • You can download for more releases by adding:
    patch4.platform=LINUX.X64
    patch4.target_version=21
    patch4.patch=OPATCH
    
    patch5.platform=LINUX.X64
    patch5.target_version=26
    patch5.patch=OPATCH
    
    • AutoUpgrade supports downloading patches from Oracle Database 19c and onwards.

Creating an AutoUpgrade Keystore

The first time I use AutoUpgrade to download patches, I must store my MOS credentials in the AutoUpgrade keystore.

  1. I create my config file. It must include global.keystore to specify the location of the AutoUpgrade keystore.

  2. I start the password console:

    java -jar autoupgrade.jar -config get-patches -patch -load_password
    
  3. AutoUpgrade prompts for a password to protect its keystore. AutoUpgrade uses the password to encrypt the keystore, which stores my My Oracle Support credentials.

    • This is not the database keystore password that you use for TDE Tablespace Encryption.
    Processing config file ...
    
    Starting AutoUpgrade Patching Password Loader - Type help for available options
    Creating new AutoUpgrade Patching keystore - Password required
    Enter password:
    Enter password again:
    
  4. I specify my MOS username. AutoUpgrade then prompts me for the MOS password:

    MOS> add -user <mos-username-or-email>
    Enter your secret/Password:
    Re-enter your secret/Password:
    
  5. I save the changes, and I choose to create an auto-login keystore so I don’t have to enter the AutoUpgrade keystore password every time AutoUpgrade starts:

    MOS> save
    Convert the AutoUpgrade Patching keystore to auto-login [YES|NO] ? YES
    
  6. I exit, and that’s it:

    MOS> exit
    
    AutoUpgrade Patching Password Loader finished - Exiting AutoUpgrade Patching
    

Here’s a video explaining the use of the AutoUpgrade keystore:

Further Reading

Leave a comment