Professional Documents
Culture Documents
PHYSICAL STANDBY COMMANDS
RECOVERY_MODE
-----------------------
MANAGED REAL TIME APPLY
To calculate the Redo bytes per second
SQL> SELECT SUM (BLOCKS * BLOCK_SIZE) / 1024 / 1024 / 60 / 60 /
30 REDO_MB_PER_SEC
FROM GV$ARCHIVED_LOG
WHERE FIRST_TIME BETWEEN TO_DATE ('01.05.2016', 'DD.MM.YYYY')
AND TO_DATE ('01.06.2016', 'DD.MM.YYYY')
To check status of Data Guard synchronization(standby):
NAME VALUE
--------------------- -------------------------------
transport lag +00 00:00:00
apply lag +00 00:00:00
apply finish time +00 00:00:00.000
estimated startup time 32
To verify there is no log file gap between the primary and the standby database:
STATUS GAP_STATUS
--------- ------------------------
VALID NO GAP
To verify that the primary database can be switched to the standby role:
SWITCHOVER_STATUS
--------------------
TO STANDBY
You can use verify command to verfy switchover
This comman will generate warnings in alert log file and you can check it before
switchover
Before switchover the current control file is backed up to the current SQL session trace
file and it possible to reconstruct a current control file, if necessary.
SQL> ALTER DATABASE COMMIT TO SWITCHOVER TO PHYSICAL STANDBY WITH
SESSION SHUTDOWN;
Database altered.
To verify Managed Recovery is running on the standby :
PROCESS
---------
MRP0
To show information about the protection mode, the protection level, the role of
the database, and switchover status:
To determine which log files were not received by the standby site.
Archivelog difference: Run this on the primary database. (not for real-time apply):
2 rows selected.
SELECT SEQUENCE#,
NAME,
DEST_ID ,
CASE WHEN STANDBY_DEST = 'YES' THEN 'Standby' ELSE 'Local' END
AS DEST_TYPE ,
ARCHIVED ,
APPLIED
FROM V$ARCHIVED_LOG
WHERE SEQUENCE# > (SELECT MAX (SEQUENCE#)
FROM V$ARCHIVED_LOG
WHERE STANDBY_DEST = 'YES' AND APPLIED = 'YES')
ORDER BY SEQUENCE# , DEST_ID ;
SEQUENCE# NAME
DEST_ID DEST_TYPE ARCHIVED APPLIED
----------
--------------------------------------------------------------
------- ---------- -------- --------
23748
+FRA/TESTCDB/ARCHIVELOG/2016_07_09/thread_2_seq_23748.10041.9 1
Local YES NO
23748
+DATA/TESTCDB/ARCHIVELOG/2016_07_09/thread_2_seq_23748.10062. 2
Local YES NO
23748 TESTSTB
3 Standby YES NO
3 rows selected.
DG BROKER COMMANDS
Configuration - TEST
Configuration Status:
SUCCESS (status updated 40 seconds ago)
Database - db12c
To change back:
DGMGRL> shutdown
DGMGRL> startup mount;
DGMGRL> show database db12c
Database - db12c
Role: PHYSICAL STANDBY
Intended State: OFFLINE
<<OUTPUT TRIMMED>>
Database - db12c
To know where are the archive logs going and are there any achieving issues, run
the following SQL against either the logical standby or primary database: