Oracle PSU升级 细节引起的报错


事情的经过时这样的,最近在装一台自己的Oracle 11.2.0.4的数据库,应用11.2.0.4.4的GI PSU,我的命令是:


但是在应用GI PSU的过程中,我却总是遇到如下错误,安装包检查不通过
[root@sfpay-sypay-test-db01 OPatch]# ./opatch auto /u01/20996923/ -ocmrf /u01/app/11.2.0.4/grid/OPatch/ocm.rsp 
Executing /u01/app/11.2.0.4/grid/perl/bin/perl ./crs/patch11203.pl -patchdir /u01 -patchn 20996923 -ocmrf /u01/app/11.2.0.4/grid/OPatch/ocm.rsp -paramfile /u01/app/11.2.0.4/grid/crs/install/crsconfig_params


This is the main log file: /u01/app/11.2.0.4/grid/cfgtoollogs/opatchauto2017-01-15_17-00-35.log


This file will show your detected configuration and all the steps that opatchauto attempted to do on your system:
/u01/app/11.2.0.4/grid/cfgtoollogs/opatchauto2017-01-15_17-00-35.report.log


2017-01-15 17:00:35: Starting Oracle Restart Patch Setup
Using configuration parameter file: /u01/app/11.2.0.4/grid/crs/install/crsconfig_params


Stopping RAC /u01/app/oracle/product/11.2.0.4/dbhome_1 ...
Stopped RAC /u01/app/oracle/product/11.2.0.4/dbhome_1 successfully


patch /u01/20996923/20760982  apply successful for home  /u01/app/oracle/product/11.2.0.4/dbhome_1 
patch /u01/20996923/20831122/custom/server/20831122  apply successful for home  /u01/app/oracle/product/11.2.0.4/dbhome_1 


Stopping CRS...
Stopped CRS successfully


Error : The opatch Applicable check failed.  The patch /u01/20996923/20831122 is not applicable to /u01/app/11.2.0.4/grid
Error:Patch Applicable check failed for /u01/app/11.2.0.4/grid


Starting CRS...
ERROR: Prereq checkApplicable failed. Refer log file for more details.




opatch auto failed.
You have new mail in /var/spool/mail/root
[root@sfpay-sypay-test-db01 OPatch]# su - grid






不论命令怎么修改,这个错误总是如影随行,其实殊不知是因为自己忽略的一些东西而导致的,后面再告诉你是什么。
第一次遇到错误时,看了一下opatch的日志opatchauto2014-11-20_23-10-24.log,结果发现日志存在一下内容:
................
................
................


End Command output
2017-01-15 17:05:19: Successfully unlock /u01/app/11.2.0.4/grid


2017-01-15 17:05:19: Invoking removeproc to clean oracle client procs
2017-01-15 17:05:19: Executing cmd: /sbin/fuser -k /u01/app/11.2.0.4/grid/bin/crsctl.bin
2017-01-15 17:05:19: fuser command output for /u01/app/11.2.0.4/grid/bin/crsctl.bin is 
2017-01-15 17:05:19: Oracle user for /u01/app/11.2.0.4/grid is grid
2017-01-15 17:05:19: Opening file /etc/oracle/ocr.loc
2017-01-15 17:05:19: Value (TRUE) is set for key=local_only
2017-01-15 17:05:19: Running as user grid: /u01/app/11.2.0.4/grid/OPatch/opatch prereq CheckApplicable -ph /u01/20996923/20760982 -oh /u01/app/11.2.0.4/grid
2017-01-15 17:05:19: s_run_as_user2: Running /bin/su grid -c ' /u01/app/11.2.0.4/grid/OPatch/opatch prereq CheckApplicable -ph /u01/20996923/20760982 -oh /u01/app/11.2.0.4/grid '
2017-01-15 17:05:23: Removing file /tmp/fileX6Gl0J
2017-01-15 17:05:23: Successfully removed file: /tmp/fileX6Gl0J
2017-01-15 17:05:23: /bin/su successfully executed


