天萃荷净

Oracle研究中心学习笔记:分享一篇关于Oracle数据库RAC环境中安装升级patch补丁的案例,在安装升级过程遇到one-off patch错误。

本站文章除注明转载外,均为本站原创: 转载自love wife & love life —Roger 的Oracle技术博客

本文链接地址: 比较BT的一个one-off patch

今天给某客户(买票难的问题,你们懂的)打一个one-off patch(11814167),遇到几个小问题,其中有件怪事,跟熊哥讨论了一下,他也感觉确实有点奇怪,按理说不应该啊。

首先来看下install patch(11814167)的基本步骤(大家可以参考readme):

1. 首先检查环境,使用了哪种存储方式?opatch 版本,当前集群状态?文件系统空间?

2. 解压patch以及update opatch(readme提到需要11.2.0.1.5以上版本的opatch);

unzip p11814167_112010_AIX64-5L.zip

unzip p6880880_112000_AIX64-5L.zip -d /grid/11.2

unzip p6880880_112000_AIX64-5L.zip -d /oracle/app/11.2

cluster中所有节点都需要更新.

3. 检查当前opatch信息并保存;

./opatch lsinventory -detail -oh /grid/11.2

./opatch lsinventory -detail -oh /oracle/app/11.2

4. 停止所有资源(包括crs,db以及em等等)

/oracle/app/11.2/bin/srvctl stop home -o /oracle/app/11.2 -s /tmp/morapp1.log -n morapp1-19

/oracle/app/11.2/bin/srvctl stop home -o /oracle/app/11.2 -s /tmp/morapp2.log -n morapp1-19

5. 以root用户执行如下脚本:

# /crs/install/rootcrs.pl -unlock --用法

node1: /grid/11.2/crs/install/rootcrs.pl -unlock

node2: /grid/11.2/crs/install/rootcrs.pl -unlock

6. patch for GI home

user by GI home owner:

node1: /grid/11.2/OPatch/opatch napply -oh /grid/11.2 -local /oradata1/patch/11814167

node2: /grid/11.2/OPatch/opatch napply -oh /grid/11.2 -local /oradata1/patch/11814167

7. Run the pre script for DB component of the patch

user by ORACLE_HOME owner

node1: /oradata1/patch/11814167/custom/server/11814167/custom/scripts/prepatch.sh -dbhome /oracle/app/11.2

node2: /oradata1/patch/11814167/custom/server/11814167/custom/scripts/prepatch.sh -dbhome /oracle/app/11.2

8. Apply the patch to DB Home :

As the database home owner execute:

node1: /oracle/app/11.2/OPatch/opatch napply -oh /oracle/app/11.2 -local /oradata1/patch/11814167/custom/server/11814167

node2: /oracle/app/11.2/OPatch/opatch napply -oh /oracle/app/11.2 -local /oradata1/patch/11814167/custom/server/11814167

9. Run the post script for DB component of the patch

As the database home owner execute

node1: /oradata1/patch/11814167/custom/server/11814167/custom/scripts/postpatch.sh -dbhome /oracle/app/11.2

node2: /oradata1/patch/11814167/custom/server/11814167/custom/scripts/postpatch.sh -dbhome /oracle/app/11.2

10. Run the post script by root.

/grid/11.2/rdbms/install/rootadd_rdbms.sh

/grid/11.2/crs/install/rootcrs.pl -patch

cluster中所有节点顺序执行。

11. Start the GI managed resources that were earlier running from DB homes

user by oracle_home owner.

node1: /oracle/app/11.2/bin/srvctl start home -o /oracle/app/11.2 -s /tmp/morapp1.log -n morapp1-19

node2: /oracle/app/11.2/bin/srvctl start home -o /oracle/app/11.2 -s /tmp/morapp1.log -n morapp2-19

12. 检查clsuter是否正常正常,可以使用crs_stat -t查询当前cluster资源使用情况。

