Tuesday, February 7, 2012

How to upgrade 10204 data Guard ( Primary and Standby database) to 11gR2

The environment is 2 node both are Linux EL4 and having database 10204


1)Make sure that standby database (STBY) is  in sync with primary database (PRMY)

Primary database (PRMY)
select 'PRIMARY SEQ IS ' ||sequence# ||chr(10), 'PRIMARY FIRST_TIME IS ' || to_char(first_time,'mm/dd/yy hh24:mi:ss')
 from v$log_history
 where sequence#=(select max(sequence#) from v$log_history);

Standby database (STBY)

select 'STANDBY SEQ IS ' ||sequence# ||chr(10), 'STANDBY FIRST_TIME IS ' || to_char(first_time,'mm/dd/yy hh24:mi:ss')
 from v$log_history
 where sequence#=(select max(sequence#) from v$log_history);


2). Stop the redo apply on standby database.
on STBY database
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE cancel;

3). Stop the redo logs from being shipped from PRMY database
Execute from PRMY
alter system set log_archive_dest_state_2=defer;

4). Install 11g R2 Binary on  primary database server
5).  Install 11g R2 Binary on standby database server 
6). Upgrade the primary database using upgrade scripts (see Note:316889.1) 
7). Mount the standby database ( Create new pfile and startup database in mount stage from new oracle 11g r2 home and mount the standby database)
8). enable redo shipping of redo from primary to standby
alter system set log_archive_dest_state_2=enable;

9. restart the managed recovery process on the standby database to progress redo apply
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION;

10) Check sync status


Primary database (PRMY)
select 'PRIMARY SEQ IS ' ||sequence# ||chr(10), 'PRIMARY FIRST_TIME IS ' || to_char(first_time,'mm/dd/yy hh24:mi:ss')
 from v$log_history
 where sequence#=(select max(sequence#) from v$log_history);

Standby database (STBY)

select 'STANDBY SEQ IS ' ||sequence# ||chr(10), 'STANDBY FIRST_TIME IS ' || to_char(first_time,'mm/dd/yy hh24:mi:ss')
 from v$log_history
 where sequence#=(select max(sequence#) from v$log_history);


Note : make sure that you create a new passowrd file for 11g home and copy and rename the same on standby database server

No comments:

Post a Comment