2017-01-15 17:05:23: Running as user grid: /u01/app/11.2.0.4/grid/OPatch/opatch prereq CheckApplicable -ph /u01/20996923/20831122 -oh /u01/app/11.2.0.4/grid
2017-01-15 17:05:23: s_run_as_user2: Running /bin/su grid -c ' /u01/app/11.2.0.4/grid/OPatch/opatch prereq CheckApplicable -ph /u01/20996923/20831122 -oh /u01/app/11.2.0.4/grid '
2017-01-15 17:05:26: Removing file /tmp/fileIqgOTD
2017-01-15 17:05:26: Successfully removed file: /tmp/fileIqgOTD
2017-01-15 17:05:26: /bin/su exited with rc=1


2017-01-15 17:05:26: Error : The opatch Applicable check failed.  The patch /u01/20996923/20831122 is not applicable to /u01/app/11.2.0.4/grid
2017-01-15 17:05:26: Running as user grid: /u01/app/11.2.0.4/grid/OPatch/opatch prereq CheckApplicable -ph /u01/20996923/20299019 -oh /u01/app/11.2.0.4/grid
2017-01-15 17:05:26: s_run_as_user2: Running /bin/su grid -c ' /u01/app/11.2.0.4/grid/OPatch/opatch prereq CheckApplicable -ph /u01/20996923/20299019 -oh /u01/app/11.2.0.4/grid '
2017-01-15 17:05:29: Removing file /tmp/fileLl7zcG
2017-01-15 17:05:29: Successfully removed file: /tmp/fileLl7zcG
2017-01-15 17:05:29: /bin/su successfully executed


2017-01-15 17:05:29: Status of Applicable  check  for /u01/app/11.2.0.4/grid is 1
2017-01-15 17:05:29: Error:Patch Applicable check failed for /u01/app/11.2.0.4/grid
2017-01-15 17:05:29: Executing cmd: /bin/rpm -q sles-release
2017-01-15 17:05:29: Command output:
>  package sles-release is not installed 
>End Command output     -----这一段,很容易让人步入歧途,消耗无谓的时间。

2017-01-15 17:05:29: init file = /u01/app/11.2.0.4/grid/crs/init/init.ohasd
2017-01-15 17:05:29: Copying file /u01/app/11.2.0.4/grid/crs/init/init.ohasd to /etc/init.d directory
2017-01-15 17:05:29: Setting init.ohasd permission in /etc/init.d directory
2017-01-15 17:05:29: init file = /u01/app/11.2.0.4/grid/crs/init/ohasd
2017-01-15 17:05:29: Copying file /u01/app/11.2.0.4/grid/crs/init/ohasd to /etc/init.d directory
2017-01-15 17:05:29: Setting ohasd permission in /etc/init.d directory
2017-01-15 17:05:29: Executing cmd: /bin/rpm -q sles-release
2017-01-15 17:05:29: Command output:
>  package sles-release is not installed 
>End Command output
2017-01-15 17:05:29: Removing "/etc/rc.d/rc3.d/S96ohasd"


..................
.................
..................


说是,我的系统缺失sles-release包。这个事SuSe的版本包呀,我的系统是RedHat的呀,虽然RHEL 里面的redhat-release包被替换成了redhat-release-server-6Server的名字,但是这和它有什么关系呢?
另外一个问题,GI PSU应用失败和这个错误有关系吗?暂时不知道,但是日志里面目前只有这个Error,所以不管三七二十一,既然它报错了就把这个包给补上吧。这个包还真不好找,最后还是在MOS上找到了(ID 1621417.1),其实就是没有任何内容的空的rpm安装包而已(是否可以自己打包一个??)。
本以为安装完这个补丁后问题能够被解决,呵呵,当然还是以应用PSU失败了,只不过现在不再出现找不到sles-release的错误而已。
那么问题到底出在哪呢?
我们都知道其实在使用opatch应用PSU时,它会把每一步操作都输出到:opatchauto2014-11-20_23-10-24.report.log 日志中。
那么我们就把这些命令挨个手工执行一下试试,先从prereq的升级前检查工作开始。注意,crs_home的check使用grid用户,rac_home的check使用oracle用户。
结果发现,当执行到:/soft/product/11.2.0.4/gih/OPatch/opatch prereq CheckApplicable -ph /soft/11.2.0.4.4/19380115/19121549 -oh /soft/product/11.2.0.4/gih 时报错了,而且这正好就是opatch auto报错退出的地方。
那么应该就是和这个地方有关了吧?我们先来看一下报错内容:




[root@sfpay-sypay-test-db01 u01]# ll
total 128
drwxr-xr-x.  5 root root      4096 Jul  1  2015 20996923    --错误的根源
drwxr-xr-x.  6 grid oinstall  4096 Jan 15 15:27 app
drwxr-xr-x.  7 grid oinstall  4096 Aug 27  2013 database
drwxr-xr-x.  7 grid oinstall  4096 Aug 27  2013 grid
drwxr-xr-x   2 grid oinstall 16384 Jan 15 12:03 lost+found
drwxr-x---. 10 grid oinstall  4096 Jun  5  2015 OPatch








--------------------
>  CRS-4639: Could not contact Oracle High Availability Services 
>End Command output
2017-01-15 17:45:37: Successfully unlock /u01/app/11.2.0.4/grid


2017-01-15 17:45:37: Invoking removeproc to clean oracle client procs
2017-01-15 17:45:37: Executing cmd: /sbin/fuser -k /u01/app/11.2.0.4/grid/bin/crsctl.bin
2017-01-15 17:45:37: fuser command output for /u01/app/11.2.0.4/grid/bin/crsctl.bin is 
2017-01-15 17:45:37: Oracle user for /u01/app/11.2.0.4/grid is grid
2017-01-15 17:45:37: Opening file /etc/oracle/ocr.loc
2017-01-15 17:45:37: Value (TRUE) is set for key=local_only
2017-01-15 17:45:37: Running as user grid: /u01/app/11.2.0.4/grid/OPatch/opatch prereq CheckApplicable -ph /u01/20996923/20760982 -oh /u01/app/11.2.0.4/grid
2017-01-15 17:45:37: s_run_as_user2: Running /bin/su grid -c ' /u01/app/11.2.0.4/grid/OPatch/opatch prereq CheckApplicable -ph /u01/20996923/20760982 -oh /u01/app/11.2.0.4/grid '
2017-01-15 17:45:41: Removing file /tmp/fileWLnj0b
2017-01-15 17:45:41: Successfully removed file: /tmp/fileWLnj0b
2017-01-15 17:45:41: /bin/su successfully executed


2017-01-15 17:45:41: Running as user grid: /u01/app/11.2.0.4/grid/OPatch/opatch prereq CheckApplicable -ph /u01/20996923/20831122 -oh /u01/app/11.2.0.4/grid
2017-01-15 17:45:41: s_run_as_user2: Running /bin/su grid -c ' /u01/app/11.2.0.4/grid/OPatch/opatch prereq CheckApplicable -ph /u01/20996923/20831122 -oh /u01/app/11.2.0.4/grid '
2017-01-15 17:45:45: Removing file /tmp/fileUAp5xM
2017-01-15 17:45:45: Successfully removed file: /tmp/fileUAp5xM
2017-01-15 17:45:45: /bin/su successfully executed


2017-01-15 17:45:45: Running as user grid: /u01/app/11.2.0.4/grid/OPatch/opatch prereq CheckApplicable -ph /u01/20996923/20299019 -oh /u01/app/11.2.0.4/grid
2017-01-15 17:45:45: s_run_as_user2: Running /bin/su grid -c ' /u01/app/11.2.0.4/grid/OPatch/opatch prereq CheckApplicable -ph /u01/20996923/20299019 -oh /u01/app/11.2.0.4/grid '
2017-01-15 17:45:47: Removing file /tmp/fileC7r4iv
2017-01-15 17:45:47: Successfully removed file: /tmp/fileC7r4iv
2017-01-15 17:45:47: /bin/su successfully executed


