dbaascli patch db apply

The patch db apply subcommand of the dbaascli utility is used to apply an Oracle Database or Oracle Grid Infrastructure patch.

Connect to a compute node as the opc user and run the command as the root user.

  • To apply a patch to specific instances, use the following command:

    # dbaascli patch db apply --patchid patchid 
    --instance1 hostname:oracle_home
    [--dbnames dbname[,dbname2 ...]] [--run_datasql (0|1)]
  • To apply a patch by specifying only database names, use the following command:

    # 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 --dbnames argument, then all of the databases that share the specified Oracle Home are patched.

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

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

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

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

    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.

Note:

To save time and storage space, the patching operation may move a database to another Oracle Home that already contains the patched Oracle Database binaries.