dbaascli patch db switchback

The patch db switchback subcommand of the dbaascli utility is used to roll back 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 roll back a patch on specific instances, use the following command:

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

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

In the preceding commands:

  • patchid identifies the patch to be rolled back.

  • --instance1 specifies a compute node and Oracle Home directory that is 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.

    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 rolled back.

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

  • -alldbs specifies that you want to roll back 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 rollback-related SQL commands associated with the patch:

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

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

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

    Note:

    • Rollback-related SQL should only be executed after all of the compute nodes are rolled back. Therefore, ensure that you specify --run_datasql 0 if you are rolling back a node and further nodes remain to be rolled back.

    • This argument can only be specified along with a rollback operation on a compute node. Therefore, if you have rolled back all of your nodes and you did not specify this argument, you need to manually execute the SQL commands associated with the rollback operation. Refer to the patch documentation for further details.