Using Standby as an Alternate for Far Sync (12c): Limitations and Considerations

Using Standby as an Alternate for Far Sync (12c): Limitations and Considerations

The recommended Oracle® Data Guard configuration is in Maximum Availability mode, when using Oracle Far Sync, which is located near the primary site:

Primary Database > Far Sync Instance – Network input/output (I/O) is synchronous (Sync).

Far Sync Instance > Standby Database – Network I/O is asynchronous (Async).

Primary Database > Standby Database  – As an alternate (when Far Sync is not reachable), network I/O is asynchronous (Async).

If you do not use Data Guard Broker (dgmgrl), proceed to section Using a Broker. Otherwise proceed to section Using SQL.

Using SQL

If you do not use Data Guard Broker (dgmgrl), use the parameters specified below.

  • On the Primary Database

    Mandatory Parameters

    Parameter Value Remarks
    LOG_ARCHIVE_DEST_2 Point to Far Sync service.
          Alternate log_archive_dest_3 Switches to the standby destination, after the number of failures specified in the next parameter is reached.
          max_failure 1 This value must be higher than 0 (infinite number of retries), but should not be too high, because the connection must fail after n attempts and fail over to the next destination, specified in the alternate parameter.
          SYNC
    LOG_ARCHIVE_DEST_STATE_2 enable
    LOG_ARCHIVE_DEST_3 Points to standby service.
          Alternate log_archive_dest_2 Establishes connection with the Far Sync host after the connection with log_dest_3 (standby) failed. Once Standby is up and available again, connection with the standby host is re-established.
          max_failure 0 Establishes connection infinitely; never stops retrying.
          ASYNC
    LOG_ARCHIVE_DEST_STATE_3 alternate

    Recommended Parameters

    Parameter Value Remarks
          compression Enabled Requires Advanced Compression license
          max_connection 4
          net_timeout 30
          Reopen 15
          max_connections 4

    Example:

    ALTER SYSTEM SET log_archive_dest_2='service="<FARSYNC_INST>", SYNC AFFIRM delay=0 optional compression=disable max_failure=1 max_connections=1 reopen=15 db_unique_name="<FARSYNC_INST>" net_timeout=30 alternate=LOG_ARCHIVE_DEST_3 valid_for=(online_logfile,all_roles)';
    ALTER SYSTEM SET log_archive_dest_state_2=enable;
    ALTER SYSTEM SET log_archive_dest_3='service="<STANDBY_INST>", SYNC AFFIRM delay=0 optional compression=disable max_failure=0 max_connections=1 reopen=15 db_unique_name="<STANDBY_INST>" net_timeout=30 alternate=LOG_ARCHIVE_DEST_2 valid_for=(online_logfile,all_roles)';
    ALTER SYSTEM SET log_archive_dest_state_2=alternate;
    
  • On the Far Sync Instance

    Mandatory Parameters

    Parameter Value Remarks
    LOG_ARCHIVE_DEST_2 Points to standby service.
          max_failure 1 This value must be higher than 0 (infinite number of retries), but should not be too high, because the connection must fail after n attempts and fail over to the next destination, specified in the alternate parameter.
          ASYNC
          NOAFFIRM
    LOG_ARCHIVE_DEST_STATE_2 enable

    Recommended Parameters

    Parameter Value Remarks
          compression Enabled Requires Advanced Compression license
          max_connection 4
          net_timeout 30
          Reopen 15
          max_connections 4

    Example:

    ALTER SYSTEM SET log_archive_dest_2='service="<STANDBY_INST>", ASYNC NOAFFIRM delay=0 optional compression=disable max_failure=0 max_connections=4 reopen=15 db_unique_name="<STANDBY_INST>" net_timeout=30 valid_for=(standby_logfile,all_roles)';
    ALTER SYSTEM SET log_archive_dest_state_2=enable;
    ALTER SYSTEM SET log_archive_dest_3='service="<STANDBY_INST>", SYNC AFFIRM delay=0 optional compression=disable max_failure=0 max_connections=1 reopen=15 db_unique_name="<STANDBY_INST>" net_timeout=30 alternate=LOG_ARCHIVE_DEST_2 valid_for=(online_logfile,all_roles)';
    ALTER SYSTEM SET log_archive_dest_state_2=alternate;
  • On the Standby Database

    Mandatory Parameters

    Parameter Value Remarks
    LOG_ARCHIVE_DEST_2 Point to Far Sync service only if you have local/near Far Sync. Otherwise, points to the original primary service.

    Note:   Set this parameter only when using switchover.

          Alternate log_archive_dest_3 Switches to original primary destination after the number of failures specified in the next parameter is reached.

    Note:   Set this only when using switchover and only if Far Sync is used as the service destination.

          max_failure 1 This value must be higher than 0 (infinite number of retries), but should not be too high, because the connection must fail after n attempts and fail over to the next destination, specified in the alternate parameter.
          SYNC
    LOG_ARCHIVE_DEST_STATE_2 enable Set this only when using switchover.
    LOG_ARCHIVE_DEST_3 Points to the original Primary service.

    Note:   Set this parameter only when using switchover and if Far Sync is used as service destination.

          Alternate log_archive_dest_2 Establishes connection with the Far Sync destination after the connection with the Primary service failed. Once the Primary service is up and available again, connection with the Primary host is re-established.

    Note:   Set this parameter only when using switchover and if Far Sync is used as service destination.

          max_failure 0 Establishes connection infinitely; never stops retrying.
          ASYNC
    LOG_ARCHIVE_DEST_STATE_3 Alternate Set this parameter only when using switchover.

    Recommended Parameters

    Parameter Value Remarks
          compression Enabled Requires Advanced Compression license
          max_connection 4
          net_timeout 30
          Reopen 15
          max_connections 4

    Example:

    ALTER SYSTEM SET log_archive_dest_2='service="<FARSYNC_INST>", SYNC AFFIRM delay=0 optional compression=disable max_failure=1 max_connections=1 reopen=15 db_unique_name="<FARSYNC_INST>" net_timeout=30 alternate=LOG_ARCHIVE_DEST_3 valid_for=(online_logfile,all_roles)';
    ALTER SYSTEM SET log_archive_dest_state_2=enable;
    ALTER SYSTEM SET log_archive_dest_3='service="<PRIMARY_INST>", SYNC AFFIRM delay=0 optional compression=disable max_failure=0 max_connections=1 reopen=15 db_unique_name="<PRIMARY_INST>" net_timeout=30 alternate=LOG_ARCHIVE_DEST_2 valid_for=(online_logfile,all_roles)';
    ALTER SYSTEM SET log_archive_dest_state_2=alternate;
    

