Wednesday, June 19, 2024

Fleet Patching & Provisioning (FPP) Concepts and cloning methods for Oracle/Grid Home

 Fleet Patching & Provisioning (FPP) Concepts and cloning methods for Oracle/Grid Home:


                          ♠️Alireza Kamrani♠️

                                  06/19/2024


Title: Implementation of Oracle Database Home and Grid Home Cloning and Patching Features using Clone -createGoldImage and -applyRU, and Fleet Patching & Provisioning (FPP)


Introduction:


Oracle Database provides powerful features for cloning and patching Oracle Home and Grid Home installations, enabling efficient management of database environments. This essay will explain the concepts and implementation of Oracle Database Home and Grid Home cloning and patching using the ` -createGoldImage` and `-applyRU` options. Additionally, it will explore the Fleet Patching & Provisioning (FPP) concepts and their implementation usages through an example.


So, you are interested in getting started with Fleet Patching and Provisioning (FPP)? 

The good news is that you don’t need to download anything extra as it is part of RAC Grid Infrastructure. Rhp server only need to enable ,start and configureto be ready when are on RAC.


About Deploying Oracle Grid Infrastructure Using Oracle Fleet Patching and Provisioning

Learn how you can use Oracle Fleet Patching and Provisioning (Oracle FPP) to provision your Oracle homes, and to manage your software lifecycle.


Note:Starting with Oracle Grid Infrastructure 19c, the feature formerly known as Rapid Home Provisioning (RHP) is now Oracle Fleet Patching and Provisioning (Oracle FPP).


Oracle FPP is a software lifecycle management method for provisioning and maintaining Oracle homes. Oracle Fleet Patching and Provisioning enables mass deployment and maintenance of standard operating environments for databases, clusters, and user-defined software types.

Oracle Fleet Patching and Provisioning enables you to install clusters, and provision, patch, scale, and upgrade Oracle Grid Infrastructure, Oracle Restart, and Oracle Database homes. The supported releases are 12.2 and later releases. You can also provision applications and middleware using Oracle Fleet Patching and Provisioning.

Oracle Fleet Patching and Provisioning is a service in Oracle Grid Infrastructure that you can use in either of the following modes:

  • Central Oracle Fleet Patching and Provisioning Server 
    The Oracle Fleet Patching and Provisioning Server stores and manages standardized images, called gold images. Gold images can be deployed to any number of nodes across the data center. You can create new clusters and databases on the deployed homes and can use them to patch, upgrade, and scale existing installations.
    The Oracle Fleet Patching and Provisioning Server can manage the following types of installations: 
    • Software homes on the cluster hosting the Oracle Fleet Patching and Provisioning Server itself.
    • Oracle Fleet Patching and Provisioning Clients running Oracle Grid Infrastructure 12c Release 2 (12.2) and later releases.
    • Installations running without Oracle Grid Infrastructure.
  • The Oracle Fleet Patching and Provisioning Server can provision new installations, and manage existing installations, without requiring any changes to the existing installations. The Oracle Fleet Patching and Provisioning Server can automatically share gold images among peer servers to support enterprises with geographically distributed data centers.
  • Oracle Fleet Patching and Provisioning Client
    The Oracle Fleet Patching and Provisioning Client can be managed from the Oracle Fleet Patching and Provisioning Server, or directly by executing commands on the client itself. The Oracle Fleet Patching and Provisioning Client is a service built into the Oracle Grid Infrastructure and is available in Oracle Grid Infrastructure 12c Release 2 (12.2) and later releases. The Oracle Fleet Patching and Provisioning Client can retrieve gold images from the Oracle Fleet Patching and Provisioning Server, upload new images based on the policy, and apply maintenance operations to itself.

Oracle Fleet Patching and Provisioning

Deploying Oracle software using Oracle Fleet Patching and Provisioning has the following advantages:

  • Ensures standardization and enables high degrees of automation with gold images and managed lineage of deployed software.
  • Minimizes downtime by deploying new homes as images (called gold images) out-of-place, without disrupting active databases or clusters.
  • Simplifies maintenance by providing automatons which are invoked with a simple, consistent API across database versions and deployment models.
  • Reduces maintenance risk with built-in validations and a dry run mode to test the operations.
  • Enables you to resume or restart the commands in the event of an unforeseen issue, reducing the risk of maintenance operations.
  • Minimizes and often eliminates the impact of patching and upgrades, with features that include:
    • Zero-downtime database upgrade with fully automated upgrade, processed entirely within the deployment without requiring any extra nodes or external storage.
    • Adaptive management of database sessions and OJVM during rolling patching.
    • Options for management of consolidated deployments.
  • The deployment and maintenance operations enable customizations to include environment-specific actions into the automated workflow.


Concepts and Terminology

Gold Image :

The source copy of an Oracle Software Home ( Oracle Database, Grid Infrastructure, or Exadata) is stored centrally in read-only format on an ACFS file system on the FPP Server.


Working Copy :

Once deployed on an FPP Client or one of the FPP target type platforms listed below, the gold image is referred to as a working copy. 

This could be an actual ORACLE_HOME or GRID_HOME software installation from which your Oracle Database and Grid Installation will run.


FPP Target Types :


In-place patching :

Patching would occur in the same file system as the unpatched system. You will need to stop the databases or Grid Infrastructure before applying the patch. Within the Oracle home, you will need to repeat this for each node in the cluster. This increases the likelihood of errors and downtime. In addition, the rollback phase is often cumbersome if things go wrong.


Out-of-place patching :

When using out-of-place patching, you keep your original database/grid home but add a new patched home. Once complete, you can switch instances or grid nodes to the new home instance by instance. In case of errors, you move back to the old home.

FPP uses out-of-place patching. You deploy a new working copy ( oracle_home) and move the database instances and new grid version to that working copy.


Note: All Oracle Grid Infrastructure patch set upgrades must be out-of-place upgrades, in which you install the patch set into a new Grid home. In-place patch set upgrades are not supported.


 

Architecture


The picture hereunder depicts the components of a 19c-21c FPP installation.


Let’s go over the components one by one.


RHPSERVER

The RHPSERVER (a.k.a. the “FPP Server”) is the core managing server instance for FPP. It runs in a Java Catalina container and is the orchestrator and coordinator of the tasks invoking external processes and services. By default, the server listens on ports 8894 (HTTPS REST) and 8896 (JMX - RMI).


HELPER

The Helper is a component present on all FPP Servers and FPP Clients. Its job is to execute local tasks as instructed by the RHPSERVER.

Tasks may consist of but are not limited to:

  • Stopping/Starting Databases, Services
  • Getting Databases or Cluster Information
  • Moving Databases to new homes
  • Merging .ora files
  • Patching databases
  • Running SW configuration
  • ....


GNS

The Grid Naming Service (GNS) runs on the FPP Server. It doesn’t need an entire GNS server configuration as the subnet, forwarding, and IP reserved addresses are not required.  It is used to resolve the FPP Servers IP addresses. It uses the UDP 53 port.


ACFS

Gold Images are stored in a read-only fashion in Oracle ASM Cluster File System (ACFS). A mount point (name can be customized) is created for this. Information about the tasks and details to make an FPP process resumable are stored in the GHCKPT directory within ACFS.


MGMTDB | GIMR

FPP stores its metadata in the MGMTDB, in the GHS19USER schema.

I have now covered most of the conceptual theory, architecture, and terminology around getting started with FPP. In the next part of this series, I will put theory into practice and walk you through how to install the FPP Server (RHPSERVER).


The Grid Infrastructure Management Repository (GIMR), or the Management Database (MGMTDB) is a multitenant database with a pluggable database (PDB) for the GIMR of each cluster. The GIMR stores the following information about the cluster: Real time performance data that Cluster Health Monitor collects.


All concepts in action:


1. Oracle Database Home and Grid Home Cloning:

There is a old method to safety clone a Oracle Home using clone.pl script, but with releases of Multitenant databases ,Oracle presented a new feature calld by Golden Image.


The ` -createGoldImage` command allows for the creation of a golden image, which serves as a template for cloning Oracle Home or Grid Home installations. Here's an overview of the process:


$ORACLE_HOME/runInstaller -createGoldImage -destinationLocation /u01/gold -silent


$ORACLE_HOME/gridSetup.sh  -createGoldImage -destinationlocation /orastage -silent


Steps:

   a. Identify the source Oracle Home or Grid Home installation to be cloned.

   b. Stop all services and Execute the ` -createGoldImage` command, specifying the source and destination paths.

   c. The command creates a compressed image file, preserving the directory structure and configuration files.

   c. This golden image can now be used for cloning new Oracle Home or Grid Home installations.


Clone.pl vs runInstaller goldimage:


But How about OraInst.loc?

One of the differences between clone.pl and runInstaller is that the latter does not include the file $ORACLE_HOME/oraInst.loc.

This is intentional because the file is not needed for golden image deployment. runInstaller recreates the file when you install the golden image.

One of the things listed in oraInst.loc is the location of the Oracle inventory. Either runInstaller finds the value itself, or you can specify it on the command line using INVENTORY_LOCATION=<path-to-inventory>.


Why Is Clone.pl Deprecated?

Previously, many tools existed to do the same – clone an Oracle Home. Now, we have consolidated our resources into one tool.

From now on, there is one method for cloning Oracle Home. That is easier for everyone.

In addition, runInstaller has some extra features that clone.pl doesn’t. For instance:

  • Better error reporting
  • Precheck run
  • Multimode awareness
  • Ability to apply patches during installation

In 23c ,clone.pl still exists but deprecated .


In Action: Create a Golden Image and Switch to new home:


First, only create a golden image from a freshly installed Oracle Home. Never use an Oracle Home that is already in use!!!. As soon as you start to use an Oracle Home you taint it with various files and you don’t want to carry those files around in your golden image. The golden image must be completely clean.

Then, you create a directory where you can store the golden image:

export GOLDIMAGEDIR=/u01/app/grid/goldimages mkdir -p $GOLDIMAGEDIR 


Finally, you create the golden image. This command creates a golden image of the specified GI home:


export NEW_GRID_HOME=/u01/app/19.20.0/grid $NEW_GRID_HOME/gridSetup.sh -
createGoldImage  -destinationLocation $GOLDIMAGEDIR -silent


Be sure to do this before you start to use the new GI home.


The installer creates the golden image as a zip file in the specified directory. The name of the zip file is unique and printed on the console. You can also use the secret parameter -name to specify a name for the zip file. 

To name the zip file gi_19_20_0.zip:


$NEW_GRID_HOME/gridSetup.sh -
createGoldImage \

... \ -name gi_19_20_0.zip


No software must run out of the Oracle Home, when you create the gold image. Don’t use a production Oracle Home. recommendation is using a test or staging server instead.


Deploy from a Golden Image

You must create a folder for the new GI home. You do it as root:
export NEW_GRID_BASE=/u01/app/19.20.0

export NEW_GRID_HOME=$NEW_GRID_BASE/grid

mkdir -p $NEW_GRID_HOME

chown -R grid:oinstall $NEW_GRID_BASE

chmod -R 775 $NEW_GRID_BASE


If you install the new GI home in a cluster, you must create the folder on all nodes.

Then, you extract the golden image as grid:

export NEW_GRID_HOME=/u01/app/19.20.0/grid

cd $NEW_GRID_HOME

unzip -q /u01/app/grid/goldimages/gi_19_20_0.zip


Finally, you use gridSetup.sh to perform the installation:
./gridSetup.sh


But at this here you can do a better job:

And also you can patch this grid home by applyRU to achieve preferably versions that you need.


Switch to the new Grid Home

