Showing posts with label Patches. Show all posts
Showing posts with label Patches. Show all posts

Friday, 18 November 2022

Prerequisite Check “CheckActiveFilesAndExecutables” Failed --19c -issue

 issues:



Patch: /u01/patch/33182768/33192793

Log: /u01/app/19c/cfgtoollogs/opatchauto/core/opatch/opatch2022-11-18_12-54-47PM_1.log

Reason: Failed during Patching: oracle.opatch.opatchsdk.OPatchException: Prerequisite check "CheckActiveFilesAndExecutables" failed.


Patch: /u01/patch/33182768/33208107

Log: /u01/app/19c/cfgtoollogs/opatchauto/core/opatch/opatch2022-11-18_12-54-47PM_1.log

Reason: Failed during Patching: oracle.opatch.opatchsdk.OPatchException: Prerequisite check "CheckActiveFilesAndExecutables" failed.


Patch: /u01/patch/33182768/33208123

Log: /u01/app/19c/cfgtoollogs/opatchauto/core/opatch/opatch2022-11-18_12-54-47PM_1.log

Reason: Failed during Patching: oracle.opatch.opatchsdk.OPatchException: Prerequisite check "CheckActiveFilesAndExecutables" failed.


Patch: /u01/patch/33182768/33239955

Log: /u01/app/19c/cfgtoollogs/opatchauto/core/opatch/opatch2022-11-18_12-54-47PM_1.log

Reason: Failed during Patching: oracle.opatch.opatchsdk.OPatchException: Prerequisite check "CheckActiveFilesAndExecutables" failed.


solution :


/sbin/fuser /u01/app/19c/lib/libclntsh.so.19.1

       

 /u01/app/19c/lib/libclntsh.so.19.1 29785M


ps -ef |grep 29785


kill -9 29785                             

/sbin/fuser /u01/app/19c/lib/libasmclntsh19.so

/u01/app/19c/lib/libasmclntsh19.so  98766M

kill -9 98766

After fixing the cause of failure Run opatchauto resume      



Sunday, 24 May 2020

GI and RDBMS - Patching Oracle 18c (18.3.2.0.0) to Oracle 18c (18.5.0.0.0)

GI and RDBMS - Patching Oracle 18c (18.3.2.0.0) to Oracle 18c (18.5.0.0.0) On Two-Node RAC in Multi-Tenant Environment

GI and RDBMS - Patching Oracle 18c (18.3.2.0.0)  to Oracle 18c (18.5.0.0.0) On Two-Node RAC in Multi-Tenant Environment 


Instance Type: Two Node RAC (orcl1 and orcl2)
Container Database: orcl
Pluggable Databases: pdb1 and pdb2

GRID Patch: p28828717_180000_Linux-x86-64.zip
RDBMS Patch: p28822489_180000_Linux-x86-64.zip

Tuesday, 14 April 2020

create response file and Applying PSU (Apr-17)Patch on Oracle 11gR2 Two Node RAC

Applying PSU (APR 2017) Patch on Oracle 11gR2 Two Node RAC

This document will explain how to apply PSU patch ( April-2017) on Oracle 11.2.0.4 RAC, All the steps are performed on 2 node RAC.

Consolidated steps:

1 : Take Backup of OPatch folder on Both GI and RDBMS homes and keep recommended OPatch folder as per document.
2 : Stop OEM, if running
3 : Download required PSU (25476126) and unzip it
4 : Create response file from any OPatch location
5 : Apply the PSU node by node
6 : Check opatch details and run @catbundle psu apply followed by @utlrp.sql

Step details:

1) Stop OEM if running

bash-4.2$ export ORACLE_UNQNAME=PROD
bash-4.2$ emctl status dbconsole
Oracle Enterprise Manager 11g Database Control Release 11.2.0.4.0
Copyright (c) 1996, 2013 Oracle Corporation.  All rights reserved.
https://eddb1.imcl.com:5500/em/console/aboutApplication
Oracle Enterprise Manager 11g is not running.


2) Exting patches both GI and RDMS homes:

a) RDBMS Home
bash-4.2$ ./opatch lspatches
20831122;OCW Patch Set Update : 11.2.0.4.7 (20831122)
20760982;Database Patch Set Update : 11.2.0.4.7 (20760982)

OPatch succeeded.
bash-4.2$ ./opatch version
OPatch Version: 11.2.0.3.14

OPatch succeeded.
bash-4.2$

b) GI Home

bash-4.2$ pwd
/oracle/app/11.2.0/grid/OPatch
bash-4.2$ ./opatch version
OPatch Version: 11.2.0.3.14

