Hi,
If you want to maintain Dataguard for disaster recovery you need to keep up Dataguard running state and Synchronized.
You can read other Oracle Dataguard monitoring scripts like following.
https://ittutorial.org/2018/03/02/oracle-dataguard-monitoring-scripts-1/
https://ittutorial.org/2018/03/02/oracle-dataguard-monitoring-scripts-2/
https://ittutorial.org/2019/03/17/oracle-dataguard-monitoring-scripts-4/
To see the status of the switchover and the role of database which is in Standby or Primary state, execute following script.
select switchover_status,database_role from v$database;
To see archive gap in dataguard, execute following script.
SELECT THREAD#, LOW_SEQUENCE#, HIGH_SEQUENCE# FROM V$ARCHIVE_GAP;
Below script provides information about approximate completion time of the recovery process
select to_char(start_time,'DD-MON-RR HH24:MI:SS') start_time,item,round(sofar/1024,2) "MB/Sec" from v$recovery_progress where (item='Active Apply Rate' or item='Average Apply Rate');