Update and Rollback Standby Databases

This section is applicable for all primary and physical standby configurations (RAC - RAC, RAC - SI, SI - SI, RAC One - RAC One). Both the primary and standby databases need to be switched to the new Oracle home in this use case. A single switch operation cannot handle both primary and standby databases.
The procedure to update and roll back standby databases varies depending on the patch type (rolling applicable or not).

Note:

Before performing an UPDATE or ROLLBACK operation, if your listener is in a custom location, be sure to first set the TNS_ADMIN environment variable to this location . Next, restart the agent and then proceed with these operations.
The STANDBY_START_OPTION parameter sets the standby database start option after patching. This parameter should be included in -input_file while patching the standby database with the UPDATE_DB EM CLI verb.
  • If STANDBY_START_OPTION is provided while patching standby databases:

    Both rolling and non rolling standby databases will be started in the specified mode set in the -input_file after patching. If the parameter value is set as READ ONLY WITH APPLY , MRP will be started up, even if the MRP was not running before patching. Otherwise, the MRP status will enabled as set in the srcvtl configuration.

  • If STANDBY_START_OPTION is not provided while patching standby database:
    • Rolling applicable patch: The standby database's existing open_mode and MRP status will be retained after patching. If unable to fetch the existing open_mode and MRP status for the standby database, it will be started in default mode and MRP status will be enabled as set in the srcvtl configuration.

      Note:

      The UPDATE_DB procedure will not stop, if any issue is detected when fetching the open_mode and MRP status. An error message will be shown in the Start DB Instance from destination home step in the UPDATE_DB procedure.
    • Non-Rolling applicable patch: Standby database will restart in a default mode and MRP status will be enabled as set in the srcvtl configuration.

Update a Standby Database

For rolling applicable patches like database Release Updates, follow these steps:

  • Update the standby database:

    emcli db_software_maintenance 
    -performOperation 
    -name=<User Specified Operation Name> 
    -purpose=<UPDATE_DB or UPDATE_RACDB> 
    -target_type=oracle_database 
    -target_list=<List of targets> 
    -normal_credential=<credential name> 
    -privilege_credential=<credential name> 
    -database_credential=<SYSDBA credentials of the database> 
    -dataguard_role=standby 
    -input_file="data:<location of input file>"

    Description of Input Parameters

    • input_file: This is an optional parameter. The parameter(s) that can be specified here are:
      • workingDir: The location and name of the temporary directory.
      • disableDG: True/False, default value is false. If the standby database is managed by Data Guard this needs to be set to true. Setting to true enables the data guard configurations..
  • Update the primary database:

    emcli db_software_maintenance 
    -performOperation 
    -name=<User Specified Operation Name> 
    -purpose=-purpose=<UPDATE_DB or UPDATE_RACDB> 
    —target_type=oracle_database
    -target_list=<List of targets> 
    -normal_credential=<credential name> 
    -privilege_credential=<credential name> 
    -dataguard_role=primary 
    [–ignoreStandbyPrereq=true|false] 
    -input_file="data:<location of input file>”
    
    [] Denotes optional parameter

    Description of Input Parameters

    • ignoreStandbyPrereq: The default value is false. This disables verification check if the Standby is on the same image version to which the Primary is being moved.
    • input_file: This is an optional parameter. The parameter(s) that can be specified here are:
      • workingDir: The location and name of the temporary directory.
      • enableDG: True/False, default value is false. If the standby database is managed by Data Guard this needs to be set to true. Setting to true enables the data guard configurations.

For non-rolling applicable patches such as OJVM (pre-Jan 2017 RUs), follow these steps:

  • Update the standby database
    emcli db_software_maintenance 
    -performOperation 
    -name=<User Specified Operation Name> 
    -purpose=<UPDATE_DB or UPDATE_RACDB> 
    —target_type=oracle_database 
    —target_list=<List of targets> 
    -normal_credential=<credential name> 
    -privilege_credential=<credential name> 
    —dataguard_role=standby 
    —startupAfterSwitch=false 
    —input_file=”data:<location of input file>”

    Description of Input Parameters

    • startupAfterSwitch: For non-rolling patches, it is necessary to bring up the Primary database first from the patched home. It will ensure that the Standby database is left in a shutdown state during the Update operation. The standby database will be started in a separate step after the Primary database is patched and started.
    • input_file: This is an optional parameter. The parameter(s) that can be specified here are:

      • workingDir: The location and name of the temporary directory.
      • disableDG: True/False, default value is false. If the standby database is managed by Data Guard this needs to be set to true. Setting to true enables the data guard configurations.
  • Update the primary database with dataguard_role=Primary
    emcli db_software_maintenance 
    -performOperation 
    -name=<User Specified Operation Name> 
    -purpose=-purpose=<UPDATE_DB or UPDATE_RACDB> 
    -target_type=oracle_database
    —target_list=oracle_database
    -normal_credential=<credential name> 
    -privilege_credential=<credential name> 
    -dataguard_role=primary 
    -rolling=false 
    -input_file="data:<location of input file>”

    Description of Input Parameters

    • input_file: This is an optional parameter. The parameter(s) that can be specified here are:
      • workingDir: Name and location of the temporary directory.
  • Start the standby database from a patched home
    emcli db_software_maintenance 
    -performOperation 
    -name=<User Specified Operation Name> 
    -purpose=<UPDATE_DB or UPDATE_RACDB> 
    -target_type=oracle_database
    -target_list=<List of targets> 
    -normal_credential=credential name> 
    -privilege_credential=<credential name> 
    -dataguard_role=standby 
    –startupDatabase=true 
    -skipSwitchDatabase=true 
    -input_file=”data:<location of input file>”

    Description of Input Parameters

    • startupDatabase: It should always be set to true. This enables the starting of the Standby database from the patched home.
    • skipSwitchDatabase: It should be set to true. It skips the switching of database to patched home since it is already performed in earlier steps.
    • input_file: This is an optional parameter. The parameter(s) that can be specified here are:
      • workingDir: The name and location of the temporary directory.
      • enableDG: True/False, default value is false. If the standby database is managed by Data Guard this needs to be set to true. Setting to true enables the data guard configurations.
      • primary_dbhost_creds: This is required because the Data Guard is enabled through the Primary Host. This can be the same as what is used in the Primary database update.