OPatch succeeded.
bash-4.2$ ./opatch lspatches
20831122;OCW Patch Set Update : 11.2.0.4.7 (20831122)
20760982;Database Patch Set Update : 11.2.0.4.7 (20760982)
20299019;ACFS Patch set update : 11.2.0.4.6 (20299019)

OPatch succeeded.
bash-4.2$


3) Download Latest PSU and Unzip

bash-4.2$ cd /u02/Patch_dir
bash-4.2$ pwd
/u02/Patch_dir
bash-4.2$ ls
25476126                       PatchSearch.xml                p25476126_112040_AIX64-5L.zip


4) Create a response file

su - oracle
$cd $ORACLE_HOME/OPatch/ocm/bin/
bash-4.2$ pwd
/oracle/app/oracle/product/11.2.0/dbhome_1/OPatch/ocm/bin
$./emocmrsp -no_banner -output /u02/Patch_dir/ocm.rsp

output:

bash-4.2$ ./emocmrsp -no_banner -output /u02/Patch_dir/ocm.rsp
Provide your email address to be informed of security issues, install and
initiate Oracle Configuration Manager. Easier for you if you use your My
Oracle Support Email address/User Name.
Visit http://www.oracle.com/support/policies.html for details.
Email address/User Name:

You have not provided an email address for notification of security issues.
Do you wish to remain uninformed of security issues ([Y]es, [N]o) [N]:  Y
The OCM configuration response file (/u02/Patch_dir/ocm.rsp) was successfully created.
bash-4.2$


5) Now run the patch installation as root user, to ensure that the installation is done directly to BOTH oracle and grid homes

# ./opatch auto /u02/Patch_dir/25476126 -ocmrf /u02/Patch_dir/ocm.rsp

output:

bash-4.2# pwd
/oracle/app/oracle/product/11.2.0/dbhome_1/OPatch
bash-4.2# ./opatch auto /u02/Patch_dir/25476126 -ocmrf /u02/Patch_dir/ocm.rsp
Executing /oracle/app/11.2.0/grid/perl/bin/perl ./crs/patch11203.pl -patchdir /u02/Patch_dir -patchn 25476126 -ocmrf /u02/Patch_dir/ocm.rsp -paramfile /oracle/app/11.2.0/grid/crs/install/crsconfig_params

This is the main log file: /oracle/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatchauto2017-06-17_16-12-55.log

This file will show your detected configuration and all the steps that opatchauto attempted to do on your system:
/oracle/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatchauto2017-06-17_16-12-55.report.log

2017-06-17 16:12:55: Starting Clusterware Patch Setup
Using configuration parameter file: /oracle/app/11.2.0/grid/crs/install/crsconfig_params

Stopping RAC /oracle/app/oracle/product/11.2.0/dbhome_1 ...
Stopped RAC /oracle/app/oracle/product/11.2.0/dbhome_1 successfully

patch /u02/Patch_dir/25476126/24732075  apply successful for home  /oracle/app/oracle/product/11.2.0/dbhome_1
patch /u02/Patch_dir/25476126/23054319/custom/server/23054319  apply successful for home  /oracle/app/oracle/product/11.2.0/dbhome_1

Stopping CRS...
Stopped CRS successfully

patch /u02/Patch_dir/25476126/24732075  apply successful for home  /oracle/app/11.2.0/grid
patch /u02/Patch_dir/25476126/23054319  apply successful for home  /oracle/app/11.2.0/grid
patch /u02/Patch_dir/25476126/22502505  apply successful for home  /oracle/app/11.2.0/grid

Starting CRS...
Installing Trace File Analyzer
CRS-4123: Oracle High Availability Services has been started.

Starting RAC /oracle/app/oracle/product/11.2.0/dbhome_1 ...
Started RAC /oracle/app/oracle/product/11.2.0/dbhome_1 successfully

opatch auto succeeded.
bash-4.2#

6) Verify the Opatch applied or not?

su - oracle
bash-4.2$ pwd
/u02/Patch_dir
bash-4.2$ cd $ORACLE_HOME/OPatch
bash-4.2$ ./opatch lspatches
23054319;OCW Patch Set Update : 11.2.0.4.160719 (23054319)
24732075;Database Patch Set Update : 11.2.0.4.170418 (24732075)

OPatch succeeded.
bash-4.2$

#su - grid

bash-4.2$ ./opatch lspatches
22502505;ACFS Patch Set Update : 11.2.0.4.160419 (22502505)
23054319;OCW Patch Set Update : 11.2.0.4.160719 (23054319)
24732075;Database Patch Set Update : 11.2.0.4.170418 (24732075)

