Sie sind auf Seite 1von 5

UBL – IMPROLIVE (Oracle Database 11gR2)

Database Synchronization Check


Step # 1:
Execute on Primary:

SQL> shutdown immediate;


SQL> startup;

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'));

Output result should be:

Difference = 0

Step # 2:
Execute on Standby:

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


sequence#;

Page | 1 30-JUL-2018
UBL – IMPROLIVE (Oracle Database 11gR2)

Note: If logfiles are not register then manually register archives using below commands

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

Step # 3:
Execute on Primary:

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

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

Primary

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

Standby

Page | 2 30-JUL-2018
UBL – IMPROLIVE (Oracle Database 11gR2)

Database Switchover Steps: -10.4.29.229-

On Primary side: -10.4.29.229-

Step 1: Verify that it is possible to perform a switchover operation

SQL> select switchover_status from v$database;

Note: If SWITCHOVER_STATUS returns SESSIONS ACTIVE then you should either


disconnect all sessions manually or you should append the with session shutdown clause.

Note: Before convert primary database to standby first cancel managed recovery on standby
database -10.4.29.239-
SQL> alter database recover managed standby database cancel;

Step 2: Convert the primary database to the new standby


sqlplus / as sysdba
SQL> alter database commit to switchover to standby with session shutdown;

Step 3: Shutdown the former primary -10.4.29.229- and mount as a standby database

sqlplus / as sysdba

SQL> shutdown immediate;


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

Step 4: Defer the remote archive destination on the new standby: -10.4.29.229-

SQL> alter system set log_archive_dest_state_2=DEFER;

Steps 5: Verify database role on new standby database:

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

Note: Database_Role should be “PHYSICAL STANDBY”

Page | 3 30-JUL-2018
UBL – IMPROLIVE (Oracle Database 11gR2)

On Standby side: -10.4.29.239-

Step 1: Verify that the physical standby can be converted to the new primary

SQL> select switchover_status from v$database;

SWITCHOVER_STATUS

----TO PRIMARY----

Note: If SWITCHOVER_STATUS returns SESSIONS ACTIVE then you should either


disconnect all sessions manually or you should append the with session shutdown clause.

Step 2: Convert the physical standby to the new primary

SQL> alter database commit to switchover to primary with session shutdown;

Step 3: Shutdown and startup the new primary


SQL> shutdown immediate;
SQL> startup;

Step 4: Enable remote archiving on the new primary

SQL> alter system set log_archive_dest_state_2= ENABLE;

Steps 5: Verify database role on new primary database:

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

Note: DATABASE_ROLE should be “PRIMARY”

Page | 4 30-JUL-2018
UBL – IMPROLIVE (Oracle Database 11gR2)

On new Standby side: -10.4.29.229-

Start managed recover on the new standby database

SQL> alter database recover managed standby database disconnect from session;

On Primary side: -10.4.29.239-


Perform a log switch on the new primary and monitor both primary and standby alert logs.

SQL> alter system switch logfile;

******************************************************************************

 After Switchover activity  Shutdown new standby “10.4.29.229” server


 Change new primary server IP 10.4.29.239  10.4.29.229.
 Before Switch back changed primary IP again  10.4.29.239 (old standby IP) and
startup standby which is  10.4.29.229.
 Now check standby synchronization.
 Now perform Switch back.

******************************************************************************

Page | 5 30-JUL-2018

Das könnte Ihnen auch gefallen