Rolling Back a Patch or Failed Patch

Rolling Back a Patch or Failed Patch by Using the Oracle Database Cloud Service Console

To roll back the last patch or failed patch attempt by using the Oracle Database Cloud Service console:

  1. Go to the Patching page of the database deployment on which you want to roll back 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 on which you want to roll back 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.

  2. Click Rollback.

    The Patching page redisplays, showing a status message that your request has been submitted, the Administration tile shows the starting time of the rollback operation, and a Rolling back... message replaces the Rollback button.

    Note:

    Rollback operations are performed with a minimum of impact on the functioning of the database. However, during a patch rollback operation the database may be shut down for a short period of time, thus making it inaccessible.

Other Ways to Roll Back a Patch or Failed Patch

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

Rolling Back a Patch or Failed Patch by Using the exadbcpatchmulti Command

You can roll back a patch or failed patch attempt by using the exadbcpatchmulti command. The command:

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

  • Can be used to roll back a patch on one or many databases 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.

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

  1. Connect to the 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 -rollback_async action:

    • On specific instances:

      # /var/opt/oracle/exapatch/exadbcpatchmulti -rollback_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 -rollback_async patchid 
      -dbnames=dbname[,dbname2 ...] [-run_datasql=(0|1)] [-alldbs] [-sshkey=sshkey_file]

    In the preceding command:

    • patchid identifies the patch to be rolled back.

    • -instanceN 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 subset of nodes and further nodes remain to be rolled back.

      • This argument can only be specified along 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 need to manually execute the SQL commands associated with the rollback operation. Refer to the patch documentation for further details.

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

    For example:

    # /var/opt/oracle/exapatch/exadbcpatchmulti -rollback_async 34567890 
    -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

Rolling Back a Patch or Failed Patch by Using the dbaascli Command

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

  1. Connect to the 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 switchback command:

    • On specific instances:

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

      # 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 set of compute nodes. 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.

    For example:

    # dbaascli patch db switchback --patchid 34567890 
    -instance1 hostname1:/u02/app/oracle/product/12.1.0.2/dbhome_1