Customise Consent Preferences

We use cookies to help you navigate efficiently and perform certain functions. You will find detailed information about all cookies under each consent category below.

The cookies that are categorised as "Necessary" are stored on your browser as they are essential for enabling the basic functionalities of the site. ... 

Always Active

Necessary cookies are required to enable the basic features of this site, such as providing secure log-in or adjusting your consent preferences. These cookies do not store any personally identifiable data.

No cookies to display.

Functional cookies help perform certain functionalities like sharing the content of the website on social media platforms, collecting feedback, and other third-party features.

No cookies to display.

Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics such as the number of visitors, bounce rate, traffic source, etc.

No cookies to display.

Performance cookies are used to understand and analyse the key performance indexes of the website which helps in delivering a better user experience for the visitors.

No cookies to display.

Advertisement cookies are used to provide visitors with customised advertisements based on the pages you visited previously and to analyse the effectiveness of the ad campaigns.

No cookies to display.

How To Apply PSU Patch On Standby Database

Breadcrumb Abstract Shape
Breadcrumb Abstract Shape
Breadcrumb Abstract Shape
Breadcrumb Abstract Shape
Breadcrumb Abstract Shape
Breadcrumb Abstract Shape
  • User AvatarKiran Dalvi
  • 27 Sep, 2023
  • 0 Comments
  • 3 Mins Read

How To Apply PSU Patch On Standby Database

How To Apply Psu Patch On Standby Database ?

To apply psu patch on  physical standby database, 1st we need to appy patch on standby, and then on primary. Below are the steps.

P.S. Download patch from Oracle Support. 

1.Check the database_role for both database : 
1
2
3
4
5
6
7
8
9
10
11
12
13
On Primary,
SQL> select database_role from v$database;
 
DATABASE_ROLE
----------------
PRIMARY
 
On Standby ,
SQL> select database_role from v$database;
 
SDATABASE_ROLE
----------------
PHYSICAL STANDBY
On Primary , check log gap between primary and standby ( it should be zero).
1
2
3
4
5
6
7
8
9
10
11
On Primary ,
SQL>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
3. Disable Shipping on Primary : 
1
2
3
4
On PRIMARY
SQL> alter system set log_archive_dest_state_2=defer;
 
System altered.
4. CANCEL THE RECOVERY ON STANDBY.
1
2
3
4
On STANDBY
SQL> alter database recover managed standby database cancel;
 
databas altered.
5. Shutdown the listener and database at standby:
1
2
3
4
5
6
7
8
On STANDBY
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
 
 
STANDBY$ lsnrctl stop
6. Go to the patch location in standby and unzip it.
1
2
3
4
5
6
7
8
On Standby
standby$ cd /u01/app/PATCH
 
standby$ unzip p16056266_11203_linux.zip
 
standby$cd 16056266
STANDBY$pwd
u01/app/PATCH/16056266
7. Check the patch conflict with ORACLE_HOME.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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 : /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.
8. Now apply the patch(on standby)
1
2
3
node2$ cd /u01/app/PATCH/16056266
 
node2$ $ORACLE_HOME/OPatch/opatch apply
9. Start the standby database in mount state and start the listener
1
2
3
node2$ lsnrctl start
 
SQL> startup mount
10. Now shutdown the database and listener in primary.
1
2
3
node1$ lsnrctl stop
 
SQL> shutdown immediate;
11. Go to patch location and unzip the patch.
1
2
3
4
5
6
7
8
9
10
primary$ cd /u01/app/PATCH
primary$ cd /u01/app/PATCH
primary$ unzip p16056266_11203_linux.zip
primary$ cd 16056266
primary$ pwd
/u01/app/PATCH/16056266
$ unzip p16056266_11203_linux.zip
primary$ cd 16056266
PRIMRAY$ pwd
/u01/app/PATCH/16056266
12. Check the patch conflict with ORACLE_HOME.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
NODE1$ $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.
13. Now apply the patch on primary.
1
2
3
NODE1$ cd /u01/app/PATCH/16056266
 
NODE1$ $ORACLE_HOME/OPatch/opatch apply
14. Now start the database and listener.
1
2
3
4
5
6
7
8
9
10
11
12
NODE1$ lsnrctl start
 
SQL> 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.
15. Enable archive shipping in primary
1
2
3
SQL> alter system set log_archive_dest_state_2=enable;
 
System altered.
16. Start the recovery(MRP) on standby:
1
2
3
4
5
6
7
8
9
NODE2> 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;
 
Database altered.
17. Run the catbundle.sql script from PRIMARY.
1
SQL>@$ORACLE_HOME/rdbms/admin/catbundle.sql psu apply
18. Check the registry history in primary( this patch should be listed there).
1
SQL> SELECT * FROM DBA_REGISTRY_HISTORY;

Hope it Helps!