For reference information on the db_software_maintenance verb and updateoperations see: db_sm_performoperation_update in Oracle Enterprise Manager Command Line Interface.

Rollback a Standby Database

The rollback process is the same with only the purpose value will be changing. For rolling back rolling pactches like database Release Updates, follow these steps:

  • Rollback the standby database:

    emcli db_software_maintenance 
    -performOperation 
    -name=<User Specified Operation Name> 
    -purpose=<ROLLBACK_DB or ROLLBACK_RACDB>
    -target_type=oracle_database 
    -target_list=<List of targets> 
    -normal_credential=<credential name> 
    -privilege_credential=<credential name> 
    -database_credential=<SYSDBA credentials of the database> 
    -dataguard_role=standby 
    -input_file="data:<location of input file>"

    Description of Input Parameters

    • input_file: This is an optional parameter. The parameter(s) that can be specified here are:
      • workingDir: The location and name of the temporary directory.
      • disableDG: True/False, default value is false. If the standby database is managed by Data Guard this needs to be set to true. Setting to true enables the data guard configurations.
  • Rollback the primary database:

    emcli db_software_maintenance 
    -performOperation 
    -name=<User Specified Operation Name> 
    -purpose=<ROLLBACK_DB or ROLLBACK_RACDB>
    —target_type=oracle_database
    -target_list=<List of targets> 
    -normal_credential=<credential name> 
    -privilege_credential=<credential name> 
    -dataguard_role=primary 
    [–ignoreStandbyPrereq=true|false] 
    -input_file="data:<location of input file>”
    
    [] Denotes optional parameter

    Description of Input Parameters

    • ignoreStandbyPrereq: The default value is false. This disables verification check if the Standby is on the same image version to which the Primary is being moved.
    • input_file: This is an optional parameter. The parameter(s) that can be specified here are:
      • workingDir: The location and name of the temporary directory.
      • enableDG: True/False, default value is false. If the standby database is managed by Data Guard this needs to be set to true. Setting to true enables the data guard configurations.

For non-rolling applicable patches such as OJVM (pre-Jan 2017 RUs), follow these steps:

  • Rollback the standby database
    emcli db_software_maintenance 
    -performOperation 
    -name=<User Specified Operation Name> 
    -purpose=<ROLLBACK_DB or ROLLBACK_RACDB> 
    —target_type=oracle_database 
    —target_list=<List of targets> 
    -normal_credential=<credential name> 
    -privilege_credential=<credential name> 
    —dataguard_role=standby 
    —startupAfterSwitch=false 
    —input_file=”data:<location of input file>”

    Description of Input Parameters

    • startupAfterSwitch: For non-rolling patches, it is necessary to bring up the Primary database first from the patched home. It will ensure that the Standby database is left in a shutdown state during the Update operation. The standby database will be started in a separate step after the Primary database is patched and started.
    • input_file: This is an optional parameter. The parameter(s) that can be specified here are:

      • workingDir: The location and name of the temporary directory.
      • disableDG: True/False, default value is false. If the standby database is managed by Data Guard this needs to be set to true. Setting to true enables the data guard configurations.
  • Rollback the primary database with dataguard_role=Primary
    emcli db_software_maintenance 
    -performOperation 
    -name=<User Specified Operation Name> 
    -purpose=<ROLLBACK_DB or ROLLBACK_RACDB> 
    -target_type=oracle_database
    —target_list=oracle_database
    -normal_credential=<credential name> 
    -privilege_credential=<credential name> 
    -dataguard_role=primary 
    -rolling=false 
    -input_file="data:<location of input file>”

    Description of Input Parameters

    • input_file: This is an optional parameter. The parameter(s) that can be specified here are:
      • workingDir: Name and location of the temporary directory.
  • Start the standby database
    emcli db_software_maintenance 
    -performOperation 
    -name=<User Specified Operation Name> 
    -purpose=<ROLLBACK_DB or ROLLBACK_RACDB> 
    -target_type=oracle_database
    -target_list=<List of targets> 
    -normal_credential=credential name> 
    -privilege_credential=<credential name> 
    -dataguard_role=standby 
    –startupDatabase=true 
    -skipSwitchDatabase=true 
    -input_file=”data:<location of input file>”

    Description of Input Parameters

    • startupDatabase: It should always be set to true. This enables the starting of the Standby database from the patched home.
    • skipSwitchDatabase: It should be set to true. It skips the switching of database to patched home since it is already performed in earlier steps.
    • input_file: This is an optional parameter. The parameter(s) that can be specified here are:
      • workingDir: The name and location of the temporary directory.
      • enableDG: True/False, default value is false. If the standby database is managed by Data Guard this needs to be set to true. Setting to true enables the data guard configurations.
      • primary_dbhost_creds: This is required because the Data Guard is enabled through the Primary Host. This can be the same as what is used in the Primary database update.
For reference information on the db_software_maintenance verb and rollbackoperations see: performoperation_rollback in Oracle Enterprise Manager Command Line Interface.