AutoUpgrade New Features: Better Automation To Patch Oracle Database on Windows

Running Oracle Database on Microsoft Windows is slightly different from running it on other platforms. So, of course, patching Oracle Database is also slightly different.

The Oracle Database runs as a Windows service. AutoUpgrade must re-create the service when you perform out-of-place patching so the service starts oracle.exe from the new Oracle home.

Oracle Database on Windows runs as a Windows service with a hardcoded Oracle home path

To recreate the service, you must specify the credentials of the user who runs the service. Windows allows you to store the credentials in a special file; AutoUpgrade can use that when it recreates the service.

AutoUpgrade brings up a prompt to store credentials for a Windows service

For security purposes, AutoUpgrades deletes the credential file when it is no longer needed. For automation, however, that’s impractical because you would need to recreate the credential file every time you patch or upgrade.

AutoUpgrade now allows you to keep the file and reuse it. To do so, use the config file parameter delete_credential_file.

How To Patch Oracle Database on Windows

  1. Get the latest version of AutoUpgrade:
    wget https://download.oracle.com/otn-pub/otn_software/autoupgrade.jar
    
  2. Create an AutoUpgrade config file:
    global.keystore=c:\oracle\autoupgrade\keystore
    patch1.source_home=c:\oracle\product\dbhome_19_26_0
    patch1.target_home=c:\oracle\product\dbhome_19_27_0
    patch1.sid=DB19
    patch1.folder=c:\oracle\patches
    patch1.patch=RECOMMENDED
    patch1.wincredential=c:\oracle\autoupgrade\credential
    patch1.delete_credential_file=false
    
  3. Load the credentials for the user running the service into a credential file:
    java -jar autoupgrade.jar 
         -config ...
         –patch 
         -load_win_credential "DB19"	
    
  4. Start AutoUpgrade in deploy mode:
    java -jar autoupgrade.jar 
         -config ...
         –patch 
         -mode deploy
    
    • AutoUpgrade finds and downloads the right patches for Windows.
    • Creates a new Oracle home with the new patches.
    • Completes the entire patching process.

That’s it! You’ve patched your Oracle Database on Windows.

Here’s a little demo from our YouTube channel. Be sure to subscribe so you don’t miss out.

Happy patching!

11 thoughts on “AutoUpgrade New Features: Better Automation To Patch Oracle Database on Windows

  1. the “all in one“-Task works well on winodws and even better with the new version of AutoUpgrade (25.2). Using the former AutoUpgrader (25.1) to create a new OraHome “Out-Of-Place-Patching” got rarely stuck on certain customer hosts – 2 out of 20.

    Bug: AUPG-4525 AutoUpgrade Patching – OPatch phase using wrong ORACLE_HOME and failing on Windows

    A big thanks to Daniel who provided us with this information!

    Marco

    Like

  2. Daniel, is there a way of doing this in an air gap environment, then move between test and production. I create gold copy and deploy as new home, but also I have to request a single patch on top of windows quartaly security to deal with SQL login issue that is not being fixed and takes weeks to be supplied. Currently on 19.19 waiting on 19.28 extra patch.

    Like

    1. Hi John,
      Yes, there is a way. You first download the patches you need using AutoUpgrade “-mode download”. Do that on a server with access to the internet. Then transfer the files to the “air-gap” environment and run AutoUpgrade in “-mode create_home” or “-mode deploy” and be sure to set “download=no” in your config file. That’ll allow you to patch without having internet access on the database host.
      That’s a good topic for a blog post – I’ll do that one of the days.
      Regards,
      Daniel

      Like

      1. Thanks Daniel, but un clear how that gets past 29869909. Since going from using auto upgrade from 12.2 to 19.9, which was great, to then on to 19.19 hand I’ve had to request patch to create gold copy for next possible move. For reasons cant go into have not move customer on to bleeding edge..but have to have patch ready. I have no login SQL. But unclear 29869909 patch required ? Oracle go off and supply without proof of needing. I’ll give the autoupgrade down load a go….but dream of going to 23 on premise.

        Like

        1. Hi John,

          If patch 29869909 is a requirement in your organization, you should file a service request and request it for inclusion in future Windows bundle patches. Then, you can avoid requesting it over and over again. Please specify a good business reason for the requirement. That increases the chances for inclusion.

          Having said that, the patch will not be needed for AutoUpgrade to patch your database. It doesn’t rely on login.sql or other files. You should be able to successfully patch the database without.

          Regards,
          Daniel

          P.S. We all dream of Oracle Database 23ai on all platforms :)

          Like

          1. Daniel, hit 29869909, trying to use autoupgrade going from 19.9 to 19.19. Raised at looking at 19.21 and 19.25 and now 19.28, we have to be ready to patch, but cant schedule…very big air gap. Db very much vanilla, except using versioning wsl and ols…cant understand why we are unique and got 29869909.
            Did flag to Mike.Dietrich couple of years back. Oracle generated patch since 18.3 and 19.19 John

            Like

            1. Hi John,
              That does sound weird indeed. I know many Windows customers that use AutoUpgrade for patching and upgrading without any such issues.
              If you at one point open an SR, please feel free to keep me informed.
              Regards,
              Daniel

              Like

              1. Daniel, sorry went looking for this yesturday ….

                https://mikedietrichde.com/2023/06/20/virtual-classroom-seminar-17-from-sr-to-patch/

                Discussed with Mike, back in 2023. (John Hollings comment)

                Not mike miss understood me “Furthermore, I never stated that you can upgrade from 12.2.0.1 to 23c”. I knew we had to go through 19 …. but was dreaming of going 19.9 to 23c … no I mean 23ai

                Autoupgrade work like a dream getting from 12 to 19.9 .. but had to write stopping and starting services in powershell.

                Anyhow they have just dropped 19.28 extra patch for me … I’ve asked again for fix to go in next.

                I only request every other quarter… I have to reach the top of priority list of thing to fix to next deploy an patch for real … although the wider customer (not our specific one) is wanting things fixed every time a CVE is fixed.

                Anyway not a auto upgrade issue, one of the software being updated.

                Can’t give you my latest SR, cos can’t do 2 auth outside of work email, could someone request 2 methods of sending pin put.

                John

                Like

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.