Patching a DB System

This topic describes the procedures to patch bare metal and virtual machine DB systems and database homes by using the Console, the API, or the database CLI (dbcli Integration Cloud). For information on patching or performing a version upgrade on databases within a bare metal or virtual machine DB system, see Patching a Database.

Note

This topic is not applicable to Exadata Cloud Service instances. For information and instructions on Exadata patching in Oracle Cloud Infrastructure, see the following topics:

Currently Available Patches

Version DB System Patch Database Patch
19.0.0.0 October 2020, July 2020 October 2020, July 2020, April 2020, January 2020
18.0.0.0 October 2020, July 2020 October 2020, July 2020, April 2020, January 2020
12.2.0.1 October 2020, July 2020 October 2020, July 2020, April 2020, January 2020
12.1.0.2 October 2020, July 2020 October 2020, July 2020, April 2020, January 2020
11.2.0.4 Not applicable October 2020, July 2020, April 2020, January 2020

For information about operating system updates, see OS Updates.

Required IAM Policy

You must have the required type of access in a policy  to use Oracle Cloud Infrastructure, whether you're using the Console or the REST API with an SDK, CLI, or other tool. When running a command, if you see an error message that says you don’t have permission or are unauthorized, contact your administrator. Confirm the type of access you've been granted, and which compartment  you should work in.

For administrators: The policy in Let database admins manage Oracle Cloud database systems enables the specified group to do everything with databases and related Database resources.

If you're new to policies, see Getting Started with Policies and Common Policies. Details about writing policies for databases are located in Details for the Database Service.

About Patching DB Systems

Planning and Preparation

Patching a DB system requires a reboot, which can take several minutes. To minimize the impact on users, run the patch at a time when the system has the fewest users. To avoid system interruption, consider implementing a high availability strategy such as Oracle Data Guard. For more information, see Using Oracle Data Guard with the Database CLI.

Oracle recommends that you back up your database and test the patch on a test system before you apply the patch. See Backing Up a Database for more information.

Always patch a DB system before you patch the databases within that system. The Console displays the latest DB system patch and the previous patch. You can use either of these patches, but we recommend using the latest patch when possible.

Patch Availability for Older Oracle Database Software Versions

For the Oracle Database and Oracle Grid Infrastructure major version releases available in Oracle Cloud Infrastructure, patches are provided for the current version plus the two most recent older versions (N through N - 2). For example, if an instance is using Oracle Database 19c, and the latest version of 19c offered is 19.8.0.0.0, patches are available for versions 19.8.0.0.0, 19.7.0.0 and 19.6.0.0.

Prerequisites

DB systems require access to the Oracle Cloud Infrastructure Object Storage service, including connectivity to the applicable Swift endpoint for Object Storage. We recommend using a service gateway with the VCN to enable this access. For more information, see these topics:

Important

In addition to the prerequisites listed in this section, ensure that the following conditions are met to avoid patching failures:

  • The /u01 directory on the database host file system has at least 15 GB of free space to execute patching processes.
  • The Oracle Cluster ware is running on the DB system.
  • All DB system nodes are running.

See Patching Failures on Bare Metal and Virtual Machine DB Systems for details on problems that can result from not following these guidelines.

Using the Console

You can use the Console to:

  • View the patch history of a DB system or an individual database.
  • Apply patches
  • Monitor the status of an operation.

We recommend that you use the pre-check action to ensure that your DB system or database home has met the requirements for the patch you want to apply.

To patch a DB system
  1. Open the navigation menu.Click > Database > Bare Metal, VM, and Exadata.
  2. Choose your Compartment.

    A list of DB systems is displayed.

  3. Find the DB system that you plan to patch.
  4. Click the DB system name to display details about it.
  5. Click Resources > Patches.
  6. Review the list of patches.
  7. Click Actions (three dots) for the patch you are interested in, and then select one of the following actions:

    • Pre-check: Check for any prerequisites to ensure that the patch can be successfully applied.
    • Apply: Performs the pre-check, and then applies the patch.
  8. Confirm when prompted.
  9. In the list of patches, click the patch name to display its patch request. Then monitor the progress of the patch operation.

    While a patch is being applied, the patch status displays as Applying and the DB system status displays as Updating. If the operation completes successfully, the patch's status changes to Applied and the DB system's status changes to Available.

To view the patch history of a DB system
  1. Open the navigation menu. Click > Database > Bare Metal, VM, and Exadata.
  2. Choose your Compartment.

    A list of DB systems is displayed.

  3. To display details about the system you are interested in, locate the system name and click it.
  4. Under Resources, click Patch History.

    The history of patch operations for that DB system is displayed.

Using the Database CLI

This topic explains how to use the command line interface on the DB system to patch a DB system. Patches are available from the Oracle Cloud Infrastructure Object Storage service. You use the DBCLI commands to download and apply patches to some or all components in your system.

