Tags

Upgrading opatch utility consists of two steps

  1. Remove the old copy of opatch by deleting $OH/OPatch directory
  2. Unzip the replacement file into your Oracle home directory

But when you try to remove the contents of OPatch directory you get slammed with errors like this:

rm: cannot remove `jlib/.nfs0000000005213282002649ad’: Device or resource busy
rm: cannot remove `jlib/.nfs000000000523b2e4002649ae’: Device or resource busy


rm: cannot remove `ocm/lib/.nfs0000000005226a87002649b3′: Device or resource busy
rm: cannot remove `ocm/lib/.nfs0000000005226a88002649b4′: Device or resource busy

 

The lsof utility lists running processes associated with a directory if you use this syntax:

lsof +D <directory name>

 

Example

oms > pwd
/u01/oracle/product/em/oms/OPatch

oms > rm -rf *
rm: cannot remove `jlib/.nfs0000000005213282002649ad’: Device or resource busy
rm: cannot remove `jlib/.nfs000000000523b2e4002649ae’: Device or resource busy
rm: cannot remove `jlib/.nfs000000000523b2e5002649af’: Device or resource busy
rm: cannot remove `jlib/.nfs000000000524eaad002649b0′: Device or resource busy
rm: cannot remove `jlib/.nfs000000000524eaae002649b1′: Device or resource busy
rm: cannot remove `ocm/lib/.nfs0000000005226a87002649b3′: Device or resource busy
rm: cannot remove `ocm/lib/.nfs0000000005226a88002649b4′: Device or resource busy

oms > lsof +D oplan
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
java 3520 oracle mem REG 0,22 8760 83713032 oplan/jlib/.nfs0000000004fd5c08003d981f
java 3520 oracle mem REG 0,22 18675 83713035 oplan/jlib/.nfs0000000004fd5c0b003d9821
java 3520 oracle mem REG 0,22 6861 83713028 oplan/jlib/.nfs0000000004fd5c04003d981c

oms > kill -9 3520

oms > lsof +D oplan

< Nothing returned >
oms > pwd
/u01/oracle/product/em/oms/OPatch

oms > rm -rf *

oms > cd ../

oms > rmdir OPatch

oms > unzip /shared/oem_patches/opatch/p6880880_111000_Linux-x86-64.zip