2017-01-15 17:45:47: Status of Applicable  check  for /u01/app/11.2.0.4/grid is 1
2017-01-15 17:45:47: Oracle user for /u01/app/11.2.0.4/grid is grid
2017-01-15 17:45:47: Executing command /u01/app/11.2.0.4/grid/OPatch/opatch napply /u01/20996923/20760982 -local -silent -ocmrf /u01/app/11.2.0.4/grid/OPatch/ocm.rsp -oh /u01/app/11.2.0.4/grid -invPtrLoc /u01/app/11.2.0.4/grid/oraInst.loc as grid
2017-01-15 17:45:47: Running as user grid: /u01/app/11.2.0.4/grid/OPatch/opatch napply /u01/20996923/20760982 -local -silent -ocmrf /u01/app/11.2.0.4/grid/OPatch/ocm.rsp -oh /u01/app/11.2.0.4/grid -invPtrLoc /u01/app/11.2.0.4/grid/oraInst.loc
2017-01-15 17:45:47: s_run_as_user2: Running /bin/su grid -c ' /u01/app/11.2.0.4/grid/OPatch/opatch napply /u01/20996923/20760982 -local -silent -ocmrf /u01/app/11.2.0.4/grid/OPatch/ocm.rsp -oh /u01/app/11.2.0.4/grid -invPtrLoc /u01/app/11.2.0.4/grid/oraInst.loc '
---------------------


[root@sfpay-sypay-test-db01 OPatch]# ./opatch auto /u01/20996923/ -ocmrf /u01/app/11.2.0.4/grid/OPat
Executing /u01/app/11.2.0.4/grid/perl/bin/perl ./crs/patch11203.pl -patchdir /u01 -patchn 20996923 -.4/grid/OPatch/ocm.rsp -paramfile /u01/app/11.2.0.4/grid/crs/install/crsconfig_params


This is the main log file: /u01/app/11.2.0.4/grid/cfgtoollogs/opatchauto2017-01-15_17-40-20.log


This file will show your detected configuration and all the steps that opatchauto attempted to do on
/u01/app/11.2.0.4/grid/cfgtoollogs/opatchauto2017-01-15_17-40-20.report.log


2017-01-15 17:40:20: Starting Oracle Restart Patch Setup
Using configuration parameter file: /u01/app/11.2.0.4/grid/crs/install/crsconfig_params


Stopping RAC /u01/app/oracle/product/11.2.0.4/dbhome_1 ...
Stopped RAC /u01/app/oracle/product/11.2.0.4/dbhome_1 successfully


patch /u01/20996923/20760982  apply successful for home  /u01/app/oracle/product/11.2.0.4/dbhome_1 
patch /u01/20996923/20831122/custom/server/20831122  apply successful for home  /u01/app/oracle/prod 


Stopping CRS...
patch /u01/20996923/20760982  apply successful for home  /u01/app/11.2.0.4/grid 
patch /u01/20996923/20831122  apply successful for home  /u01/app/11.2.0.4/grid 


--这里是成功的标致, 剩下的,在启动实例后,在$ORACLE_HOME/rdbms/admin 下执行对应的脚本即可。
-------




终于正常了,一个小小的权限问题,业务不很细,很小,但是往往在最关键的时候,发挥巨大的作用。
于是,第一次psu 失败了,通过日志,还在担心是否这个包未安装所致。 但实际上,并不是这样,就因为一个小小的权限不同所致。


想想也应该这样,root 下,grid 怎么能有权限了。 


一项工作,做久了,大的方向,大的有可能出现的故障,风险点或许都会考虑到,但是往往忽略了最小最细的那一部分,貌似没有影响,却往往在关键的时候,宰你一刀。


所以,细心,任何一项任务的变更,设置,最好有个文档,一个流程话checklist 检查项,这样,就会少耗时间和经理。




当然,如果你想做一个故障测试,也是大手大脚猫爪一点,也无妨。。(如果是时间紧,任务重最好打消这种想法,在关键的 时候。)


  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值