Install GI and DB PSU 11.2.0.2.5 Failed in VirtualBox

Oracle的Apply Patchset的方法一直是为人诟病的,其实步骤复杂倒也罢了,怕的是Oracle总在不停地修改Apply Patch的方法,Oracle的原意是让Apply Patch的语法越来越简单,但是各种各样的Patch,各种不同的命令,特别是很大的Bundle Patch,如果不仔细阅读Readme,千万不要轻易出手。

这次尝试在自己的VirtualBox虚拟机OEL6中给之前安装的GI(Oracle Restart)+ ASM + Oracle Database安装最新的11.2.0.2.5 PSU,遇到各种问题。

1. Patch解压的目录必须是grid用户和oracle用户拥有写权限的,如果没有写权限,会报错:

Opatch version check failed for oracle home  /u01/app/oracle/product/11.2.0/dbhome_1
Opatch version  check failed
update the opatch version for the failed homes and retry

安装需求是使用root用户来安装(这是我第一次看到在安装PSU的时候要求使用root用户),而我的虚拟机中由于没有足够的磁盘空间,所以将Mac中的下载目录作为Shared Folder映射到虚拟机中,因此改目录的属主是root,用户组是vboxsf,而且并不允许使用chmod直接修改。因此出现了权限问题。我的解决方法是将grid用户和oracle用户都加入vboxsf组中。

建议:在真实环境中,Patch解压目录应该属于dba用户组。

2. 我的Patch是解压在/media/sf_PSU目录下,解压以后生成了p13343447_112020_Linux-x86-64目录,其下有两个目录分别是13343424(这是DB PSU)和13343447(这是GI PSU),整个目录结构如下所示:

 |-media
 |--sf_PSU
 |---p13343447_112020_Linux-x86-64
 |-----13343424
 |-----13343447

按照Readme文档中描述的,opatch的命令应该写为:

opatch auto 

此处的UNZIPPED_PATCH_LOCATION按照文档描述应该就是/media/sf_PSU目录,因为这是解压目录,但是实际上这份文档是有问题的(注:这是我个人造成的问题,我在操作系统中双击解压zip包,自动生成了p13343447_112020_Linux-x86-64目录,而如果命令行下用unzip解压,则不会出现此目录,因此Oracle文档中的描述并没有问题,但是这里主要吐槽下面的报错信息),如果opatch命令写为:

opatch auto /media/sf_PSU -ocmrf /home/grid/ocm.rsp

其中的-ocmrf是另外一个问题,这个OCM的配置文件,根据Readme文档中描述的方法创建即可。

运行以上命令会报错:

Opatch version check failed for oracle home  /u01/app/oracle/product/11.2.0/dbhome_1
Opatch version  check failed
update the opatch version for the failed homes and retry

是的,你没有看错,我也没有贴错,确实报了一模一样的错误(虽然这两个错误都完全不是opatch版本的问题),所以,opatch的报错信息是不可信的,我们必须要去提示的log文件中仔细查看最后的错误信息。

 ZOP-49: Not able to execute the prereq. OPatch cannot inform if the patch satisfies minimum version requirement.
 PatchObject constructor: Input file "/media/sf_PSU/p13343447_112020_Linux-x86-64/etc/config/actions" or "/media/sf_PSU/p13343447_112020_Linux-x86-64/etc/config/inventory" does not exist.

因此,正确的opatch命令应该是:

opatch auto /media/sf_PSU/p13343447_112020_Linux-x86-64 -ocmrf /home/grid/ocm.rsp

3. Oracle软件所在的文件系统剩余空间必须要大于3G,如果不足,会报错:

patch /media/sf_PSU/p13343447_112020_Linux-x86-64/13343447  apply  failed  for home  /u01/app/grid/product/11.2.0/grid
ACFS-9459: ADVM/ACFS is not supported on this OS version: 'error: file /etc/SuSE-release: No such file or directory

可以看到,又是一次很无稽的报错信息,/etc/SuSE-release?拜托,这里只有/etc/redhat-release。

那么,仔细检查log文件,会发现如下的报错:

 Prerequisite check "CheckSystemSpace" failed.
 The details are:
 Required amount of space(3154696080) is not available.
 UtilSession failed: Prerequisite check "CheckSystemSpace" failed.
 Log file location: /u01/app/grid/product/11.2.0/grid/cfgtoollogs/opatch/opatch2012-01-27_18-23-48PM.log

 OPatch failed with error code 73

