Update the DB System Resources Using dbcli

You can use the dbcli utility to update your DB system resources. This includes updating the DB system, the operating system (OS) on the nodes within the DB system, and Database Homes.

For more information on dbcli commands, see Oracle Database CLI Reference.

Prerequisites

  1. Preparing for an OS update.

    Before you update the OS, review the following important guidelines and information:

    • Back up the database in the DB system prior to attempting an OS update.
    • Do not remove packages from a DB system. However, you might have to remove custom RPMs (packages that were installed after the system was provisioned) for the update to complete successfully.
    • Oracle recommends that you test any updates thoroughly on a non-production system before updating a production system.
    • The image used to launch a DB system is updated regularly with the necessary updates. After you launch a DB system, you are responsible for applying the required OS security updates published through the Oracle public YUM server.
    • To apply OS updates, the virtual cloud network (VCN) in the DB system must be configured to allow access to the YUM repository. For more information, see VCN and Subnets.
  2. Requirements for using SSH to connect to a DB system.

    To connect to the DB system via SSH, you need the path to the 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 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 DB 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 Console as follows:

    1. On the DB System Details page, under Resources, click Nodes.
    2. View the values that are displayed in the Public IP address and Private IP address & DNS name columns of the table displaying the Nodes of the DB system.

Check for Installed and Available Updates

Perform the following steps to check for installed and available updates.

  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).

    sudo su -
  3. Display the installed update versions by using the Component Command. If the Available Version column indicates a version number for a component, you should update the component.

    dbcli describe-component

    Output:

    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 update versions available in Object Storage by using the Latestpatch Command.

    dbcli describe-latestpatch

    Output:

    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

Update Server Components

Perform the following steps to update 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).

    sudo su -
  3. Update the server components by using the Server Command.

    dbcli update-server

    Output:

    {
      "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 down the jobId in the above example.

  4. Check the job output by using the Job Commands with the jobId.

    dbcli describe-job -i 9a02d111-e902-4e94-bc6b-9b820ddf6ed8

    Output:

    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. The Available Version column should indicate update-to-date.

Update Database Home Components

Perform the following steps to update the 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).

    sudo su -
  3. Get the ID of the Database Home by using the Dbhome Commands.

    dbcli list-dbhomes

    Output:

    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 and providing the ID from the previous step.

    dbcli update-dbhome -i b727bf80-c99e-4846-ac1f-28a81a725df6

    Output:

    {
      "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 down the jobId in the above example.

  5. Check the job output by using the Job Commands with the jobId.

    dbcli describe-job -i 31b38f67-f993-4f2e-b7eb-5bccda9901ae

    Output:

    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. The Available Version column should indicate update-to-date.

Check for Available Operating System Updates for DB System Nodes

Note:

  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).

    sudo su -
  3. Use the get-availableospatches command to identify updates you want to apply to the OS. Note that if the rebootIsRequired field is “true”, you must reboot the DB system after applying the update.

    dbcli get-availableospatches

    Output:

    Update Available     Reboot Required
    -------------------- --------------------
    Yes                  Yes

    To get the output in JSON, use the following command.

    dbcli get-availableospatches -j

    Output:

    {
    "updateAvailable" : true,
    "rebootIsRequired" : true,
    "updateableRpms" : [ "curl.x86_64::7.29.0-59.0.1.el7_9.1", "freetype.x86_64::2.8-14.el7_9.1",
        "kernel-devel.x86_64::3.10.0-1160.11.1.el7", "kernel-headers.x86_64::3.10.0-1160.11.1.el7",
        "kernel-uek.x86_64::4.1.12-124.45.6.el7uek", "kernel-uek-firmware.noarch::4.1.12-124.45.6.el7uek",
        "libX11.x86_64::1.6.7-3.el7_9", "libX11-common.noarch::1.6.7-3.el7_9",
        "libcurl.x86_64::7.29.0-59.0.1.el7_9.1", "libsmbclient.x86_64::4.10.16-9.el7_9",
        "libwbclient.x86_64::4.10.16-9.el7_9", "python.x86_64::2.7.5-90.0.1.el7",
        "python-libs.x86_64::2.7.5-90.0.1.el7", "samba-client-libs.x86_64::4.10.16-9.el7_9",
        "samba-common.noarch::4.10.16-9.el7_9", "samba-common-libs.x86_64::4.10.16-9.el7_9",
        "sudo.x86_64::1.8.23-10.el7_9.1" ],
    "installedRpms" : [ "curl.x86_64::7.29.0-59.0.1.el7", "freetype.x86_64::2.8-14.el7",
        "kernel-devel.x86_64::3.10.0-1160.2.2.el7", "kernel-headers.x86_64::3.10.0-1160.2.2.el7",
        "kernel-uek.x86_64::4.1.12-124.43.4.el7uek", "kernel-uek-firmware.noarch::4.1.12-124.43.4.el7uek",
        "libX11.x86_64::1.6.7-2.el7", "libX11-common.noarch::1.6.7-2.el7",
        "libcurl.x86_64::7.29.0-59.0.1.el7", "libsmbclient.x86_64::4.10.16-7.el7_9",
        "libwbclient.x86_64::4.10.16-7.el7_9", "python.x86_64::2.7.5-89.0.1.el7",
        "python-libs.x86_64::2.7.5-89.0.1.el7", "samba-client-libs.x86_64::4.10.16-7.el7_9",
        "samba-common.noarch::4.10.16-7.el7_9", "samba-common-libs.x86_64::4.10.16-7.el7_9",
        "sudo.x86_64::1.8.23-10.el7" ]
    }

Update the Operating System of a DB System Node

This topic explains how to use the dbcli to run a precheck and then apply an update to the OS running on a DB system node.

Note: Some OS update operations require a reboot after update is complete. Use the dbcli get-availableospatches command as described in the previous topic to determine if the update you are applying requires a reboot.

Perform the following steps to update the OS of a DB system node.

  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).

    sudo su -
  3. Use the update-server -c os -p command to run a precheck:

    dbcli update-server -c os -p

    Output:

    {
      "jobId" : "7fc5cadd-d256-436a-be0d-c2bfe9fd4e95",
      "status" : "Created",
      "message" : null,
      "reports" : [ ],
      "createTimestamp" : "March 01, 2021 07:36:19 AM UTC",
      "resourceList" : [ ],
      "description" : "OS Patching Prechecks",
      "updatedTime" : "March 01, 2021 07:36:20 AM UTC",
      "percentageProgress" : "0%"
    }
  4. If the precheck is successful and uncovers no issues that prevent a successful update operation, you can update the OS. If the precheck is not successful, address the issues identified by the precheck before trying to update the OS.

    Note: You can use the -l (--local) flag to update the server components only in the current node.

    To update the OS, use the dbcli update-server -c os command:

    dbcli update-server -c os

    Output:

    {
      "jobId" : "bee1c6d9-45fb-4e5b-8ee8-f02e7cd192ab",
      "status" : "Created",
      "message" : null,
      "reports" : [ ],
      "createTimestamp" : "March 01, 2021 07:37:43 AM UTC",
      "resourceList" : [ ],
      "description" : "OS Patching",
      "updatedTime" : "March 01, 2021 07:37:43 AM UTC",
      "percentageProgress" : "0%"
     }
  5. If the OS update requires a reboot, reboot the server after the update operation is complete.