Hi All,
Generally when Oracle dataguard is configured it is necessary to check progress of your database so as to make sure that archive logs are getting shipped to physical standby.
In order to check the progress of the dataguard you can use the following queries.
From Primary Destination.
SQL> select status,error from gv$archive_dest where dest_id=2; (where dest_id =2 is the remote archive log destination for physical standby)
STATUS ERROR
———————————————————————————–
VALID
From The Standby
Use the following queries.
SQL> select thread#,sequence#,archived,applied from v$archived_log ;
Thread# sequence# archived applied
————————————–
1 771 YES YES
1 772 YES YES
1 773 YES YES
1 774 YES YES
1 775 YES YES
1 776 YES YES
1 777 YES YES
To determine the max archive sequence applied on the physical standby
select max(sequence#) from v$archived_log where applied=’YES’;
max(sequence#)
————————–
777
We can also use v$archived_log view at the primary destination and above query by giving dest_id=2 in the where clause but v$archived_log view at the primary is not alwayss updated for dest_id =2 due to BUG with oracle database so it is better to use this view at the standby.
Also,
to enable the dataguard or to defer the datagauard use the following query.
At primary
SQL> alter system set log_archive_dest_state_2=enable;
system altered.
To startup the standby databaase.
SQL> startup nomount;
SQL> alter database mount stanby database;
SQL> alter database recover managed standby database disconnect from session;
To open in read only mode.
SQL> alter database recover managed standby database cancel;
SQL> alter database open read only;