Prerequisites

To connect to the DB system via SSH, you need the path to private key associated with the public key used when the DB system was launched.

You also need the public or private IP address of the DB system.

Use the private IP address to connect to the system from your on-premises network, or from within the virtual cloud network (VCN). This includes connecting from a host located on-premises connecting through a VPN or FastConnect to your VCN, or from another host in the same VCN. Use the Exadata system's public IP address to connect to the system from outside the cloud (with no VPN). You can find the IP addresses in the Oracle Cloud Infrastructure Console as follows:

  • Cloud VM clusters (new resource model): On the Exadata VM Cluster Details page, click Virtual Machines in the Resources list.
  • DB systems: On the DB System Details page, click Nodes in the Resources list.

The values are displayed in the Public IP Address and Private IP Address & DNS Name columns of the table displaying the Virtual Machines or Nodes of the Exadata Cloud Service instance.

To update the CLI with the latest commands

Update the CLI to ensure you have the latest patching commands (older DB systems might not include them).

  1. SSH to the DB System.

    ssh -i <private_key_path> opc@<db_system_ip_address> 
  2. Log in as opc and then sudo to the root user. Use sudo su - with a hyphen to invoke the root user's profile, which will set the PATH to the dbcli directory (/opt/oracle/dcs/bin).

    
    login as: opc
    			
    [opc@dbsys ~]$ sudo su - 
  3. Update the CLI by using the CLI Update Command command.

    [root@dbsys ~]# cliadm update-dbcli
    {
      "jobId" : "dc9ce73d-ed71-4473-99cd-9663b9d79bfd",
      "status" : "Created",
      "message" : "Dcs cli will be updated",
      "reports" : [ ],
      "createTimestamp" : "January 18, 2017 10:19:34 AM PST",
      "resourceList" : [ ],
      "description" : "dbcli patching",
      "updatedTime" : "January 18, 2017 10:19:34 AM PST"
    }
    
  4. Wait for the update job to complete successfully. Check the status of the job by using the Job Commands command.

    [root@dbsys ~]# dbcli list-jobs
    
    ID                                   Description    Created                             Status
    ------------------------------------ -------------- ----------------------------------- ----------
    dc9ce73d-ed71-4473-99cd-9663b9d79bfd dbcli patching January 18, 2017 10:19:34 AM PST    Success   
To check for installed and available patches
  1. SSH to the DB System.

    ssh -i <private_key_path> opc@<db_system_ip_address> 
  2. Log in as opc and then sudo to the root user. Use sudo su - with a hyphen to invoke the root user's profile, which will set the PATH to the dbcli directory (/opt/oracle/dcs/bin).

    
    login as: opc
    			
    [opc@dbsys ~]$ sudo su - 
  3. Display the installed patch versions by using the Component Command command. If the Available Version column indicates a version number for a component, you should update the component.

    [root@dbsys ~]# dbcli describe-component
    System Version
    ---------------
    12.1.2.10.0
    
    Component Name        Installed Version    Available Version
    --------------------- -------------------- --------------------
    OAK                   12.1.2.10.0          up-to-date
    GI                    12.1.0.2.161018      up-to-date
    ORADB12102_HOME1      12.1.0.2.160719      12.1.0.2.161018
    
  4. Display the latest patch versions available in Object Storage by using the Latestpatch Command command.

    [root@dbsys ~]# dbcli describe-latestpatch
    
    componentType   availableVersion
    --------------- --------------------
    gi              12.1.0.2.161018
    db              11.2.0.4.161018
    db              12.1.0.2.161018
    oak             12.1.2.10.0
    
To patch server components