Now, I can complete the patching process by switching to the new Grid Home. I do this one node at a time

This Step  involves downtime.


[grid]$ $ORACLE_HOME/gridSetup.sh \

 -silent -switchGridHome \

oracle.install.option=CRS_SWONLY \

ORACLE_HOME=$ORACLE_HOME \

oracle.install.crs.config.clusterNodes=$CURRENT_NODE \

oracle.install.crs.rootconfig.executeRootScript=false

 And at finally execute root.sh


2. Patching Oracle Home and Grid Home using -applyRU:


The `-applyRU` option allows for easy patching of Oracle Home or Grid Home installations. Here's a step-by-step example:


To apply only Release Updates:

$GI_HOME/gridSetup.sh -applyRU <downloaded patch location>


To apply only Release Updates Revision:

$GI_HOME/gridSetup.sh -applyRUR <downloaded patch location> 


To apply only Non-RU patches:

$GI_HOME/gridSetup.sh -applyOneOffs <downloaded patch location>


To apply Release Updates and Non-RU patches in one command:

$GI_HOME/gridSetup.sh -applyRU <downloaded patch location> -applyOneOffs <downloaded Patch location>


For Windows,  applyRU option is not supported. Install/configure the base Goldimage Software first (without -applyRU), and then install the RU using standard opatch/opatchauto process.


Note: If -silent option use, also specify -responseFile option and specify response file to avoid "[FATAL] [INS-40426] Grid installation option has not been specified." error.


An example is:

$ ./gridSetup.sh -applyRU /u01/patch/27100009/


$ORACLE_HOME/runInstaller -applyRU RU19150/33806152 -applyOneOffs                   Patchdir/33865116,OJVM19159/33808367


Steps:

   a. Obtain the required patch set or patch bundle from Oracle's support website.

   b. Unzip the patch files to a temporary directory.

   c. Stop all relevant services and processes associated with the Oracle Home or Grid Home.

   d. Execute the `gridsetup.sh -applyRU` or './runinstaller -applyRU' command, specifying the patch location and target Oracle Home or Grid Home.

   e. The command applies the patch, updating the binaries and configuration files.

   f. Restart the services and verify the success of the patch installation.


3. Fleet Patching & Provisioning (FPP) Concepts and Implementation:


Fleet Patching & Provisioning (FPP) is a feature introduced in Oracle Database 19c that allows for streamlined patching and provisioning of multiple databases in a fleet. Here's an example of FPP implementation:


   a. Identify the target databases within the fleet that require patching or provisioning.

   b. Create a patch plan or provisioning plan, specifying the required actions, such as patch sets or feature packs, to be applied.

   c. Execute the plan using the Fleet Patching & Provisioning (FPP) tools, such as the `dbpatchm` utility or Oracle Enterprise Manager Cloud Control.

   d. The FPP tools handle the automation and orchestration of the patching and provisioning process across the fleet.

   e. Monitor the progress and logs to ensure the successful completion of the patching and provisioning tasks.


Conclusion:

The implementation of Oracle Database Home and Grid Home cloning and patching features using ` -createGoldImage` and `-applyRU` options provides organizations with efficient and consistent management of database environments. Additionally, the introduction of Fleet Patching & Provisioning (FPP) simplifies the patching and provisioning process for multiple databases within a fleet and FPP is very usefully to implementing easy deployments of different versions of oracle database with preferred patch versions and very useful in cloud platform to achieve very simpler and speed up setup progress to have more and more db and automated processing. By following the explained concepts and utilizing the appropriate tools, organizations can ensure the smooth operation and maintenance of their Oracle Database installations.


Thanks for attention.

♠️Alireza Kamrani♠️

RDBMS Team lead/ Consultant / Mentor /ACE.

Fleet Patching & Provisioning (FPP) Concepts and cloning methods for Oracle/Grid Home

  Fleet Patching & Provisioning (FPP) Concepts and cloning methods for Oracle/Grid Home:                           ♠️Alireza Kamrani♠️  ...