Local Rolling Database Maintenance

Starting with Oracle AI Database 26ai, you can patch Oracle Real Application Clusters (Oracle RAC) and Oracle RAC One Node databases locally in out-of-place mode without affecting availability and workload of the database.

About Local Rolling Database Maintenance

Starting with Oracle AI Database 26ai, you can apply rolling patches and perform other maintenance operations locally for Oracle Real Application Clusters (Oracle RAC) and Oracle RAC One Node deployments.

Local rolling creates and starts a second database instance from the second home on the same node, instead of stopping the database instance and relocating the workload to another instance on another node. Local rolling database maintenance reduces the time to migrate the connections. This feature reduces brownout time by keeping the workload on the local node. You must ensure that there are enough CPU, memory, and other computing resources to temporarily run two instances.

Local rolling ensures that at least the same number of Oracle RAC and Oracle RAC One Node instances are running in the cluster during rolling migration of the database between two Oracle homes. Using this feature, you can do out-of-place rolling patching within a single cluster node.

When you use local rolling out-of-place patching, Oracle RAC creates a second instance in the new Oracle home, starts the second instance, and then stops the first instance in the old Oracle home on the node you are patching. This feature also preserves the PDB placement and the services, and thus the node keeps doing the same work it was doing before patching.

Note:

  • The srvctl modify database command automatically creates a new instance with a unique instance name (ORACL_SID).
  • The new instance name is the current instance name appended with an underscore (_) and a number. For example, if the current instance name is sales_1, then the new instance name could be sales_2. After the patching operation is complete, only the new instance runs on the patched node.
  • When you perform rolling patching the second time, the original ORACLE_SID is restored. For example, the ORACLE_SID goes back to sales_1 after the second rolling patching operation. The third rolling patching operation will use sales_2, and so on.

The local rolling out-of-place patching is optional in a multi-node environment. By default it is disabled. Use the -localrolling option with srvctl modify database to enable this feature.

Requirements for Using Local Rolling Maintenance

Learn what you need to do to configure and use local rolling database maintenance.

To take advantage of local rolling database maintenance capabilities in Oracle RAC, you must meet the following requirements:

  • Configure Oracle Managed Files (OMF).
  • Use the Server Parameters File (SPFILE).
  • Reset the THREAD and UNDO_TABLESPACE initialization parameters after local rolling is complete.
  • Do not run srvctl add instance , srvctl remove instance , or srvctl modify instance commands during local rolling patching.
  • You must ensure that enough free storage space is available to create a new redo thread and a new undo tablespace for each instance. This feature creates a new redo thread and a new undo tablespace for each new instance when you use this feature for the first time. The second and subsequent time you use this feature, the previously used old redo thread and undo tablespace are used, and new redo and undo are not created.

Patching Oracle RAC Database in Local Rolling Mode

You can patch Oracle Real Application Clusters (Oracle RAC) and Oracle RAC One Node databases in local rolling mode, reducing the time to migrate the connections.

  1. Download the Oracle AI Database installation image file (db_home.zip) and extract the image file into a new Oracle home directory.

    $ mkdir -p /u01/app/oracle/product/23.4.0/dbhome_1
    $ chgrp oinstall /u01/app/oracle/product/23.4.0/dbhome_1
    $ cd /u01/app/oracle/product/23.4.0/dbhome_1
    $ unzip -q /tmp/db_home.zip
  2. From the new Oracle home directory, start the Oracle AI Database software installation and apply the required Release Updates (RUs).

    $ cd /u01/app/oracle/product/23.4.0/dbhome_1
    $ ./runInstaller -applyRU patch_directory_location
  3. Prepare a new Oracle RAC or Oracle RAC One Node-enabled home.

    Note:

    You can also use Oracle FPP or any other method to install Oracle RAC software.

  4. Enable local rolling for your database.
    $ srvctl modify database -db mydb -oraclehome new_Oracle_home -localrolling

    This command also generates a name for the new instance.

  5. Transfer Oracle RAC and Oracle RAC One Node PDBs and services from the old Oracle home to the new Oracle home.

    $ srvctl transfer instance -d mydb [-node node_list] 
    {[-stopoption stop_option] | -rollback} [-drain_timeout timeout] [-verbose]

    The new instance starts from the new Oracle home and waits for up to the time specified in the -drain_timeout parameter for the sessions to migrate to the new instance. The old instance stops when all the sessions are migrated to the new instance.

    Note:

    If -drain_timeout is not specified, then the maximum configured drain timeout of all the running services of the database on the specified nodes is used.

  6. Verify the database configuration changes.

    $ srvctl config database -db mydb
  7. Add or modify services and connect strings, as required.

Related Topics

How to Recover from a Failed Transfer in Local Rolling Mode

During local rolling database maintenance, some instances may fail to transfer to target Oracle home. Use any one of these procedures to recover from a failed transfer in local rolling mode.

  1. Revert all instances from the target Oracle home to the old Oracle home.

    1. Revert the Oracle RAC local rolling configuration changes.

      srvctl modify database -db mydb -localrolling_revert
    2. Transfer all database instances to the old Oracle home.
      srvctl transfer instance -db mydb

      This procedure restores the database to the original state, before local rolling. All instances start running from the old Oracle home. You can delete the previous target Oracle home, create a new Oracle home and start local rolling procedure again.

  2. Revert some instances from the target Oracle home to the old Oracle home.

    1. Revert the Oracle RAC local rolling configuration changes.

      srvctl modify database -db mydb -localrolling_revert
    2. Transfer some database instances to the old Oracle home.
      srvctl transfer instance -db mydb -node node_list

      Fix the local rolling target Oracle home on the transferred nodes. If any instances are still running from the local rolling target Oracle home, then the database goes in to the local rolling REVERT state.

    3. Modify the database to TRANSFER state using the same target Oracle home to transfer the instances.

      srvctl modify database -db mydb -localrolling -oraclehome target_Oracle_home
  3. Revert some instances from the target Oracle home to the old Oracle home.

    1. Rollback some instances from the target Oracle home to the old Oracle home.
      srvctl transfer instance -db mydb -node node_list -rollback

      The database goes into the TRANSFER state.

    2. Fix the target Oracle home.
    3. Transfer the database instance back to the target Oracle home.

      srvctl transfer instance -db mydb

Related Topics