Upgrading a Data Guard Physical StandbyHigh Level Steps
1. Disable the configuration
2. Stop the brokers
3. Shutdown the primary
4. Shutdown the standby
5. Stop all listeners, agents etc
6. Shutdown ASM
7. Install the database software on the standby and the primary
8. Restart ASM
9. Restart listener, agents etc
10. Mount the standby
11. Upgrade the primary database. (The upgrade of the DB will propagate the REDO to the Standby).
12. start the brokers
13. Enable the configuration
14. Open the upgraded primary
1. Disable the configuration
2. Stop the brokers
3. Shutdown the primary
4. Shutdown the standby
5. Stop all listeners, agents etc
6. Shutdown ASM
7. Install the database software on the standby and the primary
8. Restart ASM
9. Restart listener, agents etc
10. Mount the standby
11. Upgrade the primary database. (The upgrade of the DB will propagate the REDO to the Standby).
12. start the brokers
13. Enable the configuration
14. Open the upgraded primary
How To Apply Psu Patch On Standby Database
To apply psu patch on physical standby database setup, 1st patch need to be applied on standby, and then on primary
1.Check the database_role for both dbs
PRIMARY> select database_role from v$database;
DATABASE_ROLE
----------------
PRIMARY
STANDBY> select database_role from v$database;
SDATABASE_ROLE
----------------
PHYSICAL STANDBY
2.Run below in primary to check log gap between primary and standby ( it should be zero)
PRIMARY >select LOG_ARCHIVED-LOG_APPLIED "LOG_GAP" from
(SELECT MAX(SEQUENCE#) LOG_ARCHIVED
FROM V$ARCHIVED_LOG WHERE DEST_ID=1 AND ARCHIVED='YES'),
(SELECT MAX(SEQUENCE#) LOG_APPLIED
FROM V$ARCHIVED_LOG WHERE DEST_ID=2 AND APPLIED='YES');
LOG_GAP
------
0
DISABLE SHIPPING ON PRIMARY
PRIMARY> alter system set log_archive_dest_state_2=defer;
CANCEL THE RECOVERY ON STANDBY
STANDBY> alter database recover managed standby database cancel;
Shutdown the listener and database in standby
STANDBY > shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
STANDBY$ lsnrctl stop
Go to the patch location in standby and unzip it
STANDBY$ cd /u01/app/JUN15_PATCH
STANDBY$ unzip p16056266_11203_linux.zip
STANDBY$cd 16056266
STANDBY$pwd
u01/app/JUN15_PATCH/16056266
Check the patch conflict with ORACLE_HOME
STANDBY$ $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -ph ./
Oracle Interim Patch Installer version 11.2.0.3
Copyright (c) 2015, Oracle Corporation. All rights reserved.
PREREQ session
Oracle Home : /u01/oracle/app/oracle/product/11.2.0/dbhome_1
Oracle Home Inventory : /u01/oracle/app/oracle/product/11.2.0/dbhome_1/sainventory
OPatch version : 11.2.0.3
Product information : n/a
Log file location : /u01/oracle/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch2015-07-29_08-55-45AM_1.log
Patch history file: /u01/oracle/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch_history.txt
Invoking prereq "checkconflictagainstohwithdetail"
Prereq "checkConflictAgainstOHWithDetail" passed.
OPatch succeeded.
Now apply the patch(on standby)
STANDBY$ cd /u01/app/JUN15_PATCH/16056266
STANDBY$ $ORACLE_HOME/OPatch/opatch apply
start the standby database in mount state and start the listener
STANDBY$ lsnrctl start
STANDBY> startup mount
Now shutdown the database and listener in primary
PRIMARY$ lsnrctl stop LISTENER_PROD
PRIMARY > shutdown immediate;
go to patch location and unzip the patch
PRIMRAY$ cd /u01/app/JUN15_PATCH
PRIMRAY$ unzip p16056266_11203_linux.zip
PRIMRAY$ cd 16056266
PRIMRAY$ pwd
/u01/app/JUN15_PATCH/16056266
Check the patch conflict with ORACLE_HOME
PRIMRAY$ $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -ph ./
Oracle Interim Patch Installer version 11.2.0.3
Copyright (c) 2015, Oracle Corporation. All rights reserved.
PREREQ session
Oracle Home : /home/oracle/app/oracle/product/11.2.0/dbhome_1
Oracle Home Inventory : /home/oracle/app/oracle/product/11.2.0/dbhome_1/sainventory
OPatch version : 11.2.0.3
Product information : n/a
Log file location : /home/oracle/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch2015-07-29_08-55-45AM_1.log
Patch history file: /home/oracle/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch_history.txt
Invoking prereq "checkconflictagainstohwithdetail"
Prereq "checkConflictAgainstOHWithDetail" passed.
OPatch succeeded.
Now apply the patch on primary
PRIMRAY$ cd /u01/app/JUN15_PATCH/16056266
PRIMRAY$ $ORACLE_HOME/OPatch/opatch apply
Now start up open the database and listener.
PRIMRAY$ lsnrctl start LISTENER_PROD
PRIMARY > startup
ORACLE instance started.
Total System Global Area 684785664 bytes
Fixed Size 2229640 bytes
Variable Size 222300792 bytes
Database Buffers 457179136 bytes
Redo Buffers 3076096 bytes
Database mounted.
Database opened.
Enable archive shipping in primary
PRIMARY> alter system set log_archive_dest_state_2=enable;
Start the recovery(MRP) on standby:
STANDBY> select PROCESS,CLIENT_PROCESS,THREAD#,SEQUENCE#,BLOCK# from v$managed_standby where process = 'MRP0' or client_process='LGWR';
PROCESS CLIENT_P THREAD# SEQUENCE# BLOCK#
--------- -------- ---------- ---------- ----------
RFS LGWR 1 37628 1358
STANDBY> alter database recover managed standby database disconnect;
Run the catbundle.sql script from PRIMARY
PRIMARY > @$ORACLE_HOME/rdbms/admin/catbundle.sql psu apply
Check the registry history in primary( this patch should be listed there)
PRIMARY> SELECT * FROM DBA_REGISTRY_HISTORY;
1.Check the database_role for both dbs
PRIMARY> select database_role from v$database;
DATABASE_ROLE
----------------
PRIMARY
STANDBY> select database_role from v$database;
SDATABASE_ROLE
----------------
PHYSICAL STANDBY
2.Run below in primary to check log gap between primary and standby ( it should be zero)
PRIMARY >select LOG_ARCHIVED-LOG_APPLIED "LOG_GAP" from
(SELECT MAX(SEQUENCE#) LOG_ARCHIVED
FROM V$ARCHIVED_LOG WHERE DEST_ID=1 AND ARCHIVED='YES'),
(SELECT MAX(SEQUENCE#) LOG_APPLIED
FROM V$ARCHIVED_LOG WHERE DEST_ID=2 AND APPLIED='YES');
LOG_GAP
------
0
DISABLE SHIPPING ON PRIMARY
PRIMARY> alter system set log_archive_dest_state_2=defer;
CANCEL THE RECOVERY ON STANDBY
STANDBY> alter database recover managed standby database cancel;
Shutdown the listener and database in standby
STANDBY > shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
STANDBY$ lsnrctl stop
Go to the patch location in standby and unzip it
STANDBY$ cd /u01/app/JUN15_PATCH
STANDBY$ unzip p16056266_11203_linux.zip
STANDBY$cd 16056266
STANDBY$pwd
u01/app/JUN15_PATCH/16056266
Check the patch conflict with ORACLE_HOME
STANDBY$ $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -ph ./
Oracle Interim Patch Installer version 11.2.0.3
Copyright (c) 2015, Oracle Corporation. All rights reserved.
PREREQ session
Oracle Home : /u01/oracle/app/oracle/product/11.2.0/dbhome_1
Oracle Home Inventory : /u01/oracle/app/oracle/product/11.2.0/dbhome_1/sainventory
OPatch version : 11.2.0.3
Product information : n/a
Log file location : /u01/oracle/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch2015-07-29_08-55-45AM_1.log
Patch history file: /u01/oracle/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch_history.txt
Invoking prereq "checkconflictagainstohwithdetail"
Prereq "checkConflictAgainstOHWithDetail" passed.
OPatch succeeded.
Now apply the patch(on standby)
STANDBY$ cd /u01/app/JUN15_PATCH/16056266
STANDBY$ $ORACLE_HOME/OPatch/opatch apply
start the standby database in mount state and start the listener
STANDBY$ lsnrctl start
STANDBY> startup mount
Now shutdown the database and listener in primary
PRIMARY$ lsnrctl stop LISTENER_PROD
PRIMARY > shutdown immediate;
go to patch location and unzip the patch
PRIMRAY$ cd /u01/app/JUN15_PATCH
PRIMRAY$ unzip p16056266_11203_linux.zip
PRIMRAY$ cd 16056266
PRIMRAY$ pwd
/u01/app/JUN15_PATCH/16056266
Check the patch conflict with ORACLE_HOME
PRIMRAY$ $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -ph ./
Oracle Interim Patch Installer version 11.2.0.3
Copyright (c) 2015, Oracle Corporation. All rights reserved.
PREREQ session
Oracle Home : /home/oracle/app/oracle/product/11.2.0/dbhome_1
Oracle Home Inventory : /home/oracle/app/oracle/product/11.2.0/dbhome_1/sainventory
OPatch version : 11.2.0.3
Product information : n/a
Log file location : /home/oracle/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch2015-07-29_08-55-45AM_1.log
Patch history file: /home/oracle/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch_history.txt
Invoking prereq "checkconflictagainstohwithdetail"
Prereq "checkConflictAgainstOHWithDetail" passed.
OPatch succeeded.
Now apply the patch on primary
PRIMRAY$ cd /u01/app/JUN15_PATCH/16056266
PRIMRAY$ $ORACLE_HOME/OPatch/opatch apply
Now start up open the database and listener.
PRIMRAY$ lsnrctl start LISTENER_PROD
PRIMARY > startup
ORACLE instance started.
Total System Global Area 684785664 bytes
Fixed Size 2229640 bytes
Variable Size 222300792 bytes
Database Buffers 457179136 bytes
Redo Buffers 3076096 bytes
Database mounted.
Database opened.
Enable archive shipping in primary
PRIMARY> alter system set log_archive_dest_state_2=enable;
Start the recovery(MRP) on standby:
STANDBY> select PROCESS,CLIENT_PROCESS,THREAD#,SEQUENCE#,BLOCK# from v$managed_standby where process = 'MRP0' or client_process='LGWR';
PROCESS CLIENT_P THREAD# SEQUENCE# BLOCK#
--------- -------- ---------- ---------- ----------
RFS LGWR 1 37628 1358
STANDBY> alter database recover managed standby database disconnect;
Run the catbundle.sql script from PRIMARY
PRIMARY > @$ORACLE_HOME/rdbms/admin/catbundle.sql psu apply
Check the registry history in primary( this patch should be listed there)
PRIMARY> SELECT * FROM DBA_REGISTRY_HISTORY;