Using a Broker

Use Data Guard Broker (dgmgrl) utility, to define the following parameters specified below.

Must-Have Parameters

Parameter Value Target Type
MaxFailure 0 Primary + Standby
MaxFailure 1 Far Sync
RedoRoutes ‘(<PRIMARY_INST> : <STANDBY_INST> ASYNC)(<STANDBY_INST> : <PRIMARY_INST> ASYNC)’ Far Sync
RedoRoutes ‘(LOCAL : <FARSYNC_INST> SYNC ALT =( <PRIMARY_INST> ASYNC FALLBACK))’ Standby
RedoRoutes ‘(LOCAL : <FARSYNC_INST> SYNC ALT =( <STANDBY_INST> ASYNC FALLBACK))’ Primary

Recommended Parameters

Parameter Value Target Type
ReopenSecs 15 Primary + Far Sync + Standby
LogArchiveMaxProcesses 4 Primary + Far Sync + Standby
PROTECTION MODE MAXAVAILABILITY

Example:

EDIT DATABASE <PRIMARY_INST> SET PROPERTY NetTimeout = 30;
EDIT DATABASE <STANDBY_INST> SET PROPERTY NetTimeout = 30;
EDIT FAR_SYNC <FARSYNC_INST> SET PROPERTY RedoRoutes = '(<PRIMARY_INST> : <STANDBY_INST> ASYNC)(<STANDBY_INST> : <PRIMARY_INST> ASYNC)';
EDIT DATABASE <PRIMARY_INST> SET PROPERTY MaxFailure = 0;
EDIT FAR_SYNC <FARSYNC_INST> SET PROPERTY MaxFailure = 1;
EDIT DATABASE <STANDBY_INST> SET PROPERTY MaxFailure = 0;
EDIT DATABASE <STANDBY_INST> SET PROPERTY RedoRoutes = '(LOCAL : <FARSYNC_INST> SYNC ALT =(  <PRIMARY_INST> ASYNC FALLBACK))';    
EDIT DATABASE <PRIMARY_INST> SET PROPERTY RedoRoutes = '(LOCAL : <FARSYNC_INST> SYNC ALT =(  <STANDBY_INST> ASYNC FALLBACK))';
EDIT DATABASE <PRIMARY_INST> SET PROPERTY ReopenSecs = '15';
EDIT DATABASE <STANDBY_INST> SET PROPERTY ReopenSecs = '15';
EDIT FAR_SYNC <FARSYNC_INST> SET PROPERTY ReopenSecs = '15';
EDIT DATABASE <PRIMARY_INST> SET PROPERTY LogArchiveMaxProcesses = '4';
EDIT DATABASE <STANDBY_INST> SET PROPERTY LogArchiveMaxProcesses = '4';
EDIT FAR_SYNC <FARSYNC_INST> SET PROPERTY LogArchiveMaxProcesses = '4';
EDIT CONFIGURATION SET PROTECTION MODE AS MAXAVAILABILITY;

Yossi Nixon
Chief Database Architect