OPatch succeeded.
bash-4.2$ whoami
grid
bash-4.2$


Now you can proceed same steps in other nodes

Note: Application downtime is not required.

7) For each database instance running on the Oracle home being patched, connect to the database using SQL*Plus. Connect as SYSDBA and run the catbundle.sql and utlrp.sql script as follows:

# su - oracle
$ cd $ORACLE_HOME/rdbms/admin
$ sqlplus /nolog
SQL> CONNECT / AS SYSDBA
SQL> STARTUP
SQL> @catbundle.sql psu apply
SQL> @utlrp.sql
SQL>


Wednesday, 26 September 2018

Patch list

https://nadeemmohammed.wordpress.com/2012/03/13/list-of-oracle-database-patch-set-updates-psu/#11204


select * from gv$asm_operation order by 1,2,3;

col name format a15;
col path format a25;
col failgroup format a20;
--
select dg.name, d.path, d.failgroup, d.failgroup_type,dg.VOTING_FILES
from v$asm_diskgroup dg, v$asm_disk d
where dg.group_number = d.group_number and dg.name = 'GRID'
order by dg.name, d.path, d.failgroup;


crsctl query css votedisk

Sunday, 16 September 2018

How to find latest oracle database patchset

$ORACLE_HOME/OPatch/opatch lsinventory

$ORACLE_HOME/OPatch/opatch lsinventory|grep "Patch description"
Patch description:  "Database Patch Set Update : 11.2.0.3.7 (16619892)"

$ORACLE_HOME/OPatch/opatch lsinventory -details


Which Patch has been applied?


SET linesize 200 pagesize 200
col action_time FOR a28
col version FOR a10
col comments FOR a35
col action FOR a25
col namespace FOR a12
SELECT * FROM registry$history;



To unlock the Grid home, perform the following steps:


cd /u01/app/11.2.0/grid/crs/install 
perl rootcrs.pl -unlock -crshome /u01/app/11.2.0/grid

cd /u01/app/11.2.0/grid/crs/install 
perl rootcrs.pl -patch
$ CRS_home/bin/srvctl stop database -d sales
CRS_home/crs/bin/crsctl stop cluster -all
$ Grid_home/bin/crsctl status resource -t
$ cd Oracle_home/OPatch/4519934/4519934
$ echo $ORACLE_HOME
/u01/app/oracle/product/11.2.0/dbhome_1
opatch apply

