8.Oracle打补丁-CheckActiveFilesAndExecutables

文章讲述了在应用Oracle补丁时遇到的错误,如由于仍有活跃的文件句柄导致的权限问题。提供了检查和解决问题的步骤,包括使用fuser和lsof命令找出并结束相关进程,以及在回滚补丁后删除oui-patch.xml文件以避免下次打补丁时的冲突。

1.打补丁报错还有活跃的文件

原因是没有关闭彻底,还有进程句柄存在。

Bug 27554103 Opatchauto fails due to Prereq "CheckActiveFilesAndExecutables" and not Writable Binary (Permission denied)
which Permission denied on libasmclntsh12.so
Dec 13, 2020 10:25:38 PM] [INFO] --------------------------------------------------------------------------------
[Dec 13, 020 10:25:38 PM] [INFO] The following warnings have occurred during OPatch execution:
[Dec 13, 2020 10:25:38 PM] [INFO] 1) OUI-67124:ApplySession failed in system modification phase... 
'ApplySession::apply failed: mv: cannot rename /u01/app/12.2.0/grid/lib/libasmclntsh12.so 
to /u01/app/12.2.0/grid/lib/libasmclntsh12.so.bak: Permission denied
make: Fatal error: Command failed for target `update_patchrep'
++the solution 

2.检查。

su - root  
cd $GI_HOME/bin
./cluutil -ckpt -oraclebase /u01/app/orale  -writeckpt -name ROOTCRS_PREPATCH -state START
然后打补丁:

3.删除补丁说明文档

来给大家科普一个知识:回滚完补丁,重新打别的补丁时会报:
Following patches were skipped:
reason: 补丁号 is not required to be applied to oracle home  /oracle/app/19c/grid/

此时进去目录:
/oracle/app/19c/grid/inventory/ContentsXML/
rm -rf oui-patch.xml 
/oracle/app/oracle/product/19c/db_1/inventory/ContentsXML/
rm -rf oui-patch.xml 

原因是打补丁的时候会扫描:这个oui-patch.xml 文件,而这个文件保留了之前打过的补丁,虽然我们前面已经回退成功,但是扫描到这个文件时,oracle以为已经打了该补丁,但实际上我们已经回退,从而导致补丁应用失败。
于是,删除该文件即可。
再次打补丁时,会自动生产该文件。

checkactiveFileAndExecuttable 处理方法:

1.根据报错日志中提示执行:
fuser /app/......lib 等文件 

2.执行lsof 
lsof /.....lib 

此时会列出相关活跃的进程号。

3.杀掉该活跃的进程
kill 进程

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值