0% found this document useful (0 votes)
47 views1 page

Standby Commands

This document contains SQL commands for managing an Oracle database and standby database. It includes commands to check archive log status and sequence numbers, enable and disable archive log destinations, cancel database recovery, register archive logs, mount the standby database, and disconnect it from the primary database.

Uploaded by

Mukarram Khan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
47 views1 page

Standby Commands

This document contains SQL commands for managing an Oracle database and standby database. It includes commands to check archive log status and sequence numbers, enable and disable archive log destinations, cancel database recovery, register archive logs, mount the standby database, and disconnect it from the primary database.

Uploaded by

Mukarram Khan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

SQL> select * from (select prod_arch,standby_arch,(prod_arch-standby_arch)

difference, '1' thread# from(select max(sequence#) prod_arch from v$archived_log


where dest_id=1 and thread#=1) p,(select max(sequence#) standby_arch from
v$archived_log where dest_id=2 and thread#=1 and applied='YES'));

SQL> select sequence#, first_time, applied from v$archived_log order by sequence#;

SQL> select Dest_name, Status,archived_seq#,error FROM v$archive_dest_status;

SQL> alter system set log_archive_dest_state_2=DEFER;


SQL> alter system set log_archive_dest_state_2= ENABLE;

SQL> alter database recover managed standby database cancel;


SQL

SQL> alter database register logfile '/oradata/archive/1_11973_975593546.arc';

SQL> select max(sequence#) from v$log_history;

SQL> select switchover_status from v$database;

SQL> shutdown immediate;


SQL> startup nomount;
SQL> alter database mount standby database;

SQL> select name, open_mode, database_role from v$database;

> alter database recover managed standby database disconnect from session;

You might also like