SET_PROTECTION_MODE

The SET_PROTECTION_MODE function can be used to set the configuration protection mode.

SET_PROTECTION_MODE Function

DBMS_DG.SET_PROTECTION_MODE (
     protection_mode IN VARCHAR2,
     severity        OUT BINARY_INTEGER)
RETURN BINARY_INTEGER;

Parameters

Parameter Description
protection_mode A character string containing the protection mode to be set. Valid values include:
  • MAXPERFORMANCE
  • MAXAVAILABILITY
  • MAXPROTECTION
severity The severity associated with the status returned by this function. Severity will be one of the following Oracle error numbers:
  • ORA-0: normal, successful completion
  • ORA-16501: The Oracle Data Guard broker operation failed.
  • ORA-16502: The Oracle Data Guard broker operation succeeded with warnings.

Usage Notes

  • This function returns a binary integer.

  • Before you use the this function to set the protection mode, ensure that at least one standby is configured to receive redo via SYNC or FASTSYNC mode if it receives redo directly from the primary. If the standby receives redo via a far sync instance, the far sync instance must be configured to receive redo via SYNC or FASTSYNC mode and the standby must be configured to receive redo via ASYNC mode.
  • The following table shows the configuration protection modes and the minimum corresponding settings for redo transport services:
    Protection Mode Redo Transport Standby Redo Log FIles Needed? Useable with Fast-Start Failover?
    MAXPROTECTION SYNC Yes Yes
    MAXAVAILABILITY SYNC or FASTSYNC Yes Yes
    MAXPERFORMANCE ASYNC Yes Yes

    The default protection mode for the configuration is MAXPERFORMANCE.

  • This function cannot be called if fast-start failover is enabled.
  • Upgrading from MAXPERFORMANCE to MAXPROTECTION is not allowed. You must first go to MAXAVAILABILITY and then to MAXPROTECTION.

Return Values

Error Description
ORA-00000: normal, successful completion

The configuration protection mode was successfully changed.

Other

The Data Guard broker was unable to change the protection mode and the return value will indicate the reason for this failure.