如果大家看过readme就知道,oracle其实推荐的方式不是这种,是采取opatch auto的方式,但是我今天在开始使用这种方式的时候,发现了这种其实不好好,所谓auto的目的其实是将一系列的操作集成到一起了,虽然这样大大的简化了patch的工作量,但是这整个过程确显得跟黑匣子一样,不可控。

最开始我尝试了一下,发现不太好使,其中遇到了一个小错误,如下:

[Aug 12, 2011 10:40:45 AM] OPatch continues with these patches: 11814167

[Aug 12, 2011 10:40:45 AM] Do you want to proceed  [y|n]

[Aug 12, 2011 10:40:45 AM] Start to wait for user-input at Fri Aug 12 10:40:45 CST 2011

[Aug 12, 2011 10:40:57 AM] Finish waiting for user-input at Fri Aug 12 10:40:57 CST 2011

[Aug 12, 2011 10:40:57 AM] User Responded with: Y

[Aug 12, 2011 10:40:57 AM] Running prerequisite checks...

[Aug 12, 2011 10:40:57 AM] Space Needed : 22327897636

[Aug 12, 2011 10:40:57 AM] Required amount of space(22327897636) is not available.

[Aug 12, 2011 10:40:57 AM] Prerequisite check "CheckSystemSpace" failed.

The details are:

Required amount of space(22327897636) is not available.

[Aug 12, 2011 10:40:57 AM] OUI-67073:UtilSession failed: Prerequisite check "CheckSystemSpace" failed.

[Aug 12, 2011 10:40:57 AM] Finishing UtilSession at Fri Aug 12 10:40:57 CST 2011

很明显,从上面的意思来看是说当前的/grid目录太小了,剩余空间不足,大家注意这里的空间需求大小。

22327897636/1024/1024/1024=20.79G,很大的一个数字吧,当时客户也难以理解,怎么打个one-off patch还需要这么大的空间呢,确实有点让人费解。

这里简单的说明一下,该patch虽然说是one-off patch,其实可以看出一个bundle了,基本上把11.2.0.1的crs组件都更新了,所以变动非常大,以至于下载这个patch需要993m大小。

说到这里,我觉得这里就是readme的一个失误,因为里面没有提到关于空间的要求。

最后我没有使用patch auto的方式,而是采用了传统的方式,该readme文档中也有详细的过程说明,下面是在对2节点GI home patch的时候遇到的错误,当时这其实是我的失误,没有认真的看readme文档。

morapp2-19:/grid/11.2/bin$ /grid/11.2/OPatch/opatch napply -oh /grid/11.2 -local /oradata1/patch/11814167

Invoking OPatch 11.2.0.1.6

Oracle Interim Patch Installer version 11.2.0.1.6

Copyright (c) 2011, Oracle Corporation. All rights reserved.

UTIL session

Oracle Home : /grid/11.2

Central Inventory : /oracle/oraInventory

from : /etc/oraInst.loc

OPatch version : 11.2.0.1.6

OUI version : 11.2.0.1.0

Log file location : /grid/11.2/cfgtoollogs/opatch/opatch2011-08-12_11-24-50AM.log

Verifying environment and performing prerequisite checks...

OPatch continues with these patches: 11814167

Do you want to proceed  [y|n]

y

User Responded with: Y

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]: yes

Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.

(Oracle Home = '/grid/11.2')

Is the local system ready for patching  [y|n]

y

User Responded with: Y

Backing up files...

Applying interim patch '11814167' to OH '/grid/11.2'

Patching component oracle.crs, 11.2.0.1.0...

Copy failed from '/oradata1/patch/11814167/files/lib/libclsra11.so' to '/grid/11.2/lib/libclsra11.so'...

Please verify all applications associated with the Oracle Home '/grid/11.2' are shut down. If this is AIX, please perform solution documented in Note 739963.1 on https://myoraclesupport.oracle.com.

Do you want to retry copying the file  [y|n]

y

User Responded with: Y

Retry copying the file to '/grid/11.2/lib/libclsra11.so'.

Copy failed from '/oradata1/patch/11814167/files/lib/libdbcfg11.so' to '/grid/11.2/lib/libdbcfg11.so'...

Please verify all applications associated with the Oracle Home '/grid/11.2' are shut down. If this is AIX, please perform solution documented in Note 739963.1 on https://myoraclesupport.oracle.com.

Do you want to retry copying the file  [y|n]

y

User Responded with: Y

Retry copying the file to '/grid/11.2/lib/libdbcfg11.so'.

The following actions have failed:

Copy failed from '/oradata1/patch/11814167/files/lib/libclsra11.so' to '/grid/11.2/lib/libclsra11.so'...

Do you want to proceed  [y|n]

n

User Responded with: N

ApplySession failed in system modification phase... 'ApplySession::apply failed: Copy failed from '/oradata1/patch/11814167/files/lib/libclsra11.so' to '/grid/11.2/lib/libclsra11.so'...

'

Restoring "/grid/11.2" to the state prior to running NApply...

OPatch failed to restore the files from backup area. Not running "make".

NApply was not able to restore the home. Please invoke the following scripts:

- restore.[sh,bat]

- make.txt (Unix only)

to restore the ORACLE_HOME. They are located under

"/grid/11.2/.patch_storage/NApply/2011-08-12_11-24-50AM"

UtilSession failed: ApplySession failed in system modification phase... 'ApplySession::apply failed: Copy failed from '/oradata1/patch/11814167/files/lib/libclsra11.so' to '/grid/11.2/lib/libclsra11.so'...

'

Log file location: /grid/11.2/cfgtoollogs/opatch/opatch2011-08-12_11-24-50AM.log

OPatch failed with error code 73

morapp2-19:/grid/11.2/bin$

在该readme的最后明确提到了Special Instruction for AIX,遇到上诉错误的时候,可以先使用下面的方式来避免。

genld -l | grep /grid/11.2

genkld | grep /grid/11.2

executed by root: slibclean

这个属于失误,不多说了,下面来看在对$ORACLE_HOME patch的时候遇到的一件怪事.

morapp1-19:/oracle$ /oracle/app/11.2/OPatch/opatch napply -oh /oracle/app/11.2 -local /oradata1/patch/11814167/custom/server/11814167

Invoking OPatch 11.2.0.1.6

Oracle Interim Patch Installer version 11.2.0.1.6

Copyright (c) 2011, Oracle Corporation. All rights reserved.

UTIL session

Oracle Home : /oracle/app/11.2

Central Inventory : /oracle/oraInventory

from : /etc/oraInst.loc

OPatch version : 11.2.0.1.6

OUI version : 11.2.0.1.0

Log file location : /oracle/app/11.2/cfgtoollogs/opatch/opatch2011-08-12_12-34-32PM.log

Verifying environment and performing prerequisite checks...

OPatch continues with these patches: 11814167

Do you want to proceed  [y|n]

y

User Responded with: Y

Prerequisite check "CheckApplicable" failed.

The details are:

Patch 11814167:

Copy Action: Source File "/oradata1/patch/11814167/custom/server/11814167/files/bin/rawutl" does not exists or is not readable

'oracle.rdbms, 11.2.0.1.0': to '/oracle/app/11.2/bin/rawutl'

Copy Action: Source File "/oradata1/patch/11814167/custom/server/11814167/files/crs/sbs/clsrwrap" does not exists or is not readable

'oracle.rdbms, 11.2.0.1.0': Cannot copy file from 'clsrwrap' to '/oracle/app/11.2/crs/sbs/clsrwrap'

Copy Action: Source File "/oradata1/patch/11814167/custom/server/11814167/files/crs/sbs/diagcollection.sh" does not exists or is not readable

'oracle.rdbms, 11.2.0.1.0': Cannot copy file from 'diagcollection.sh' to '/oracle/app/11.2/crs/sbs/diagcollection.sh'

