DBA Hub

📋Steps in this guide1/4

Oracle Dataguard Important Command

In this blog, We will look some important oracle dataguard command.Following command will be useful for dataguard administration

oracle configurationintermediate
by OracleDba
13 views
1

Overview

In this blog, We will look some important oracle dataguard command.Following command will be useful for dataguard administration Check the Dataguard database status on primary and standby Query to apply redo log on standby. Following command useful for real time apply To Start the MRP process using archive log

Code/Command (click line numbers to comment):

1
2
3
select status,instance_name,database_role,protection_mode from v$database,v$instance;

ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE;
2

Section 2

To check applied archieve logs Cancel the MRP Process Status of MRP Process

Code/Command (click line numbers to comment):

1
2
3
4
5
alter database recover managed standby database disconnect from session;

SELECT SEQUENCE#, APPLIED FROM V$ARCHIVED_LOG;

alter database recover managed standby database cancel;
3

Section 3

To get the difference between Received and applied logs. To check the status of Archive log

Code/Command (click line numbers to comment):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
select process,status,client_process,thread#,sequence#,block#,blocks,delay_mins from v$managed_standby;

select  MAX_RECEIVED,MAX_APPLIED,(MAX_RECEIVED - MAX_APPLIED) as "Difference" from (SELECT
ARCHIVED_THREAD#, MAX(ARCHIVED_SEQ#) as MAX_RECEIVED,
APPLIED_THREAD#,  MAX(APPLIED_SEQ#) as  MAX_APPLIED
FROM
V$ARCHIVE_DEST_STATUS) ARCH ;

col name for a50;
col thread# for a30;
col SEQUENCE# for a30;
select THREAD#,SEQUENCE#,name,APPLIED from v$ARCHIVED_LOG;

select THREAD#,SEQUENCE#,FIRST_TIME,NEXT_TIME,BLOCKS,BLOCK_SIZE,ARCHIVED,APPLIED,STATUS,IS_RECOVERY_DEST_FILE from v$ARCHIVED_LOG;
4

Section 4

TO check if dataguard in synchronizing with standby. Dataguard Error with timestamp

Code/Command (click line numbers to comment):

1
2
3
4
5
6
7
8
select thread#,max(sequence#) from v$archived_log where applied='YES' group by thread#;

select message, to_char(timestamp,'HH:MI:SS') timestamp
from v$dataguard_status
where severity in ('Error','Fatal')
order by timestamp;
SELECT MESSAGE FROM V$DATAGUARD_STATUS;
select dest_name,status,error from v$archive_dest where status='ERROR';

Comments (0)

Please to add comments

No comments yet. Be the first to comment!