Grid_home/bin/crsctl start cluster -all
$ Grid_home/bin/crsctl status resource -t
$ Oracle_home/bin/srvctl start instance -d sales -i "sales1"
# Grid_home/bin/crsctl start resource myResource -n docrac2
$ sqlplus /nolog 
SQL> connect sys/password@sales1 AS SYSDBA
SQL> @Oracle_home/rdbms/admin/catbundle.sql cpu apply
SQL> exit
To apply a patch using the rolling patch method:
$ cd Oracle_home/OPatch/12419331/12419331
$ opatch query -is_rolling_patch [unzipped patch location]
$ Oracle_home/bin/emctl stop dbconsole
$ Oracle_home/bin/srvctl stop instance -d sales -i "sales1" -f
$ Grid_home/crs/bin/crsctl stop cluster -n docrac1
$ Grid_home/bin/crsctl status resource -t
$ echo $ORACLE_HOME
/u01/app/oracle/product/11.2.0/dbhome_1
$ opatch apply -local
$ opatch apply -remote_nodes docrac2
$ opatch apply [-local_node docrac1] -remote_nodes docrac2,docrac3
$ Oracle_home/bin/srvctl start instance -d sales -i "sales1"
$ Oracle_home/bin/emctl start dbconsole
# Grid_home/bin/crsctl start cluster -n docrac1
$ Grid_home/bin/crsctl status resource -t
$ Oracle_home/bin/srvctl start instance -d sales -i "sales1"
# Grid_home/bin/crsctl start resource myResource -n docrac
$ sqlplus /nolog 
SQL> connect sys/password@sales1 AS SYSDBA
SQL> @Oracle_home/rdbms/admin/catbundle.sql cpu apply
SQL> exit

 apply a patch to your cluster database using the minimum downtime method:
  1. Change to the directory where the unzipped patch is staged on disk, for example:
    $ cd Oracle_home/OPatch/12419331/12419331
    
  2. Stop all user applications that use the Oracle RAC home directory for the group of nodes being patched. For example, to stop Enterprise Manager Database Control on the local node, use the following command, where Oracle_home is the home directory for your Oracle RAC installation:
    $ Oracle_home/bin/emctl stop dbconsole
    
  3. Shut down all Oracle RAC instances on the local node. To shut down an instance for an Oracle RAC database, enter a command similar to the following example, where Oracle_home is the home directory for your Oracle RAC database installation, sales is the name of the database, and sales1 is the name of the instance:
    $ Oracle_home/bin/srvctl stop instance -d sales -i "sales1" -f
    
  4. Make sure the ORACLE_HOME environment variable points to the software directory you want to patch, for example:
    $ echo $ORACLE_HOME
    /u01/app/oracle/product/11.2.0/dbhome_1
    
  5. Use the following command from within the patch directory:
    $ opatch apply -minimize_downtime
    
    If you run the OPatch command from the directory where the patch is staged on disk, then you do not need to specify the patch ID.
    OPatch asks if you are ready to patch the local node. After you confirm that the Oracle RAC instances on the local node have been shut down, OPatch applies the patch to the Oracle home directory on the local node. You are then asked to select the next nodes to be patched.
  6. After you shut down the Oracle RAC instances on the other nodes in the cluster, you can restart the Oracle RAC instance on the local node. Then, instruct OPatch that you are ready to patch the remaining nodes.
  7. After all the nodes have been patched, restart the Oracle RAC instances on the other nodes in the cluster. The following command shows how to start the orcl2instance for the Oracle RAC database named orcl:
    $ Oracle_home/bin/srvctl start instance -d orcl -i "orcl2"
     
    
  8. Verify that all the Oracle Clusterware resources were restarted on all the nodes in the cluster.
    $ crsctl check cluster
    
    If any of the cluster resources did not restart, then use either the CRSCTL or SRVCTL utility to restart them. For example, you can use commands similar the following to restart various cluster resources, where Grid_home is the home directory of your Oracle Grid Infrastructure for a cluster installation and Oracle_home is the home directory of your Oracle RAC database:
    $ Oracle_home/bin/srvctl start instance -d sales -i "sales1"
    # Grid_home/bin/crsctl start resource myResource -n docrac1
    
  9. Run any post-patch scripts that are mentioned in the patch instructions, for example:
    $ sqlplus /nolog 
    SQL> connect sys/password@sales1 AS SYSDBA
    SQL> @Oracle_home/rdbms/admin/catbundle.sql cpu apply
    SQL> exit

OPatch failed with error code 41

OPatch failed with error code 41 while applying the database patch in 11gR2 RAC

OPatch failed with error code 41 while applying the database patch in 11gR2 RAC


oracle@test4201 12646746]$ opatch apply
Oracle Interim Patch Installer version 11.2.0.3.5
Copyright (c) 2013, Oracle Corporation.  All rights reserved.


Oracle Home       : /u01/app/oracle/product/11203/testms
Central Inventory : /u01/app/oraInventory
   from           : /u01/app/oracle/product/11203/testms/oraInst.loc
OPatch version    : 11.2.0.3.5
OUI version       : 11.2.0.3.0
Log file location : /u01/app/oracle/product/11203/testms/cfgtoollogs/opatch/12646746_Oct_29_2013_05_27_23/apply2013-10-29_05-27-22AM_1.log

Applying interim patch '12646746' to OH '/u01/app/oracle/product/11203/testms'
Verifying environment and performing prerequisite checks...
Patch 12646746: Optional component(s) missing : [ oracle.network.cman, 11.2.0.3.0 ]
Prerequisite check "CheckActiveFilesAndExecutables" failed.
The details are:


Following executables are active :
/u01/app/oracle/product/11203/testms/lib/libclntsh.so.11.1
Log file location: /u01/app/oracle/product/11203/testms/cfgtoollogs/opatch/12646746_Oct_29_2013_05_27_23/apply2013-10-29_05-27-22AM_1.log

Recommended actions: OPatch needs to modify files which are being used by some processes.

OPatch failed with error code 41


In log it's showing that

