Patching an Exadata DB System Manually

This topic explains how to use the dbaascli utility to perform patching operations for Oracle Grid Infrastructure and Oracle Database on an Exadata DB system. The utility requires root or sudo administration privileges.

Note

You must update the cloud specific tooling on all the compute nodes in your Exadata DB system before performing the following procedures. For more information, see Updating an Exadata DB System.

Managing Patches

To list available patches

You can produce a list of available patches using the patch db list subcommand of the dbaascli utility:

  1. Connect to the compute node as the opc user.

    For detailed instructions, see Connecting to an Exadata DB System.

  2. Start a root-user command shell:

    $ sudo -s
    #
  3. Execute the following command:

    # dbaascli patch db list --oh <hostname>:<oracle_home>

    where:

    • --oh specifies a compute node and Oracle home directory for which you want to list the available patches. In this context, an Oracle home directory may be an Oracle Database home directory or the Oracle Grid Infrastructure home directory.

    Example (Oracle Database): 

    # dbaascli patch db list --oh exacs-node1:/u02/app/oracle/product/18.0.0.0/dbhome_1
    DBAAS CLI version 18.2.3.2.0
    Executing command patch db list --oh exacs-node1:/u02/app/oracle/product/18.0.0.0/dbhome_1
    INFO : EXACS patching 
    
    Available Patches
    patchid :29708703 (Database Release Update : 18.7.0.0.190716 (Jul 2019))
    
    Install database patch using
    dbaascli patch db apply --patchid 29708703 (Database Release Update : 18.7.0.0.190716 (Jul 2019)) --dbnames <>

    Example (Oracle Grid Infrastructure): 

    # dbaascli patch db list --oh exacs-node1:/u01/app/18.1.0.0/grid
    Note

    The list of available patches is determined by interrogating the database to establish the patches that have already been applied. When a patch is applied, the corresponding database entry is made as part of the SQL patching operation, which is executed at the end of the patch workflow. Therefore, the list of available patches may include partially applied patches along with patches that are currently being applied.

    To learn more about the patch db list subcommand, including available options, execute the following command:

    # dbaascli patch db list ?
  4. Exit the root-user command shell.

    # exit
    $
To check prerequisites before applying a patch

You can perform the prerequisites-checking operation using the patch db prereq subcommand of the dbaascli utility:

  1. Connect to the compute node as the opc user.

  2. Start a root-user command shell:

    $ sudo -s
    #
  3. Execute the following command:
    # dbaascli patch db prereq --patchid <patchid> --dbnames <dbname> 

    where:

    • --patchid identifies the patch to be pre-checked.
    • --dbnames specifies the name of the database you want to pre-check.

    Example (Oracle Database): 

    # dbaascli patch db prereq --patchid 29708703 --dbnames DB18

    Example (Oracle Grid Infrastructure): 

    # dbaascli patch db prereq --patchid 29708703-GI --dbnames GRID

    To run the command in the background, append an ampersand (&):

    # dbaascli patch db prereq --patchid 29708703 --dbnames DB18 &

    To learn more about the patch db prereq subcommand, including available options, execute the following command:

    # dbaascli patch db prereq ?
  4. Exit the root-user command shell:

    # exit
    $
To apply a patch

You can apply a patch by using the patch db apply subcommand of the dbaascli utility.

The patching operation:

  • Can be used to patch some or all of your compute nodes 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.

To perform the patching operation: 

  1. Connect to the compute node as the opc user.

  2. Start a root-user command shell:

    $ sudo -s
    #
  3. Execute the following command:
    # dbaascli patch db apply --patchid <patchid> --dbnames <dbname> --run_datasql 1

    where:

    • --patchid identifies the patch to be applied.
    • --dbnames specifies the name of the database you want to apply the patch to.
    • --run_datasql 1 instructs the command to execute patch-related SQL commands.

      Note

      • Patch-related SQL should only be executed after all of the compute nodes are patched. Therefore, take care not to specify this argument if you are patching a subset of nodes and further nodes remain to be patched.
      • This argument can only be specified in conjunction with a patching operation on a set of compute nodes. Therefore, if you have patched all of your nodes and you did not specify this argument, you will need to manually execute the SQL commands associated with the patch. Refer to the patch documentation for further details.

    Example (Oracle Database): 

    # dbaascli patch db apply --patchid 29708703 --dbnames DB18

    Example (Oracle Grid Infrastructure): 

    # dbaascli patch db apply --patchid 29708703-GI --dbnames grid

    To run the command in the background, append an ampersand (&):

    # dbaascli patch db apply --patchid 29708703 --dbnames DB18 &

    To learn more about the patch db apply subcommand, including available options, execute the following command:

    # dbaascli patch db apply ?
  4. Exit the root-user command shell:

    # exit
    $
To list applied patches

You can produce a list of applied patches to determine which patches have been applied.

You can use the opatch utility to determine the patches that have been applied to an Oracle Database or Grid Infrastructure installation.

To produce a list of applied patches for an Oracle Database installation:

  1. Connect to a compute node as the oracle user.

  2. Go to the Oracle user's home directory: 

    $ cd
  3. Ensure that you are in the Oracle user's home directory: 

    $ pwd 
    
    /home/oracle
  4. Source the environment file.

    Example (using the environment file for a database named "DB18"):

    $ . DB18.env
  5. Execute the opatch command with the lspatches option:

    $ opatch lspatches

To produce a list of applied patches for Oracle Grid Infrastructure:

  1. Connect to a compute node as the opc user.

  2. Become the grid user:

    $ sudo -s
    # su - grid
  3. Execute the opatch command with the lspatches option:

    $ opatch lspatches
To roll back a patch

You can roll back a patch by using the dbaascli utility's patch switchback operation. This operation:

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

  • Coordinates multi-node operations in a rolling manner.

  • Can execute rollback-related SQL after rolling back the patch on all the compute nodes in the cluster.

To perform a patch switchback (roll back) operation:

  1. Connect to the compute node as the opc user.

  2. Start a root-user command shell:

    $ sudo -s
    #
  3. Execute the following command: 

    # dbaascli patch db switchback --patchid <patchid> --instance1 <hostname>:<oracle_home> --dbnames <dbname> --run_datasql 1

    where:

    • --patchid identifies the patch to be rolled back.
    • --instanceN specifies a compute node and one or more Oracle home directories that are subject to the rollback operation. In this context, an Oracle home directory may be an Oracle Database home directory or the Oracle Grid Infrastructure home directory.
    • --dbnames specifies the name of the database you want to apply the switchback operation to.
    • --run_datasql 1 instructs the command to execute rollback-related SQL commands.

       
      Note

      • Rollback-related SQL should only be executed after all of the compute nodes are rolled back. Therefore, take care not to specify this argument if you are rolling back a subset of nodes and further nodes remain to be rolled back.
      • This argument can only be specified in conjunction with a rollback operation on a set of compute nodes. Therefore, if you have rolled back all of your nodes and you did not specify this argument, you will need to manually execute the SQL commands associated with the rollback operation. Refer to the patch documentation for further details.

    Example (Oracle Database): 

    # dbaascli patch db switchback --patchid 29708703 --dbnames DB18

    Example (Oracle Grid Infrastructure): 

    # dbaascli patch db switchback --patchid 29708703-GI --dbnames grid

    To run the command in the background, append an ampersand (&):

    # dbaascli patch db switchback --patchid 29708703 --dbnames DB18 &

    To learn more about the patch db switchback subcommand, including available options, execute the following command:

    # dbaascli patch db switchback ?
  4. Exit the root-user command shell:

    # exit
    $