When you set hadr_peer_window to a
non-zero time value, then a HADR primary-standby database pair continues
to behave as though still in peer state, for the configured amount
of time, if the primary database loses connection with the standby
database. This helps ensure data consistency.
- Configuration type
- Database
- Parameter type
-
- Default [range]
- 0 [0 − 4 294 967 295]
- Unit of measure
- Seconds
- Usage notes:
- The value needs to be the same on both
primary and standby databases, unless you are using HADR multiple
standby mode. With multiple standbys, the principal standby uses the
primary's setting for hadr_peer_window and any
setting for hadr_peer_window on the auxiliary
standbys is ignored.
- A recommended minimum value is 120 seconds.
- When the hadr_syncmode value
is set to ASYNC or SUPERASYNC, the hadr_peer_window value
is ignored.
- To avoid impacting the availability of the primary database when
the standby database is intentionally shut down, for example, for
maintenance, the peer window is not invoked if the standby database
is explicitly deactivated while the HADR pair is in peer state.
- The TAKEOVER HADR command with the PEER
WINDOW ONLY option launches a takeover operation only if
the HADR standby is presently inside the defined peer window.
- The
takeover operation with the hadr_peer_window parameter
may behave incorrectly if the primary database clock and the standby
database clock are not synchronized to within 5 seconds of each other.
That is, the operation may succeed when it should fail, or fail when
it should succeed. You should use a time synchronization service (for
example, NTP) to keep the clocks synchronized to the same source.
- On
the standby database, the peer window end time is a time specified
in the last heartbeat message that the standby received from the primary
database, and is not directly related to when the standby detects
loss of the connection.