36 [Oct 29, 2013 5:27:27 AM]    Start fuser command /sbin/fuser /u01/app/oracle/product/11203/testms/lib/libclntsh.so.11.1 at Tue Oct 29 05:27:27 UTC 2013
 37 [Oct 29, 2013 5:27:27 AM]    Finish fuser command /sbin/fuser /u01/app/oracle/product/11203/testms/lib/libclntsh.so.11.1 at Tue Oct 29 05:27:27 UTC 2013
 38 [Oct 29, 2013 5:27:27 AM]    Following executables are active :
 39                              /u01/app/oracle/product/11203/testms/lib/libclntsh.so.11.1
 40 [Oct 29, 2013 5:27:27 AM]    Prerequisite check "CheckActiveFilesAndExecutables" failed.
 41                              The details are:
 42
 43
 44                              Following executables are active :
 45                              /u01/app/oracle/product/11203/testms/lib/libclntsh.so.11.1
 46 [Oct 29, 2013 5:27:27 AM]    OPatch will clean up 'restore.sh,make.txt' files and 'rac,scratch,backup' directories.
 47                              You will be still able to rollback patches after this cleanup.
 48                              Do you want to proceed? [y|n]
 49 [Oct 29, 2013 5:27:30 AM]    Y (auto-answered by -silent)
 50 [Oct 29, 2013 5:27:30 AM]    User Responded with: Y
 51 [Oct 29, 2013 5:27:30 AM]    Size of directory "/u01/app/oracle/product/11203/testms/.patch_storage" before cleanup is 282613767 bytes.
 52 [Oct 29, 2013 5:27:30 AM]    Deleting the directory "/u01/app/oracle/product/11203/testms/.patch_storage/12646746_May_14_2012_16_17_31/backup"
 53 [Oct 29, 2013 5:27:30 AM]    Deleted the directory "/u01/app/oracle/product/11203/testms/.patch_storage/12646746_May_14_2012_16_17_31/backup"
 54 [Oct 29, 2013 5:27:30 AM]    Size of directory "/u01/app/oracle/product/11203/testms/.patch_storage" after cleanup is 282613767 bytes.
 55 [Oct 29, 2013 5:27:30 AM]    UtilSession: Backup area for restore has been cleaned up. For a complete list of files/directories
 56                              deleted, Please refer log file.
 57 [Oct 29, 2013 5:27:30 AM]    [ Error during Prerequisite for apply phase ] Detail:                              OUI-67074:ApplySession failed during prerequisite checks: Prerequisite check "Che
 58 [Oct 29, 2013 5:27:30 AM]    OUI-67035:System is intact, OPatch will not restore the system
 59 [Oct 29, 2013 5:27:30 AM]    Finishing ApplySession at Tue Oct 29 05:27:30 UTC 2013

Solution:

1.Identify the process which is accessing /u01/app/oracle/product/11203/testms/lib/libclntsh.so.11.1 executable.



[oracle@test4201 bp17]$ /sbin/fuser -v /u01/app/oracle/product/11203/testms/lib/libclntsh.so.11.1

                     USER        PID ACCESS COMMAND
/u01/app/oracle/product/11203/testms/lib/libclntsh.so.11.1:
                     oracle    23612 ....m emagent

[oracle@test4201 bp17]$ ps -ef|grep 23612
oracle   22753 21386  0 22:31 pts/6    00:00:00 grep --color=auto 23612
oracle   23612 12053  0 10:13 pts/11   00:00:39 /u01/app/oracle/product/11203/testms/bin/emagent

In my case, it's found that EM agent was running so I killed that process as it was test environment. In production environment, check the status and stop the EM agent.

[oracle@test4201 bin]$ kill -9 23612
[oracle@test4201 bin]$ /sbin/fuser -v /u01/app/oracle/product/11203/testms/lib/libclntsh.so.11.1
[oracle@test4201 bin]$ pwd

2. Now try to apply the patch.


[oracle@test4201 12646746]$ opatch apply                                                                                                                                                            Oracle Interim Patch Installer version 11.2.0.3.5                                                                                                                                                    Copyright (c) 2013, Oracle Corporation.  All rights reserved.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Oracle Home       : /u01/app/oracle/product/11203/testms                                                                                                                                            Central Inventory : /u01/app/oraInventory                                                                                                                                                               from           : /u01/app/oracle/product/11203/testms/oraInst.loc                                                                                                                                OPatch version    : 11.2.0.3.5                                                                                                                                                                       OUI version       : 11.2.0.3.0                                                                                                                                                                       Log file location : /u01/app/oracle/product/11203/testms/cfgtoollogs/opatch/12646746_Oct_29_2013_05_44_58/apply2013-10-29_05-44-58AM_1.log                                                                                                                                                                                                                                                               Applying interim patch '12646746' to OH '/u01/app/oracle/product/11203/testms'                                                                                                                      Verifying environment and performing prerequisite checks...                                                                                                                                          Patch 12646746: Optional component(s) missing : [ oracle.network.cman, 11.2.0.3.0 ]                                                                                                                  All checks passed.                                                                                                                                                                                   Provide your email address to be informed of security issues, install and                                                                                                                            initiate Oracle Configuration Manager. Easier for you if you use your My                                                                                                                             Oracle Support Email address/User Name.                                                                                                                                                              Visit http://www.oracle.com/support/policies.html for details.                                                                                                                                       Email address/User Name:                                                                                                                                                                                                                                                                                                                                                                                  You have not provided an email address for notification of security issues.
Do you wish to remain uninformed of security issues ([Y]es, [N]o) [N]:  Y



