Details about “alter database recover managed standby database finish force”
There is a dataguard database, the simple information as shown in below.
I wanna know what will happen when I execute command
“alter database recover managed standby database finish force”
In standby database
SQL>alter database recover managed standby database finish force
Database alterd.
Here is related logs in standby database when I execute this command
alter database recover managed standby database finish force
Attempt to do a Terminal Recovery (orcl)
Media Recovery Start: Managed Standby Recovery (orcl)
Serial Media Recovery started
Managed Standby Recovery not using Real Time Apply
Media Recovery Log /u01/app/oracle/archlog1_93_1009951051.dbf
Begin: Standby Redo Logfile archival
End: Standby Redo Logfile archival
Terminal Recovery timestamp is ’11/28/2019 21:11:15′
Terminal Recovery: applying standby redo logs.
Terminal Recovery: thread 1 seq# 94 redo required
Terminal Recovery:
Recovery of Online Redo Log: Thread 1 Group 4 Seq 94 Reading mem 0
Mem# 0: /u01/app/oracle/oradata/orcl/stdredo04.log
Identified End-Of-Redo (failover) for thread 1 sequence 94 at SCN 0xffff.ffffffff
Incomplete Recovery applied until change 1678020 time 11/28/2019 20:48:57
Media Recovery Complete (orcl)
Terminal Recovery: successful completion
Forcing ARSCN to IRSCN for TR 0:1678020
Attempt to set limbo arscn 0:1678020 irscn 0:1678020
Resetting standby activation ID 1537703970 (0x5ba78022)
Thu Nov 28 21:11:15 2019
ARCH: Archival stopped, error occurred. Will continue retrying
ORACLE Instance orcl – Archival Error
ORA-16014: log 4 sequence# 94 not archived, no available destinations
ORA-00312: online log 4 thread 1: ‘/u01/app/oracle/oradata/orcl/stdredo04.log’
Completed: alter database recover managed standby database finish force
Afterwords I execute the following command, in order to real time log apply.
SQL>alter database recover managed standby database using current logfile disconnect from session;
Database alterd.
Check status of process RFS and MRP0
SQL> select process,status from v$managed_standby;
PROCESS STATUS
ARCH CONNECTED
ARCH CONNECTED
ARCH CONNECTED
ARCH CONNECTED
SQL>
But there is no RFS and MRP0 process, The related log in standby database as shown in following.
alter database recover managed standby database using current logfile disconnect from session
Attempt to start background Managed Standby Recovery process (orcl)
Thu Nov 28 21:22:23 2019
MRP0 started with pid=19, OS id=3295
MRP0: Background Managed Standby Recovery process started (orcl)
Serial Media Recovery started
Managed Standby Recovery starting Real Time Apply
MRP0: Background Media Recovery terminated with error 16157
Errors in file /u01/app/oracle/diag/rdbms/standby/orcl/trace/orcl_mrp0_3295.trc:
ORA-16157: media recovery not allowed following successful FINISH recovery
Managed Standby Recovery not using Real Time Apply
MRP0: Background Media Recovery process shutdown (orcl)
Completed: alter database recover managed standby database using current logfile disconnect from session
Thu Nov 28 21:22:56 2019
RFS[3]: Assigned to RFS process 3299
RFS[3]: No connections allowed during/after terminal recovery.
Thu Nov 28 21:23:56 2019
RFS[4]: Assigned to RFS process 3302
RFS[4]: No connections allowed during/after terminal recovery.
In primary database
related logs
Suppressing further error logging of LOG_ARCHIVE_DEST_2.
Thu Nov 28 22:01:56 2019
Suppressing further error logging of LOG_ARCHIVE_DEST_2.
Thu Nov 28 22:02:56 2019
Suppressing further error logging of LOG_ARCHIVE_DEST_2.
Thu Nov 28 22:03:56 2019
Suppressing further error logging of LOG_ARCHIVE_DEST_2.
Thu Nov 28 22:04:56 2019
The following information is from oracle official:
RECOVER MANAGED STANDBY DATABASE FINISH [FORCE][NOWAIT|WAIT] ]:
The FINISH clause initiates failover on the target physical standby database and recovers the current standby redo log files.
Use the FINISH clause only in the event of the failure of the primary database. This clause overrides any delay intervals specified.
Include FORCE to terminate the RFS processes and allow the failover to occur immediately, without waiting for the RFS process to exit.
Specify NOWAIT to have control returned immediately, rather than after the recovery process is complete.
The context in above means that the dataguard relationship is damaged.the current standby database is no longer the standby database that used to be able to apply logs in real time, and it is ready to be changed to primary.
In other words, they are no longer in a same world any more.