Copy Action: Source File "/oradata1/patch/11814167/custom/server/11814167/files/crs/sbs/localconfig" does not exists or is not readable

'oracle.rdbms, 11.2.0.1.0': Cannot copy file from 'localconfig' to '/oracle/app/11.2/crs/sbs/localconfig'

Copy Action: Source File "/oradata1/patch/11814167/custom/server/11814167/files/crs/sbs/srvctl" does not exists or is not readable

'oracle.rdbms, 11.2.0.1.0': Cannot copy file from 'srvctl' to '/oracle/app/11.2/crs/sbs/srvctl'

UtilSession failed: Prerequisite check "CheckApplicable" failed.

Log file location: /oracle/app/11.2/cfgtoollogs/opatch/opatch2011-08-12_12-34-32PM.log

OPatch failed with error code 73

怎么会包这个patch中文件需要的文件不存在呢?难道说客户下载的patch不全吗?

我解压开自己笔记本上下载的patch,到该目录下看了一下,发现居然也不存在,如下是今天的情况:

morapp1-19:/oradata1$ ls -ltr /oradata1/patch/11814167/custom/server/11814167/files/crs/sbs/diagcollection.sh

/oradata1/patch/11814167/custom/server/11814167/files/crs/sbs/diagcollection.sh not found

morapp1-19:/oradata1$ ls -ltr /oradata1/patch/11814167/custom/server/11814167/files/crs/sbs/diagcollection.sh*

-rw-r--r--    1 oracle   dba             486 May 06 23:28 /oradata1/patch/11814167/custom/server/11814167/files/crs/sbs/diagcollection.sh.sbs

morapp1-19:/oradata1$ ls -ltr /oradata1/patch/11814167/custom/server/11814167/files/crs/sbs/localconfig*

-rwxr-xr-x    1 oracle   dba           23825 May 06 23:28 /oradata1/patch/11814167/custom/server/11814167/files/crs/sbs/localconfig.sbs

morapp1-19:/oradata1$ ls -ltr /oradata1/patch/11814167/custom/server/11814167/files/crs/sbs/srvctl*

-rwxr-xr-x    1 oracle   dba            8073 May 06 23:28 /oradata1/patch/11814167/custom/server/11814167/files/crs/sbs/srvctl.sbs

morapp1-19:/oradata1$ ls -ltr /oradata1/patch/11814167/custom/server/11814167/files/crs/sbs*

morapp1-19:/oradata1$ ls -ltr /oradata1/patch/11814167/custom/server/11814167/files/crs/sbs*

total 70

-rwxr-xr-x    1 oracle   dba            8073 May 06 23:28 srvctl.sbs

-rwxr-xr-x    1 oracle   dba           23825 May 06 23:28 localconfig.sbs

-rw-r--r--    1 oracle   dba             486 May 06 23:28 diagcollection.sh.sbs

-rwxr-xr-x    1 oracle   dba            1498 May 06 23:28 clsrwrap.sbs

morapp1-19:/oradata1$

上面我们可以清楚的看到,所需要的rawutl文件不存在,其他4个文件的文件名不对,patch里面的文件多了一个文件后缀。

这是怎么回事呢 怪哉了,首先我将该如上4个文件进行重命名,如下操作:

morapp1-19:/oradata1/patch/11814167/custom/server/11814167/files/crs/sbs# mv srvctl.sbs srvctl

morapp1-19:/oradata1/patch/11814167/custom/server/11814167/files/crs/sbs# mv localconfig.sbs localconfig

morapp1-19:/oradata1/patch/11814167/custom/server/11814167/files/crs/sbs# mv diagcollection.sh.sbs diagcollection.sh

morapp1-19:/oradata1/patch/11814167/custom/server/11814167/files/crs/sbs# mv clsrwrap.sbs clsrwrap

morapp1-19:/oradata1/patch/11814167/custom/server/11814167/files/crs/sbs# ls -ltr

total 70

-rwxr-xr-x 1 oracle dba 8073 May 06 23:28 srvctl

