In a previous post, we have seen various methods to create Physical Standby Database.

Create Standby Database using duplicate database for standby RMAN command

In this post, we will see how archive logs are transferred and recovered from a standby database and concern processes for redo transport and recovery.

There are main two processes in Data Guard Physical Standby.

  1. RFS
  2. MRP

1. RFS Process: Process is responsible to archive log transfer. When the log switch occurs at the Primary database, LNS process of primary database captures redo and sent it to Standby using Oracle Net.

Let us see the example.

Step 1: Switch logfile at Primary Database :

SQL> ALTER SYSTEM SWITCH LOGFILE;

System altered.

Check alert log of standby database :

[oracle@test1 testdb]$ tail -15f /u01/oracle/diag/rdbms/std_mgr/mgr/trace/alert_mgr.log 
RFS[8]: Selected log 4 for thread 1 sequence 37 dbid 1905869882 branch 972570193
Wed Apr 25 15:20:44 2018
Archived Log entry 34 added for thread 1 sequence 37 ID 0x71a565df dest 4:
Wed Apr 25 15:23:59 2018
Archived Log entry 35 added for thread 1 sequence 38 ID 0x71a565df dest 4:
Wed Apr 25 15:23:59 2018
RFS[7]: Selected log 4 for thread 1 sequence 39 dbid 1905869882 branch 972570193
Wed Apr 25 15:27:05 2018
Archived Log entry 36 added for thread 1 sequence 39 ID 0x71a565df dest 4:
Wed Apr 25 15:27:05 2018
RFS[7]: Selected log 5 for thread 1 sequence 40 dbid 1905869882 branch 972570193
Wed Apr 25 15:39:34 2018
Archived Log entry 37 added for thread 1 sequence 40 ID 0x71a565df dest 4:
Wed Apr 25 15:39:34 2018
RFS[7]: Selected log 4 for thread 1 sequence 41 dbid 1905869882 branch 972570193

Here we can see whenever log switch occurs at Primary, RFS process adds an entry of archive log to standby database.

Let’s check it in v$managed_standby view.

SQL> select process ,pid,sequence# from v$managed_standby;

PROCESS 	 PID  SEQUENCE#
--------- ---------- ----------
ARCH		4000	     34
ARCH		4002	     35
ARCH		4008	     37
ARCH		4006	      0
ARCH		4004	     36
ARCH		4010	     38
ARCH		4012	     39
ARCH		4014	     40
RFS	       12609	      0
RFS	       12603	      0
RFS	       12605	     41
RFS	       12607	      0

12 rows selected.

2. MRP Process: MRP process applies archived redo log information to the physical standby database that is captured by RFS process at standby.

How to start MRP?

We can start MRP [recovery] using RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION.

SQL> RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION;
Media recovery complete.

As we have used disconnect from the session, recovery will be started in background session. If we don’t use it it will be started as a foreground session.

Once we start recovery MRP process will awake and recover all archive logs pending from last applied archive log.

We can check recovery process in alert log also.

RFS[7]: Selected log 4 for thread 1 sequence 44 dbid 1905869882 branch 972570193
Media Recovery Log /u01/arc/mgr/stdby/1_42_972570193.dbf
Media Recovery Log /u01/arc/mgr/stdby/1_43_972570193.dbf
Media Recovery Waiting for thread 1 sequence 44 (in transit)
Wed Apr 25 15:56:56 2018
Archived Log entry 41 added for thread 1 sequence 44 ID 0x71a565df dest 4:
Wed Apr 25 15:56:56 2018
RFS[7]: Selected log 5 for thread 1 sequence 45 dbid 1905869882 branch 972570193
Wed Apr 25 15:56:58 2018
Media Recovery Log /u01/arc/mgr/stdby/1_44_972570193.dbf

check recovery process with SQL query.

SQL> select Process,pid,sequence# from v$managed_standby where process like 'MRP%' or process like 'RFS%';

PROCESS 	 PID  SEQUENCE#
--------- ---------- ----------
RFS	       12609	      0
RFS	       12603	      0
RFS	       12605	     44
RFS	       12607	      0
MRP0	       13649	     44

SQL> /

PROCESS 	 PID  SEQUENCE#
--------- ---------- ----------
RFS	       12609	      0
RFS	       12603	      0
RFS	       12605	     45
RFS	       12607	      0
MRP0	       13649	     44

SQL> /

PROCESS 	 PID  SEQUENCE#
--------- ---------- ----------
RFS	       12609	      0
RFS	       12603	      0
RFS	       12605	     45
RFS	       12607	      0
MRP0	       13649	     45

Now, Stopping recovery process.

We can stop recovery process using recover managed standby database cancel command.

SQL> RECOVER MANAGED STANDBY DATABASE CANCEL;
Media recovery complete.

Stay tuned for More articles on Oracle DataGuard

Thank you for giving your valuable time to read the above information.

If you want to be updated with all our articles send us the Invitation or Follow us:

Telegram Channel: https://t.me/helporacle

Skant Gupta’s LinkedIn: www.linkedin.com/in/skantali/

Joel Perez’s LinkedIn: Joel Perez’s Profile

LinkedIn Group: Oracle Cloud DBAAS

Facebook Page: OracleHelp

About The Author

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.