This node is part of an Oracle Real Application Cluster.
Remote nodes: 'test4202'
Local node: 'test4201'
Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
(Oracle Home = '/u01/app/oracle/product/11203/testms')


Is the local system ready for patching? [y|n]
y
User Responded with: Y
Backing up files...

Patching component oracle.network.rsf, 11.2.0.3.0...

Patching component oracle.rdbms, 11.2.0.3.0...

Patching component oracle.rdbms.rsf, 11.2.0.3.0...

Verifying the update...

The local system has been patched.  You can restart Oracle instances on it.


Patching in rolling mode.


The node 'test4202' will be patched next.


Please shutdown Oracle instances running out of this ORACLE_HOME on 'test4202'.
(Oracle Home = '/u01/app/oracle/product/11203/testms')

Is the node ready for patching? [y|n]
y
User Responded with: Y
Updating nodes 'test4202'
   Apply-related files are:
     FP = "/u01/app/oracle/product/11203/testms/.patch_storage/12646746_May_14_2012_16_17_31/rac/copy_files.txt"
     DP = "/u01/app/oracle/product/11203/testms/.patch_storage/12646746_May_14_2012_16_17_31/rac/copy_dirs.txt"
     MP = "/u01/app/oracle/product/11203/testms/.patch_storage/12646746_May_14_2012_16_17_31/rac/make_cmds.txt"
     RC = "/u01/app/oracle/product/11203/testms/.patch_storage/12646746_May_14_2012_16_17_31/rac/remote_cmds.txt"

Instantiating the file "/u01/app/oracle/product/11203/testms/.patch_storage/12646746_May_14_2012_16_17_31/rac/copy_files.txt.instantiated" by replacing $ORACLE_HOME in "/u01/app/oracle/product/11203/testms/.patch_storage/12646746_May_14_2012_16_17_31/rac/copy_files.txt" with actual path.
Propagating files to remote nodes...
Instantiating the file "/u01/app/oracle/product/11203/testms/.patch_storage/12646746_May_14_2012_16_17_31/rac/copy_dirs.txt.instantiated" by replacing $ORACLE_HOME in "/u01/app/oracle/product/11203/testms/.patch_storage/12646746_May_14_2012_16_17_31/rac/copy_dirs.txt" with actual path.
Propagating directories to remote nodes...
Instantiating the file "/u01/app/oracle/product/11203/testms/.patch_storage/12646746_May_14_2012_16_17_31/rac/make_cmds.txt.instantiated" by replacing $ORACLE_HOME in "/u01/app/oracle/product/11203/testms/.patch_storage/12646746_May_14_2012_16_17_31/rac/make_cmds.txt" with actual path.
Running command on remote node 'test4202':
cd /u01/app/oracle/product/11203/testms/rdbms/lib; /usr/bin/make -f ins_rdbms.mk ioracle ORACLE_HOME=/u01/app/oracle/product/11203/testms || echo REMOTE_MAKE_FAILED::>&2

Running command on remote node 'test4202':
cd /u01/app/oracle/product/11203/testms/rdbms/lib; /usr/bin/make -f ins_rdbms.mk client_sharedlib ORACLE_HOME=/u01/app/oracle/product/11203/testms || echo REMOTE_MAKE_FAILED::>&2

Running command on remote node 'test4202':
cd /u01/app/oracle/product/11203/testms/network/lib; /usr/bin/make -f ins_net_client.mk client_sharedlib ORACLE_HOME=/u01/app/oracle/product/11203/testms || echo REMOTE_MAKE_FAILED::>&2


The node 'test4202' has been patched.  You can restart Oracle instances on it.

There were relinks on remote nodes.  Remember to check the binary size and timestamp on the nodes 'test4202' .
The following make commands were invoked on remote nodes:
'cd /u01/app/oracle/product/11203/testms/rdbms/lib; /usr/bin/make -f ins_rdbms.mk ioracle ORACLE_HOME=/u01/app/oracle/product/11203/testms
cd /u01/app/oracle/product/11203/testms/rdbms/lib; /usr/bin/make -f ins_rdbms.mk client_sharedlib ORACLE_HOME=/u01/app/oracle/product/11203/testms
cd /u01/app/oracle/product/11203/testms/network/lib; /usr/bin/make -f ins_net_client.mk client_sharedlib ORACLE_HOME=/u01/app/oracle/product/11203/testms
'

