Using Oracle SCN to Calculate RPO

Posted on

Question :

Is the difference between the SCN of primary and secondary a good indicator of RPO?

We are planning for the below logic to get the RPO.

  1. Get the current SCN from secondary.

  2. Get the time stamp of the above SCN(as A).

  3. Get the current SCN from primary.

  4. Get the time stamp of the above SCN(as B).

  5. Calculate the RPO as the difference of B-A.

Is this logic valid?

Answer :

If you see the standby summary in DGMGRL then it is quite straightforward to know whether your configuration is satisfying your RPO and RTO(derived from business needs) or not.

DGMGRL> show database orcl_stby;

Database - orcl_stby

  Role:            PHYSICAL STANDBY
  Intended State:  APPLY-ON
  Transport Lag:   0 seconds (computed 0 seconds ago)
  Apply Lag:       0 seconds (computed 0 seconds ago)
  Apply Rate:      916.00 KByte/s
  Real Time Query: ON

The transport lag is measured as the delta from the primary database last update and the standby last received redo. This can effect your RPO. If you have to fail over your primary database at this time, redo data that did not arrive at the standby database server will be lost.

Similarly Apply Lag represent your RTO which indicates how far behind your standby database server is compared to the primary when it comes to applying redo data.

Leave a Reply

Your email address will not be published. Required fields are marked *