-rwxr-xr-x 1 oracle dba 23825 May 06 23:28 localconfig

-rw-r--r-- 1 oracle dba 486 May 06 23:28 diagcollection.sh

-rwxr-xr-x 1 oracle dba 1498 May 06 23:28 clsrwrap

由于这是在patch for oracle home时遇到的问题,于是进行如下查找:

morapp1-19:/$find ./oracle/app -name rawutl

./oracle/app/11.2/bin/rawutl

发现$ORACLE_HOME下是有这个文件的,我于是将该文件cp到patch目录中。

morapp1-19:/$ cp /oracle/app/11.2/bin/rawutl /oradata1/patch/11814167/custom/server/11814167/files/bin/rawutl

morapp1-19:/$

最后再次尝试进行patch for $ORACLE_HOME,发现一切正常。

morapp1-19:/oradata1$ /oracle/app/11.2/OPatch/opatch napply -oh /oracle/app/11.2 -local /oradata1/patch/11814167/custom/server/11814167

Invoking OPatch 11.2.0.1.6

Oracle Interim Patch Installer version 11.2.0.1.6

Copyright (c) 2011, Oracle Corporation. All rights reserved.

UTIL session

Oracle Home : /oracle/app/11.2

Central Inventory : /oracle/oraInventory

from : /etc/oraInst.loc

OPatch version : 11.2.0.1.6

OUI version : 11.2.0.1.0

Log file location : /oracle/app/11.2/cfgtoollogs/opatch/opatch2011-08-12_12-58-27PM.log

Verifying environment and performing prerequisite checks...

OPatch continues with these patches: 11814167

Do you want to proceed  [y|n]

y

User Responded with: Y

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

Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.

(Oracle Home = '/oracle/app/11.2')

Is the local system ready for patching  [y|n]

y

User Responded with: Y

Backing up files...

Applying interim patch '11814167' to OH '/oracle/app/11.2'

Patching component oracle.rdbms, 11.2.0.1.0...

Patches 11814167 successfully applied.

Log file location: /oracle/app/11.2/cfgtoollogs/opatch/opatch2011-08-12_12-58-27PM.log

OPatch succeeded.

morapp1-19:/oradata1$

前面提到的怪事,其实就是为啥patch中的文件少了,而且名称不对?

--------------------------------------ORACLE-DBA----------------------------------------

最权威、专业的Oracle案例资源汇总之【学习笔记】Oracle RAC升级安装patch补丁的问题和解决办法