Patch 12646746 successfully applied
Log file location: /u01/app/oracle/product/11203/testms/cfgtoollogs/opatch/12646746_Oct_29_2013_05_44_58/apply2013-10-29_05-44-58AM_1.log

OPatch succeeded.
[oracle@test4201 12646746]$ cd ..

Monday, 29 January 2018

Patches

What are Patches and how to apply patches ?
Patching  is one  of  the  most  common  task  performed  by  DBA's  in  day-to-day  life  . Here , we  will discuss  about  the various  types  of  patches  which  are  provided  by  Oracle  . Oracle  issues  product fixes  for  its  software called  patches. When  we  apply  the  patch  to  our  Oracle  software installation, it updates  the  executable  files, libraries,  and  object  files in  the software  home directory . The patch application  can  also  update  configuration  files and  Oracle-supplied  SQL schemas . Patches  are  applied by  using  OPatch, a utility supplied by Oracle , OUI  or  Enterprise Manager Grid Control .
Oracle Patches are of various kinds . Here , we are broadly categorizing  it  into  two groups .

1.) Patchset  :
2.) Patchset Updates :

1.) Patchset  :  A group of  patches  form  a  patch  set. Patchsets  are  applied  by  invoking OUI (Oracle Universal Installer) . Patchsets  are  generally  applied  for  Upgradation  purpose . This  results  in  a version change  for our  Oracle  software, for  example,  from  Oracle Database 11.2.0.1.0  to  Oracle  Database 11.2.0.3.0.  We will cover this issue later .

2.) Patchset Updates : Patch Set Updates  are  proactive cumulative patches containing  recommended bug fixes that are released on a regular and predictable schedule .  Oracle has catergaries as :

i.) Critical Patch Update (CPU)  now refers  to  the  overall  release of security  fixes each  quarter  rather than the cumulative database security  patch  for  the quarter.  Think  of  the  CPU as  the  overarching quarterly release and not as a single patch .

ii.) Patch Set Updates (PSU)  are  the same cumulative patches  that  include  both  the  security  fixes and priority  fixes.  The key with  PSUs  is  they are  minor version  upgrades   (e.g., 11.2.0.1.1  to  11.2.0.1.2). Once a  PSU  is  applied, only  PSUs  can  be  applied  in  future  quarters  until  the database  is  upgraded to a new base version.

iii.) Security Patch Update (SPU)  terminology  is  introduced  in  the October 2012 Critical Patch Update as  the  term  for the quarterly security patch.  SPU  patches are the same  as  previous  CPU  patches,  just a new  name .  For  the database, SPUs  can  not  be  applied  once  PSUs  have  been  applied  until  the database is  upgraded  to a  new base version.

iv.) Bundle Patches  are the quarterly patches for Windows  and  Exadata  which  include  both the quarterly security patches as well as recommended fixes.

PSUs(PatchSet Updates) or CPUs(Critical Patch Updates) ,SPU are applied via opatch utility.

How to get Oracle Patches :
We  obtain  patches  and  patch  sets  from  My Oracle Support (MOS) . The  ability  to  download a specific  patch  is  based  on  the contracts associated  to  the support  identifiers  in  our  My Oracle Support  account.  All  MOS  users  are  able  to  search  for  and  view all  patches,  but  we  will  be prevented  from  downloading  certain types  of  patches  based  on  our  contracts.

While   applying   Patchset or  patchset upgrades , basically there are two entities in the Oracle Database environment
i. )  Oracle Database Software
ii.)  Oracle Database

Most of the database patching activities involve, in the following sequence

 Update  "Oracle Database Software"  using   './runInstaller'  or   'opatch apply'   known  as "Installation"  Tasks.
Update  "Oracle Database"  (catupgrd.sql  or  catbundle.sql ...etc)  to  make  it  compatible  for  newly  patched  "Oracle database Software"   known  as  "Post Installation"  tasks.

Patchset  OR  CPU/PSU  (or one-off)  patch  contains  Post  Installation  tasks  to  be  executed  on  all Oracle  Database  instances  after  completing  the Installation  tasks. If  we  are  planning  to  apply  a patchset  along  with  required  one-off-patches (either CPU or PSU or any other one-off patch),  then  we can  complete  the  Installation  tasks  of  the   Patchset+CPU/PSU/one-off  patches at once and then execute  Post  Installation  tasks of  the  Patchset+CPU/PSU/one-off  patches  in  the  same sequence as they were  installed .

