由高权限目录引起的OPatch auto补丁失败一例
Oracle GI的高度自动化 、智能化功能伴随着系统体系架构的复杂性增加,随之而来的运维管理要求也在逐步攀升。仅从DBA角度看,除了
Oracle GI的高度自动化 、智能化功能伴随着系统体系架构的复杂性增加,随之而来的运维管理要求也在逐步攀升。仅从DBA角度看,,除了数据库核心技术之外,网络、存储、主机系统等相关技术的要求也在“水涨船高”。在这样的背景下,Oracle对一些复杂性很强的操作,也在逐版本的进行封装简化。
这样的变化的确可以帮助我们解决很多问题,减少很多负担。但是,不完全的文档和谬误的经验秘籍可能会帮上倒忙。这个时候,还是需要我们进行逐层分析,慢慢解决问题。
本篇主要介绍在进行OPatch auto模式给GI打补丁过程中遇到的一个问题,记录下来,待有需要的朋友不时之需。
1、问题说明
笔者使用环境为Oracle 11gR2,小版本为11.2.0.4。
SQL> select * from v$version;
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
PL/SQL Release 11.2.0.4.0 - Production
CORE 11.2.0.4.0 Production
TNS for Linux: Version 11.2.0.4.0 - Production
NLSRTL Version 11.2.0.4.0 – Production
底层环境为GI+Single Instance Database,为了进行安全升级,计划打GI的PSU升级包。
首先,根据提示要求,关闭监听器、数据库实例和ASM实例。
[grid@NCR-Standby-Asm 19852360]$ srvctl stop database -d sicsstb
PRCC-1016 : sicsstb was already stopped
[grid@NCR-Standby-Asm 19852360]$ srvctl stop asm
PRCR-1065 : Failed to stop resource ora.asm
CRS-2529: Unable to act on 'ora.asm' because that would require stopping or relocating 'ora.DATA.dg', but the force option was not specified
[grid@NCR-Standby-Asm 19852360]$ srvctl stop asm -f
[grid@NCR-Standby-Asm 19852360]$ srvctl stop listener
[grid@NCR-Standby-Asm 19852360]$ crsctl stat res -t -init
--------------------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA.dg
ONLINE OFFLINE ncr-standby-asm
ora.LISTENER.lsnr
OFFLINE OFFLINE ncr-standby-asm
ora.RECO.dg
ONLINE OFFLINE ncr-standby-asm
ora.asm
OFFLINE OFFLINE ncr-standby-asm Instance Shutdown
ora.ons
OFFLINE OFFLINE ncr-standby-asm
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.cssd
1 ONLINE ONLINE ncr-standby-asm
ora.diskmon
1 OFFLINE OFFLINE
ora.evmd
1 ONLINE ONLINE ncr-standby-asm
ora.sicsstb.db
1 OFFLINE OFFLINE Instance Shutdown
安装包解压。
[root@NCR-Standby-Asm gidir]# ls -l
total 1338912
-rw-r--r-- 1 root root 665035674 May 25 10:27 p20485808_112040_Linux-x86-64.zip
[root@NCR-Standby-Asm gidir]# unzip p20485808_112040_Linux-x86-64.zip
inflating: 20485808/20299019/files/bin/acfsrepl_monitor
inflating: 20485808/20299019/files/bin/acfsdriverstate
inflating: 20485808/20299019/files/bin/acfsreplcrs
inflating: 20485808/20299019/files/bin/acfsrepl_initializer
inflating: 20485808/20299019/files/bin/acfsreplcrs.pl
inflating: 20485808/20299019/files/bin/acfsregistrymount
inflating: 20485808/20299019/README.txt
creating: 20485808/20299019/custom/
creating: 20485808/20299019/custom/scripts/
inflating: 20485808/20299019/custom/scripts/prepatchverify.sh
inflating: 20485808/20299019/custom/scripts/pre.txt
inflating: 20485808/20299019/custom/scripts/post.txt
inflating: 20485808/bundle.xml
inflating: PatchSearch.xml
[root@NCR-Standby-Asm gidir]# ls -l
total 1338920
drwxr-xr-x 5 root root 4096 Mar 27 23:33 20485808
-rw-r--r-- 1 root root 665035674 May 25 10:27 p20485808_112040_Linux-x86-64.zip
进入目录,确定文件目录权限对应的都是root所有者。
[root@NCR-Standby-Asm gidir]# cd 20485808/
[root@NCR-Standby-Asm 20485808]# ls -l
total 136
drwxrwxr-x 8 root root 4096 Mar 4 18:30 20299013
drwxr-xr-x 5 root root 4096 Mar 27 23:26 20299019
drwxr-xr-x 5 root root 4096 Mar 27 23:19 20420937
-rw-r--r-- 1 root root 549 Mar 27 23:32 bundle.xml
-rw-rw-r-- 1 root root 61184 Mar 6 13:43 PatchSearch.xml
-rw-rw-r-- 1 root root 60655 Apr 13 15:17 README.html
-rw-r--r-- 1 root root 0 Mar 27 23:33 README.txt
使用OPatch auto模式,要求输入一个OCM(Oracle Configuration Manager)的相应文件response file,用于进行多个Patch安装过程中的交互信息的输入。
生成OCM响应文件,要进入OPatch生成。
[grid@NCR-Standby-Asm gidir]$ cd $ORACLE_HOME
[grid@NCR-Standby-Asm grid]$ cd OPatch
[grid@NCR-Standby-Asm OPatch]$ cd ocm/bin
[grid@NCR-Standby-Asm bin]$ ls -l
total 12
-rwxr-x--- 1 grid oinstall 9063 Nov 27 2009 emocmrsp
调用emocmrsp脚本生成。
[grid@NCR-Standby-Asm bin]$ ./emocmrsp -no_banner -output /u01/unconfig.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 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 (/u01/unconfig.rsp) was successfully created.
Validation of Oracle Inventory
GI和Database的Home目录对比。由于GI补丁过程是要进行GI和database两个组件,要进行一下目录对比。
[grid@NCR-Standby-Asm bin]$ env | grep ORACLE_HOME
ORACLE_HOME=/u01/app/grid/product/11.2.0/grid
[oracle@NCR-Standby-Asm ~]$ env | grep ORACLE_HOME
ORACLE_HOME=/u02/app/oracle/product/11.2.0/dbhome_1
[grid@NCR-Standby-Asm bin]$ opatch lsinventory -detail -oh /u02/app/oracle/product/11.2.0/dbhome_1
OPatch could not create/open history file for writing.
Oracle Interim Patch Installer version 11.2.0.3.10
Copyright (c) 2015, Oracle Corporation. All rights reserved.
Oracle Home : /u02/app/oracle/product/11.2.0/dbhome_1
Central Inventory : /u01/app/oraInventory
from : /u02/app/oracle/product/11.2.0/dbhome_1/oraInst.loc
OPatch version : 11.2.0.3.10
OUI version : 11.2.0.4.0
Log file location : /u02/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch2015-05-25_14-51-28PM_1.log
Lsinventory Output file location : /u02/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/lsinv/lsinventory2015-05-25_14-51-28PM.txt
--------------------------------------------------------------------------------
Local Machine Information::
Hostname: localhost
ARU platform id: 226
ARU platform description:: Linux x86-64
Installed Top-level Products (1):