You can patch the Grid Infrastructure (GI) and storage management kit (OAK) server components.

  1. SSH to the DB System.

    ssh -i <private_key_path> opc@<db_system_ip_address> 
  2. Log in as opc and then sudo to the root user. Use sudo su - with a hyphen to invoke the root user's profile, which will set the PATH to the dbcli directory (/opt/oracle/dcs/bin).

    
    login as: opc
    			
    [opc@dbsys ~]$ sudo su - 
  3. Update the server components by using the Server Command command.

    [root@dbsys ~]# dbcli update-server
    {
      "jobId" : "9a02d111-e902-4e94-bc6b-9b820ddf6ed8",
      "status" : "Created",
      "reports" : [ ],
      "createTimestamp" : "January 19, 2017 09:37:11 AM PST",
      "resourceList" : [ ],
      "description" : "Server Patching",
      "updatedTime" : "January 19, 2017 09:37:11 AM PST"
    }

    Note the job ID in the above example.

  4. Check the job output by using the Job Commands command with the job ID.

    [root@dbsys ~]# dbcli describe-job -i 9a02d111-e902-4e94-bc6b-9b820ddf6ed8
    
    Job details
    ----------------------------------------------------------------
                         ID:  9a02d111-e902-4e94-bc6b-9b820ddf6ed8
                Description:  Server Patching
                     Status:  Running
                    Created:  January 19, 2017 9:37:11 AM PST
                    Message:
    
    Task Name                                Start Time                          End Time                            Status
    ---------------------------------------- ----------------------------------- ----------------------------------- ----------
    Create Patching Repository Directories   January 19, 2017 9:37:11 AM PST     January 19, 2017 9:37:11 AM PST     Success
    Download latest patch metadata           January 19, 2017 9:37:11 AM PST     January 19, 2017 9:37:11 AM PST     Success
    Update System version                    January 19, 2017 9:37:11 AM PST     January 19, 2017 9:37:11 AM PST     Success
    Update Patching Repository               January 19, 2017 9:37:11 AM PST     January 19, 2017 9:38:35 AM PST     Success
    oda-hw-mgmt upgrade                      January 19, 2017 9:38:35 AM PST     January 19, 2017 9:38:58 AM PST     Success
    Opatch updation                          January 19, 2017 9:38:58 AM PST     January 19, 2017 9:38:58 AM PST     Success
    Patch conflict check                     January 19, 2017 9:38:58 AM PST     January 19, 2017 9:42:06 AM PST     Success
    Apply cluster-ware patch                  January 19, 2017 9:42:06 AM PST     January 19, 2017 10:02:32 AM PST    Success
    Updating GiHome version                  January 19, 2017 10:02:32 AM PST    January 19, 2017 10:02:38 AM PST    Success   
  5. Verify that the server components were updated successfully by using the Component Command command. The Available Version column should indicate update-to-date.

To patch database home components
  1. SSH to the DB System.

    ssh -i <private_key_path> opc@<db_system_ip_address> 
  2. Log in as opc and then sudo to the root user. Use sudo su - with a hyphen to invoke the root user's profile, which will set the PATH to the dbcli directory (/opt/oracle/dcs/bin).

    
    login as: opc
    			
    [opc@dbsys ~]$ sudo su - 
  3. Get the ID of the database home by using the Dbhome Commands command.

    [root@dbsys ~]# dbcli list-dbhomes
    ID                                   Name               DB Version Home Location
    ------------------------------------ -----------------  ---------- ------------------------------------------
    b727bf80-c99e-4846-ac1f-28a81a725df6 OraDB12102_home1	 12.1.0.2  /u01/app/orauser/product/12.1.0.2/dbhome_1
  4. Update the database home components by using the Dbhome Commands command and providing the ID from the previous step.

    [root@dbsys ~]# dbcli update-dbhome -i b727bf80-c99e-4846-ac1f-28a81a725df6
    {
      "jobId" : "31b38f67-f993-4f2e-b7eb-5bccda9901ae",
      "status" : "Created",
      "message" : null,
      "reports" : [ ],
      "createTimestamp" : "January 20, 2017 10:08:48 AM PST",
      "resourceList" : [ ],
      "description" : "DB Home Patching: Home Id is 52e2e799-946a-4339-964b-c203dee35328",
      "updatedTime" : "January 20, 2017 10:08:48 AM PST"
    }

    Note the job ID in the above example.

  5. Check the job output by using the Job Commands command with the job ID.

    [root@dbsys ~]# dbcli describe-job -i 31b38f67-f993-4f2e-b7eb-5bccda9901ae
    
    Job details
    ----------------------------------------------------------------
                         ID:  31b38f67-f993-4f2e-b7eb-5bccda9901ae
                Description:  DB Home Patching: Home Id is b727bf80-c99e-4846-ac1f-28a81a725df6
                     Status:  Success
                    Created:  January 20, 2017 10:08:48 AM PST
                    Message:
    
    Task Name                                Start Time                          End Time                            Status
    ---------------------------------------- ----------------------------------- ----------------------------------- ----------
    Create Patching Repository Directories   January 20, 2017 10:08:49 AM PST    January 20, 2017 10:08:49 AM PST    Success
    Download latest patch metadata           January 20, 2017 10:08:49 AM PST    January 20, 2017 10:08:49 AM PST    Success
    Update System version                    January 20, 2017 10:08:49 AM PST    January 20, 2017 10:08:49 AM PST    Success
    Update Patching Repository               January 20, 2017 10:08:49 AM PST    January 20, 2017 10:08:58 AM PST    Success
    Opatch updation                          January 20, 2017 10:08:58 AM PST    January 20, 2017 10:08:58 AM PST    Success
    Patch conflict check                     January 20, 2017 10:08:58 AM PST    January 20, 2017 10:12:00 AM PST    Success
    db upgrade                               January 20, 2017 10:12:00 AM PST    January 20, 2017 10:22:17 AM PST    Success 
  6. Verify that the database home components were updated successfully by using the Component Command command. The Available Version column should indicate update-to-date.