到此为止,我放弃了在虚拟机中安装PSU 11.2.0.2.5(如果要增加虚拟机中的文件系统剩余空间是非常麻烦的事情),但是我认为解决了磁盘空间问题之后,后面应该不会再有太多问题了。另外,如果在真实环境中这些问题可能都不存在,因为真实环境中文件系统的剩余空间应该远远不止3G,也应该不会有Shared Folder权限的问题,不过目录位置的问题应该还是会遇到,希望这里遇到的问题对将要在产品环境中Apply 11.2.0.2.5 PSU的朋友有帮助。

如果你成功Apply了该版本的Patch,那么也可以留言告诉我你遇到了什么障碍。

Update@2012-02-09
在另外一台测试的Solaris机器中成功apply了最新的11.2.0.3.1 PSU,包括GI和DB的,由于命令跟本文描述的11.2.0.2.5 PSU的更新方法一样,所以记录在此。如果没有本文描述的上述错误,opatch auto还是很简便的。

# export PATH=$PATH:/u02/app/oracle/product/11.2.0/grid/OPatch
# opatch auto /home/oracle/gi_psu_11.2.0.3.1 -ocmrf /home/grid/ocm.rsp
Executing /usr/bin/perl /u02/app/oracle/product/11.2.0/grid/OPatch/crs/patch112.pl -patchdir /home/oracle -patchn gi_psu_11.2.0.3.1 -ocmrf /home/grid/ocm.rsp -paramfile /u02/app/oracle/product/11.2.0/grid/crs/install/crsconfig_params
defined(@array) is deprecated at /u02/app/oracle/product/11.2.0/grid/OPatch/crs/crsconfig_lib.pm line 2149.
        (Maybe you should just omit the defined()?)
defined(@array) is deprecated at /u02/app/oracle/product/11.2.0/grid/OPatch/crs/crsconfig_lib.pm line 2149.
        (Maybe you should just omit the defined()?)
defined(@array) is deprecated at /u02/app/oracle/product/11.2.0/grid/OPatch/crs/crsconfig_lib.pm line 2227.
        (Maybe you should just omit the defined()?)
opatch auto log file location is /u02/app/oracle/product/11.2.0/grid/OPatch/crs/../../cfgtoollogs/opatchauto2012-02-09_01-37-59.log
Detected Oracle Restart install
Using configuration parameter file: /u02/app/oracle/product/11.2.0/grid/crs/install/crsconfig_params
patch /home/oracle/gi_psu_11.2.0.3.1/13348650/custom/server/13348650  apply successful for home  /u01/app/oracle/product/11.2.0/db_1
patch /home/oracle/gi_psu_11.2.0.3.1/13343438  apply successful for home  /u01/app/oracle/product/11.2.0/db_1
Successfully unlock /u02/app/oracle/product/11.2.0/grid
patch /home/oracle/gi_psu_11.2.0.3.1/13348650  apply successful for home  /u02/app/oracle/product/11.2.0/grid
patch /home/oracle/gi_psu_11.2.0.3.1/13343438  apply successful for home  /u02/app/oracle/product/11.2.0/grid
ACFS-9459: ADVM/ACFS is not supported on this OS version: 'Solaris 11 11/11 X86'
CRS-4123: Oracle High Availability Services has been started.

PSU补丁应用完毕以后,数据库会自动启动,接下来需要继续为数据库运行catbundle.sql。

cd $ORACLE_HOME/rdbms/admin
sqlplus / as sysdba
SQL> @catbundle.sql psu apply

检查PSU补丁情况。

$ opatch lsinventory | grep "Patch Set Update"
Patch Description:  "Database Patch Set Update : 11.2.0.3.1 (13343438)"
Patch Description:  "Grid Infrastructure Patch Set Update : 11.2.0.3.1 (13348650)"

$ sqlplus / as sysdba
SQL> select action,comments from registry$history;

ACTION                         COMMENTS
------------------------------ ------------------------------
APPLY                          PSU 11.2.0.3.1

Leave a Reply

Your email address will not be published. Required fields are marked *