DG Standby Library, real-time application How to judge, Mr Process, and MRP application archiving, three cases of query and verification

Source: Internet
Author: User

This document study, DG Standby Library, real-time application How to judge, Mr Process, and MRP application archiving, three cases of query and verification

1. Canceling the MRP process

Standby Library Query process status
Select Process,client_process,sequence#,status,block#,blocks from V$managed_standby;
PROCESS client_p sequence# STATUS block# BLOCKS
--------- -------- ---------- ------------ ---------- ----------
Arch Arch 0 CONNECTED 0 0
Arch Arch 0 CONNECTED 0 0
Arch Arch 0 CONNECTED 0 0
Arch Arch 0 CONNECTED 0 0
RFS UNKNOWN 0 IDLE 0 0
RFS UNKNOWN 0 IDLE 0 0
MRP0 N/A 1124 Wait_for_log 0 0

Wait_for_log--Waiting for log transfer, indicating that the current MRP process applies the archive file for media recovery

Canceling the MRP process application

ALTER DATABASE recover managed standby database cancel;

Select Process,client_process,sequence#,status,block#,blocks from V$managed_standby where the process like '%M% ';

No rows selected

2. Enable foreground recovery session MR (FG), the foreground recovery process applies the archive file for recovery
Enable the MRP process and apply the archive for recovery

[Email protected] >recover managed standby database;

Query MRP Process Status

PROCESS client_p sequence# STATUS block# BLOCKS
--------- -------- ---------- ------------ ---------- ----------
MR (FG) n/a 1126 applying_log 58451 86733--foreground wait status, application archive log

Wait_for_log-process is waiting for archived redo logs to complete

Wait_for_gap-The process is waiting to resolve the archive gap

Applying_log-The process is actively applying archived redo logs to the standby database

Querying the archive process status

Select Dest_name,status,recovery_mode from V$archive_dest_status where dest_name= ' log_archive_dest_1 ';
Dest_name STATUS Recovery_mode
---------------------------------------- --------- -----------------------
Log_archive_dest_1 VALID MANAGED (MANAGED recovery is active) apply archive log


--Query the largest archived file sequence number currently archived
[Email protected] >select max (sequence#), thread# from V$archived_log Group by thread#;
MAX (sequence#) thread#
-------------- ----------
1162 1

--Query The MRP process status again, Wait_for_log,
MR (FG) n/a 1163 wait_for_log 0 0

Summary: The following command to directly enable the Mr Process, the session continues to open, the initial Mr Process, Foreground recovery session, the process state is initially applying_log, apply the archive log, and then the archive log application is completed, the process is waiting wait_for_ Log status, waiting for the main library to transfer the archive
Recover managed standby database;

3. Enable the MRP process and the background recovery process applies the archive file for recovery

ALTER DATABASE recover managed standby database cancel;

Recover managed standby database disconnect from session;

Select Process,client_process,sequence#,status,block#,blocks from V$managed_standby where the process like '%M% ';

PROCESS client_p sequence# STATUS block# BLOCKS
--------- -------- ---------- ------------ ---------- ----------
MRP0 N/A 1163 wait_for_log 0 0

--Process for MRP0 process, in Wait_for_log waiting for Main Library transfer archive status

Querying the archive process status

Select Dest_name,status,recovery_mode from V$archive_dest_status where dest_name= ' log_archive_dest_1 ';

Dest_name STATUS Recovery_mode
---------------------------------------- --------- ----------
Log_archive_dest_1 VALID MANAGED

4. Enable foreground recovery session MR (FG), foreground recovery process application standby redo logfile for recovery
ALTER DATABASE recover managed standby database cancel;

--Enable Mr Foreground recovery process

ALTER DATABASE recover managed standby database using current logfile;

Or

Recover managed Standby database using current logfile; --equivalence

--Query process status, Applying_log
Select Process,client_process,sequence#,status,block#,blocks from V$managed_standby where the process like '%M% ';
PROCESS client_p sequence# STATUS block# BLOCKS
--------- -------- ---------- ------------ ---------- ----------
MR (FG) n/a 1169 Applying_log 202 203


Querying the archive process status
Select Dest_name,status,recovery_mode from V$archive_dest_status where dest_name= ' log_archive_dest_1 ';
Dest_name STATUS Recovery_mode
--------------------------------------- --------- -----------------------
Log_archive_dest_1 VALID MANAGED REAL time APPLY


Query Standby Status Discovery
Select group#,thread#,sequence#,bytes/1024/1024 m,blocksize,status from V$standby_log;
group# thread# sequence# M BLOCKSIZE STATUS
---------- ---------- ---------- ---------- ---------- ----------
1 1172 ACTIVE
1 0 UNASSIGNED
1 0 UNASSIGNED

5. Enable the MRP process, the background recovery process application standby redo logfile for recovery

Recover managed Standby database using current logfile disconnect;
Or
ALTER DATABASE recover managed standby database using current logfile disconnect;

--Main Library query
Select Dest_name,status,transmit_mode,net_timeout from V$archive_dest;
Dest_name STATUS Transmit_mod Net_timeout
---------------------------------------- --------- ------------ -----------
Log_archive_dest_1 VALID Synchronous 0
Log_archive_dest_2 VALID Parallelsync 30--Parallel sync data

--Standby Library query
Select Dest_name,status,recovery_mode from V$archive_dest_status;
Dest_name STATUS Recovery_mode
---------------------------------------- --------- -----------------------
Log_archive_dest_1 VALID MANAGED REAL time APPLY

--Process Status MRP process
Select Process,client_process,sequence#,status,block#,blocks from V$managed_standby;
PROCESS client_p sequence# STATUS block# BLOCKS
--------- -------- ---------- ------------ ---------- ----------
MRP0 N/A 1172 applying_log 1272 102400


Summary: There are four states for the recovery of the standby library application
MRP0 Background App Archive or apply standby redo log
MR ((FG) foreground application archive or application standby redo log

What is foreground, background, foreground process, session disconnected, process closed
When to open the foreground process Mr, when to open the background MRP0 process
When executing a process command, the disconnect parameter is not added, the session continues to open, and the Mr Foreground process is opened

MRP0 Process Application Archive, why does status still exist in V$managed_standby view Applying_log?
Applying_log, just stating that the process is applying the archive, not identifying whether the MRP0 process is being applied in real time

How to query, whether real-time application?
Select Dest_name,status,recovery_mode from V$archive_dest_status;
Recovery_mode=managed REAL Time APPLY

Prerequisites for enabling real-time applications
1. Database version >10g
2. Need to extract create standby redo logfile

DG Standby Library, real-time application How to judge, Mr Process, and MRP application archiving, three cases of query and verification

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.