Applying a Patch

Applying a Patch by Using the Oracle Database Cloud Service Console

Before You Begin

  • The patching processes use the cloud-specific tooling included in your Exadata Cloud Service environment, and specific patches may require functionality provided by a specific version of the tools. Therefore, it is recommended to update to the latest version of the cloud tools before performing any patching operations. See Updating the Cloud Tooling on Exadata Cloud Service.

  • If you use the Oracle Database Cloud Service console to apply an Oracle Database patch to a database deployment that uses a shared Oracle Home, then all of the database deployments that share the Oracle Home are also patched at the same time. If you wish to only patch a specific database deployment, then you must use the exadbcpatchmulti or dbaascli utility. See Other Ways to Apply a Patch.

  • After you apply an Oracle Database patch, Oracle recommends that you also update the corresponding software image to the same release level. Doing this ensures that databases and pluggable databases (PDBs) created after the update use images that match the updated software. See Administering Software Images.

  • After you apply an Oracle Database patch, the Oracle Home name is updated to reflect the release level of the newly applied patch. See How Applying a Patch Impacts the Oracle Homes.

Procedure

  1. Go to the Patching page of the database deployment to which you want to apply a patch:

    1. Open the Oracle Database Cloud Service console.

      For detailed instructions, see Accessing the My Services Dashboard and the Oracle Database Cloud Service Console.

    2. Click the database deployment to which you want to apply a patch.

      The Oracle Database Cloud Service Overview page is displayed.

    3. Click the Administration tile and then click the Patching tab.

      The Oracle Database Cloud Service Patching page is displayed. A list of patches you can apply appears in the Available Patches section.

      Note:

      The Oracle Database Cloud Service Patching page shows only the few most recent patches that are associated with the database deployment for each patching category; that is, database patches or grid infrastructure patches. If you wish to access older patches, then you must use the exadbcpatchmulti or dbaascli utility.
  2. Click the action menu (Menu icon) that is associated with the patch you want to apply, and then select Patch.

    The Patch Service window displays.

  3. Enter a note that you wish to associate with the patch. Then, click Patch.

    The Patch Service window closes and the patching operation begins.

    The Administration tile shows the starting time of the patching operation and a Patching... message replaces the Patch button.

    When the patching operation completes, the Patching page shows the completion time of the patching operation, and a log of the operation’s activities appears in the Details of Last Patching Activity section. If the operation was successful, the patch is removed from the list Available Patches list. If the operation fails, the patch remains in the list and you should check the Details of Last Patching Activity section for information about the failure.

    Note:

    Patching operations are performed in a rolling manner, one compute node at a time, in order to minimize impact on the database. For database deployments where the Database Type is Database Clustering with RAC and Data Guard Standby, the standby site is patched first followed by the primary site.

Other Ways to Apply a Patch

For Oracle Database and Oracle Grid Infrastructure patches, you can use the exadbcpatchmulti or dbaascli utility. See:

Note:

After you apply an Oracle Database patch, the Oracle Home name is updated to reflect the release level of the newly applied patch. However, when you apply a patch by using the exadbcpatchmulti or dbaascli utility, the modified Oracle Home name is not updated in the Oracle Database Cloud Service console. For details, see How Applying a Patch Impacts the Oracle Homes.

Applying a Patch by Using the exadbcpatchmulti Command

You can apply a patch by using the exadbcpatchmulti command.

The patching operation:

  • Can be used to patch some or all of your compute nodes using one command.

  • Can be used to patch one or many of your databases using one command.

  • Coordinates multi-node patching in a rolling manner.

  • Can execute patch-related SQL after patching all the compute nodes in the cluster.

You can perform a patching operation using the exadbcpatchmulti command as follows:

  1. Connect to a compute node as the opc user and start a command shell as the root user.

    For detailed instructions, see Connecting to a Compute Node Through Secure Shell (SSH).

  2. Execute the exadbcpatchmulti command with the -apply_async action:

    • On specific instances:

      # /var/opt/oracle/exapatch/exadbcpatchmulti -apply_async patchid 
      -instance1=hostname1:oracle_home
      [-instance2=hostname2:oracle_home ...] 
      [-dbnames=dbname[,dbname2 ...]] [-run_datasql=(0|1)] [-sshkey=sshkey_file]
    • By specifying only database names:

      # /var/opt/oracle/exapatch/exadbcpatchmulti -apply_async patchid 
      -dbnames=dbname[,dbname2 ...] [-run_datasql=(0|1)] [-alldbs] [-sshkey=sshkey_file]

    In the preceding commands:

    • patchid identifies the patch to be applied.

      Note:

      For details about how to find the available patch identifiers, see Listing Available Patches.
    • -instanceN specifies a compute node and Oracle Home directory that is subject to the patching operation. In this context, an Oracle Home directory may be an Oracle Database home directory or the Oracle Grid Infrastructure home directory.

      If you use this argument to specify a shared Oracle Home directory and you do not specify the -dbname argument, then all of the databases that share the specified Oracle Home are patched. After the operation, the Oracle Home directory location remains unchanged; however, the patch level information embedded in the Oracle Home name is adjusted to reflect the patching operation.

    • -dbnames specifies the database names for the databases that are the target of the patching operation.

      If you use this argument to patch a database that uses a shared Oracle Home and you do not specify the -alldbs option, then a new Oracle Home containing the patched Oracle Database binaries is created and the database is moved to the new Oracle Home.

    • -alldbs patches all of the databases that share the same Oracle Database binaries (Oracle Home) as the databases specified in the -dbnames argument.

      After the operation, the Oracle Home directory location remains unchanged; however, the patch level information embedded in the Oracle Home name is adjusted to reflect the patching operation.

    • -run_datasql controls execution of the SQL commands associated with the patch:

      • -run_datasql=1 executes the SQL commands associated with the patch.

      • -run_datasql=0 does not execute the SQL commands associated with the patch.

      If the argument is not specified, the patch-related SQL is executed by default; equivalent to -run_datasql=1.

      Note:

      • Patch-related SQL should only be executed after all of the compute nodes are patched. Ensure that you specify -run_datasql=0 if you are patching a subset of nodes and further nodes remain to be patched.

      • This argument can only be specified along with a patching operation on a set of compute nodes. If you have patched all of your nodes and you did not specify this argument, you need to manually execute the SQL commands associated with the patch, which typically involves running the catbundle.sql script for Oracle Database 11g or the datapatch utility for Oracle Database 12c, or later. Refer to the patch documentation for full details.

    • -sshkey optionally specifies the location of the SSH private key of the opc user, which is used to connect to compute nodes in the cluster.

    For example:

    # /var/opt/oracle/exapatch/exadbcpatchmulti -apply_async 23456789 
    -instance1=hostname1:/u02/app/oracle/product/12.1.0.2/dbhome_1 
    -instance2=hostname2:/u02/app/oracle/product/12.1.0.2/dbhome_1 
    -run_datasql=1 -sshkey=/home/opc/.ssh/id_rsa

