Patching a database often means turning it off, which is a problem for businesses. In Oracle 26ai, there is a great new feature called Local Rolling Out-of-Place Patching.
This feature helps you move your database to a new, patched “Oracle Home” on the same server without stopping database (or short downtime). Here is how it works.
First, We install new oracle home dbhome_2
[oracle@myhost01 ~]$ unzip -qd/u01/app/oracle/product/23.0.0.0/dbhome_2 \/tmp/LINUX_X64_2326100_db_home.zip[oracle@myhost01 ~]$ cd /u01/app/oracle/product/23.0.0.0/dbhome_2[oracle@myhost01 dbhome_2]$ ./runInstaller
we look at our 3-node RAC database. It is currently running on dbhome_1
$ srvctl status database -db testdbInstance testdb1 is running on node myhost01Instance testdb2 is running on node myhost02Instance testdb3 is running on node myhost03
We want to move to dbhome_2 (the patched version). We use a special command with the -localrolling option. Oracle creates new “shadow” instances (like testdb1_4). These are ready to go but are not running yet. This keeps the database safe while we prepare.
[oracle@myhost01 ~]$ srvctl modify database -db testdb \-oraclehome /u01/app/oracle/product/23.0.0.0/dbhome_2 \-localrolling[oracle@myhost01 ~]$ srvctl status database -db testdbInstance testdb1 is running on node myhost01Instance testdb1_4 is not running on node myhost01Instance testdb2 is running on node myhost02Instance testdb2_5 is not running on node myhost02Instance testdb3 is running on node myhost03Instance testdb3_6 is not running on node myhost03
Now, we use the transfer instance command. It moves the database from the old home to the new home.
[oracle@myhost01 ~]$ srvctl transfer instance -db testdb \-all -drain_timeout 60
Note: The drain_timeout tells Oracle to wait (in this case, 60 seconds) for old users to finish their work before closing the old instance. New users will automatically go to the new patched instance.
If you want you can transfer node one by another, with -node option.
[oracle@myhost01 ~]$ srvctl transfer instance -db orcl \-node myhost01 -drain_timeout 0
After a few minutes, the transfer is completed. You will see the new instance names are running.
[oracle@myhost01 ~]$ srvctl status database -db testdbInstance testdb1_4 is running on node myhost01Instance testdb2_5 is running on node myhost02Instance testdb3_6 is running on node myhost03
Key for DBAs
- Automation: Oracle handles the creation of unique instance names (appending
_#) and the required undo/redo tablespaces automatically. - Reduced Risk: Because the patching is “out-of-place,” the original Oracle Home remains untouched during the process, providing an easy fallback.
- Seamless Draining: By leveraging
srvctl transfer, service availability is maintained, and users are migrated without abrupt disconnections.