oracle补丁冲突解决方法,【学习笔记】Oracle RAC升级安装patch补丁的问题和解决办法...相关推荐

  1. oracle in查询 一直等待,学习笔记:Oracle awr 分析解决inactive transaction branch等待事件...

    天萃荷净 通过Oracle AWR报告分析inactive transaction branch等待事件的原因 分析一份awr,发现不太熟悉的等待事件"inactive transactio ...

  2. oracle protocol=beq 不可用,学习笔记:Oracle数据库坏块 深入研究obj$坏块导致exp/expdp不能执行原因...

    天萃荷净 深入研究Oracle坏块obj$导致exp/expdp不能执行导出的原因 上篇(案例:Oracle出现obj$坏块exp/expdp导出不能导出的解决办法ORA-01578 ORA-0111 ...

  3. oracle修改asm参数文件,学习笔记:Oracle RAC参数文件管理 修改创建asm中的spfile文件...

    天萃荷净 Oracle rac创建修改asm中的spfile文件内容 create spfile to asm --查看sid SQL> show parameter instance_name ...

  4. 文本比对的一种算法探索、比对算法中的难点及解决方法---学习笔记记录

    在录入文本里,有2种字符:"有效字符"和"多打字符"."有效字符"是指它在标准文本里可以找到唯一的"对应字符".&quo ...

  5. oracle 最大值及其_学习笔记:Oracle优化 SQL查询最大值 最小值时的优化方法案例...

    天萃荷净 select max(id),min(id) from table优化,分享开发DBA需求,在SQL语句查询最大值.最小值数据时的优化方式案例 1.查看数据库版本 SQL> selec ...

  6. oracle强制拉库跳过recovery,学习笔记:Oracle坏块 数据库recover恢复时遇到坏块的解决思路案例...

    天萃荷净 recover遇到坏块处理本质探讨,记录一次在Oracle数据库recover恢复过程中,遇到数据库坏块无法恢复的解决思路案例 如果在还原出来的数据文件中有坏块,而归档日志和联机日志是正常的 ...

  7. oracle 删除awr报告,学习笔记:Oracle awr入门 深入了解AWR报告

    天萃荷净 深入了解AWR报告,ASH与AWR报告的官方说明,数据库进程和性能视图获取 1.AWR与ASH概念 1.ASH 若是一个普通的会话(我是指没有大量地耗费资源),则对于性能调整来说无足轻重.但 ...

  8. ngss for oracle,学习笔记:Oracle bbed工具在Windows平台上兼容9i 10g 11g 12c运

    天萃荷净 配置使用在Windows操作系统中中运行Oracle bbed程序兼容9i 10g 11g 12c 学习ORACLE三剑客:互联网,ORACLE资料,交流.今天在朋友的帮助下,了结了一个心结 ...

  9. oracle12c口令文件,学习笔记:Oracle 12C ASM 新特性 共享密码文件

    天萃荷净 测试试验ORACLE 12C ASM 新特性 共享密码文件的详细过程 在ORACLE 12C之前大家都知道密码文件是存放在?/dbs或者?/database中,如果要修改修改sysdba权限 ...

  10. oracle 操作系统升级,学习笔记:Oracle升级 linux操作系统10.2.0.1 升级至 10.2.0.3详细过程...

    天萃荷净 记录一次用户现场Oracle 10G数据库升级的过程,Linux操作环境 FOR 10.2.0.1 to 10.2.0.3的版本升级过程 数据库版本linux 32位(10.2.0.1升级到 ...

最新文章

  1. LeetCode简单题之二叉搜索树的最小绝对差/最小距离
  2. oracle11g dataguard windows,Oracle11g 搭建DataGuard(笔记)
  3. bulter机器人_科普!九款使用率最高的物流机器人大盘点!
  4. 一个网页设计师应该考虑的9件事
  5. Android Mms 数据库
  6. [外挂4] 用CE查找棋盘基址
  7. Atitit 常用比较复杂的图像滤镜 attilax大总结
  8. PHP高并发和大流量解决方案
  9. matlab代码注释方法--单行多行
  10. OneNote2013打开共享
  11. win10中MySQL5.7重置密码
  12. 风险投资的TS和DD
  13. Ubuntu进入登录界面鼠标键盘失灵
  14. 秦安三中2021高考一成绩查询,喜报!天水一中、三中、五中2019年高考成绩来了!...
  15. 个人收藏的一些资源网站
  16. H264编码技术[3]
  17. windows服务器运维
  18. 蓝屏的硬件原因及解决
  19. STM32F767ZI-NUCLEO移植运行micropython过程记录
  20. rstudio安装后如何打开_【R教程】R与RStudio简介及安装

热门文章

  1. matlab鼠标箭头黑色,个性化的黑色箭头鼠标指针(falchion光标)安装版本
  2. 中青杯数学建模竞赛是什么级别的比赛_2020年第三届中青杯全国大学生数学建模竞赛...
  3. 中国银行业发展前景预测与未来战略规划建议报告2022-2028年版
  4. 解除windows10多账户远程桌面连接限制
  5. 3t中文 studio_mongodb,Studio 3T | MongoDB中文社区
  6. 毕业设计 大学生心理健康管理平台
  7. html实现画板的基本操作,JavaScript操作Canvas实现画板实例分析
  8. 用3DSMAX制作室内效果图的九大步骤
  9. 后端开发之如何写接口设计文档
  10. ffmpeg 解决视频边播放边加载的问题