• Vérifier la bonne réplication des archologs


A faire sur le serveur primaire (PRIMARY)

SELECT THREAD#, SEQUENCE#, ARCHIVED, APPLIED FROM V$ARCHIVED_LOG WHERE RECID IN (SELECT MAX(RECID) FROM V$ARCHIVED_LOG);


A faire sur le serveur de secours (STANDBY)

SELECT ARCH.THREAD# "THREAD", ARCH.SEQUENCE# "LAST_RECEIVED",
APPL.SEQUENCE# "LAST_APPLIED", (ARCH.SEQUENCE# - APPL.SEQUENCE#) "DIFFERENCE"
FROM
(SELECT THREAD# ,SEQUENCE# FROM V$ARCHIVED_LOG WHERE (THREAD#,FIRST_TIME ) IN
(SELECT THREAD#,MAX(FIRST_TIME) FROM V$ARCHIVED_LOG GROUP BY THREAD#)) ARCH,
(SELECT THREAD# ,SEQUENCE# FROM V$LOG_HISTORY WHERE (THREAD#,FIRST_TIME ) IN
(SELECT THREAD#,MAX(FIRST_TIME) FROM V$LOG_HISTORY GROUP BY THREAD#)) APPL
WHERE ARCH.THREAD# = APPL.THREAD#
ORDER BY 1;


  • Vérifier l'état des process d'archivage sur la STANDBY (MRP0) ou sur la primaire (LGWR)
SELECT process,STATUS,SEQUENCE# FROM v$managed_standby WHERE process='LGWR'OR process='MRP0';


  • Information membre dataguard
SET linesize 200
SELECT DATABASE_ROLE, DB_UNIQUE_NAME INSTANCE, OPEN_MODE,
PROTECTION_MODE, PROTECTION_LEVEL, SWITCHOVER_STATUS
FROM V$DATABASE;


  • Message du status Dataguard
SET linesize 150
COL "MESSAGE" FORMAT 50
SELECT ERROR_CODE, MESSAGE  FROM V$DATAGUARD_STATUS;


  • Vérifier qu'il n'y est aucun GAP
SELECT * FROM v$archive_gap;


  • Relancer la réplication des archlogs sur la STANDBY
ARRET
ALTER DATABASE recover managed standby DATABASE cancel;
 
RELANCE
ALTER DATABASE recover managed standby DATABASE USING CURRENT logfile disconnect FROM SESSION;


  • Faire un Switchover sans Broker

PRIMAIRE puis STANDBY - Toujours dans cet ordre

Sur le PRIMAIRE

ALTER DATABASE commit TO switchover TO physical standby WITH SESSION shutdown;
shutdown immediate;
startup nomount;
ALTER DATABASE mount standby DATABASE;
ALTER DATABASE recover managed standby DATABASE disconnect FROM SESSION;


Sur la STANDBY

ALTER DATABASE recover managed standby DATABASE cancel;
ALTER DATABASE commit TO switchover TO PRIMARY WITH SESSION shutdown;
ALTER DATABASE OPEN;
ALTER system SET LOG_ARCHIVE_DEST_STATE_2=ENABLE scope=BOTH;