This  approach  minimizes  the  requirement  of  database  shutdown  across  each  patching  activity and simplifies  the  patching  mechanism as two tasks:
Software update and then
Database update.

Here , we  will  cover  the  Opatch Utility in details along with example.

OPatch  is  the  recommended (Oracle-supplied)  tool  that  customers  are  supposed  to  use  in  order to apply  or  rollback  patches. OPatch  is  PLATFORM  specific . Release is based on Oracle Universal Installer version .   OPatch  resides in  $ORACLE_HOME/OPatch .  OPatch  supports  the  following :

Applying  an  interim  patch.
Rolling  back  the  application  of  an  interim  patch.
Detecting  conflict  when  applying  an  interim  patch  after  previous  interim  patches  have  been applied.  It  also  suggests  the  best  options  to  resolve a conflict .
Reporting on installed products and interim patch.

The  patch  metadata  exist in  the  inventory.xml  and  action.xml  files  exists under <stage_area>/<patch_id>/etc/config/ 

Inventory  .xml  file  have  the  following  information :

Bug number
Unique Patch ID
Date of  patch year 
Required and Optional components
OS platforms ID
Instance shutdown is required or not
Patch can be applied online or not

Actions   .xml  file  have  the  following  information .

File name and it location to which it need to be copied
Components need to be re-linked
Information about the optional and required components


Here are steps for applying  patches on linux Platform :

1.) Download the required Patches from  My Oracle Support (MOS) :

Login to metalink.
Click "Patches & Updates" link on top menu.
On the patch search section enter patch number and select the platform of your database.
Click search.
On the search results page, download the zip file.

2.)  Opatch version  :
Oracle  recommends  that  we  use  the  latest  released  OPatch , which  is  available  for  download  from My  Oracle  Support .  OPatch  is compatible  only  with  the version  of  Oracle  Universal  Installer  that  is installed  in  the  Oracle  home. We  can  get  all  Opatch  command  by  using  Opatch  help  command .

3.) Stop all the Oracle services  :
Before applying Optach , make sure all the Oracle services are down . If they are not down then stop/down the oracle related Services . Let's crosscheck it

$ ps -ef |grep pmon
oracle   15871 15484  0 11:20 pts/2    00:00:00 grep pmon

$ ps -ef |grep tns
oracle   15874 15484  0 11:20 pts/2    00:00:00 grep tns

4.) Take Cold Backup : 
It  is  highly  recommended  to backup  the software  directory  which  we  are  patching  before  performing any  patch  operation . This  applies  to  Oracle  Database  or Oracle  Grid  Infrastructure  software installation  directories.  Take the backup of following

Take the Oracle software directory backup

$ tar -zcvf   /u01/app/oracle/product/11.2.0/ohsw-bkp-b4-ptch.tar.gz   /u01/app/oracle/product/11.2.0 

Take  backup of oracle database .

$ tar  -zcvf    /u01/app/oracle/oradata/dbfl-b4-ptch.tar.gz     /u01/app/oracle/oradata   
Here all the database files are in oradata  directory .

Take backup of OraInventary

$ tar  -zcvf   /u01/app/oraInventary/orinv-b4-ptch.tar.gz     /u01/app/oraInventary 


5.)  Apply  OPatches
Set  our current directory to the directory where the patch is located and then run the OPatch utility by entering the following commands:

$ export  PATH=$ORACLE_HOME/OPatch:$PATH:
$ opatch apply .


6.)  Post Installation :
Once , the  Opatch  installation  completed  successfully . Perform  the  post  Installation steps . Startup  the oracle  database  with  new  patched  software and  run catbundle.sql  scripts  which  is  found  in           $ORACLE_HOME/rdbms/admin   directory .
The catbundle.sql execution is reflected in the dba_registry_history view by a row associated with bundle series PSU.


7.) Finally check the status of patch status :
We can check the final status of applied patched new Oracle Home by using the below command .
SQL > select  *   from  dba_registry_history   order  by  action_time  desc ;


Notes :
i.) If  we are using  a  Data Guard Physical Standby database, we  must  install  this  patch  on  both  the primary  database and  the physical  standby database .

ii.)  While applying patching take care of  mount point status .There should be sufficient Space .

Featured post

Restircted session due to sync filed with ora-65177

Application is unable to connect the database due to restricted session. sql> show pdbs; SQL> show con_name CON_NAME -----------------...