select log_mode,open_mode ,database_role from v$database; --View Dataguard Master Standby status Select status from v$instance; --View Database Status alter database recover managed standby database cancel; --canceling the log application Alter database recover managed standby database using current logfile disconnect;--Open Real-time application select sequence#,applied The from v$archived_log order by sequence#; --repository, if all yes , indicates that the standby library has copied the alter database recover managed standby database disconnect from session;-- Standby mount Application log alter system switch logfile;--Main Library switch log--start and stop DG Main Library alter system set log_archive_dest_state_2 = ' defer '; lsnrctl stopshutdown immediatestartupalter system set log_archive_dest_state_2 = ' Enable ';--Standby Depot stop alter database recover Managed standby database cancel;shutdown immediate--standby startup mount --boot to mount status Alter database recover managed standby database disconnect from session; --boot log application primary and Standby execution archive log list See if synchronization, the library executable select * from v$archive_gap; see if there is delay Alter system switch logfile;--The main library to perform the switch log, to see if the library is in time to apply the log synchronization successfully, the standby library execution alter database recover managed standby database cancel;--Cancel the log application alter database open;--open the library alter database recover managed standby database using current logfile disconnect;-- Standby to enable real-time application select log_mode,open_mode ,database_role from v$database;--Check the state of the standby library
Oracle Dataguard Common SQL statements