Applying a Patch by Using the dbaascli Command

You can perform a patching operation using the dbaascli command as follows:

  1. Connect to a compute node as the opc user and start a command shell as the root user.

    For detailed instructions, see Connecting to a Compute Node Through Secure Shell (SSH).

  2. Execute the dbaascli patch db apply command:

    • On specific instances:

      # dbaascli patch db apply --patchid patchid 
      --instance1 hostname:oracle_home
      [--dbnames dbname[,dbname2 ...]] [--run_datasql (0|1)]
    • By specifying only database names:

      # dbaascli patch db apply --patchid patchid 
      --dbnames dbname[,dbname2 ...] [--run_datasql (0|1)] [-alldbs]

    In the preceding commands:

    • patchid identifies the patch to be applied.

      Note:

      For details about how to find the available patch identifiers, see Listing Available Patches.
    • --instance1 specifies a compute node and Oracle Home directory that is subject to the patching operation. In this context, an Oracle Home directory may be an Oracle Database home directory or the Oracle Grid Infrastructure home directory.

      If you use this argument to specify a shared Oracle Home directory and you do not specify the --dbname argument, then all of the databases that share the specified Oracle Home are patched. After the operation, the Oracle Home directory location remains unchanged; however, the patch level information embedded in the Oracle Home name is adjusted to reflect the patching operation.

    • --dbnames specifies the database names for the databases that are the target of the patching operation.

      If you use this argument to patch a database that uses a shared Oracle Home and you do not specify the -alldbs option, then a new Oracle Home containing the patched Oracle Database binaries is created and the database is moved to the new Oracle Home.

    • -alldbs patches all of the databases that share the same Oracle Database binaries (Oracle Home) as the databases specified in the --dbnames argument.

      After the operation, the Oracle Home directory location remains unchanged; however, the patch level information embedded in the Oracle Home name is adjusted to reflect the patching operation.

    • --run_datasql controls execution of the SQL commands associated with the patch:

      • --run_datasql 1 executes the SQL commands associated with the patch.

      • --run_datasql 0 does not execute the SQL commands associated with the patch.

      If the argument is not specified, the patch-related SQL is executed by default; equivalent to --run_datasql 1.

      Note:

      • Patch-related SQL should only be executed after all of the compute nodes are patched. Ensure that you specify --run_datasql 0 if you are patching a node and further nodes remain to be patched.

      • This argument can only be specified along with a patching operation on a compute node. If you have patched all of your nodes and you did not specify this argument, you need to manually execute the SQL commands associated with the patch, which typically involves running the catbundle.sql script for Oracle Database 11g or the datapatch utility for Oracle Database 12c, or later. Refer to the patch documentation for full details.

    For example:

    # dbaascli patch db apply --patchid 23456789 
    --instance1 hostname1:/u02/app/oracle/product/12.1.0.2/dbhome_1 
    --run_datasql 1

How Applying a Patch Impacts the Oracle Homes

This topic describes how applying a patch with exadbcpatchmulti or dbaascli impacts the Oracle Homes in your environment.

After you apply an Oracle Database patch, the Oracle Home name is updated to reflect the release level of the newly applied patch.

For example, the Oracle Home name for a deployment using Oracle Database 18c with the April 2019 patch set update would be similar to OraHome100_18600_dbru190416_0. But, after applying the January 2020 patch set update, the Oracle Home name would change to OraHome100_18900_dbru200114_0.

This occurs regardless of whether you use the Oracle Database Cloud Service console to apply, or whether you apply the patch by using the exadbcpatchmulti or dbaascli utility.

However, when you apply a patch by using the exadbcpatchmulti or dbaascli utility, the modified Oracle Home name is not updated in the Oracle Database Cloud Service console. Consequently, the updated Oracle Home name is not displayed in the console pages that display details associated with the existing database deployments, and it is not visible in the list of existing Oracle Homes when you use the console to create a new database deployment.

To display the correct Oracle Home details for any existing database deployment, you can use the dbaascli dbhome info command. See Viewing Information About Oracle Homes by Using the dbaascli Utility.

To create a database deployment using a patched Oracle Home name that does not appear in the Oracle Database Cloud Service console, you can use the following options:

  • Oracle Homes — leave the default, which specifies the option to create a new Oracle Home directory location. Do not select an existing Oracle Home location from the list.

  • Oracle Home Name — specify the full name of the patched Oracle Home that you want to use for the new database deployment.

After you use this procedure, the patched Oracle Home name becomes visible in the list of existing Oracle Homes when you use the console to create another new database deployment.