以下内容根据今天下午给GI standalone打补丁记录整理而成,参考对应的 readme 文件
##
## latest patch p18706472_112040_Linux-x86-64.zip
## OS RedHat 6.4 64
## DB 11.2.0.4.0 Single instance owner user oracle
## ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_home
## GI 11.2.0.4.0 GI for standalone owner user grid
## ORACLE_HOME:/u01/app/grid/product/11.2.0/grid/
##
## target:
## install the latest patch p18706472_112040_Linux-x86-64 to the db and GI
## as detailed in readme, this file p18706472_112040_Linux-x86-64 include both patch for GI and DB
##
##
2.1.1 opatch tool
要 安装补丁p18706472_112040_Linux-x86-64.zip 的话,需要先给opatch这个工具升级,或者是给它打补丁
在oracle和grid用户下 重复执行 2.1.1.a and 2.1.1.b 的命令
2.1.1.a 确认opatch 的版本:
cd $ORACLE_HOME/OPatch
$[oracle@rhel ~]$./opatch version
or
[oracle@rhel ~]$ export PATH=$ORACLE_HOME/OPatch:$PATH
[oracle@rhel ~]$ opatch version
OPatch Version: 11.2.0.3.6
OPatch succeeded.
You must use the OPatch utility version 11.2.0.3.6 or later to apply this patch.
保证opatch的版本高于readme中要求的版本,GI PSU 11.2.0.4.3 的readme.txt中要求的opatch版本为最低11.2.0.6.0,否则的话,
请下载最新的opatch:https://updates.oracle.com/download/6880880.html
2.1.1.b 更新opatch tool
先备份原有的opatch
tar -cvf opatchbackup.tar ./OPatch
更新 opatch tool
unzip p6880880_112000_linux.zip -d $ORACLE_HOME
2.1.2 配置OCM
切换到 grid user
cd $ORACLE_HOME/OPatch/ocm/bin/
[grid@rhel bin]$ ./emocmrsp
emocmrsp
OCM Installation Response Generator 10.3.4.0.0 - Production
Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
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
The OCM configuration response file (ocm.rsp) was successfully created.
It will be created in $ORACLE_HOME/OPatch/ocm/bin/ocm.rsp
2.1.3 下载并解压GI PSU 11.2.0.4.3:
http://support.us.oracle.com
用grid 用户将文件上传到服务器并且解压, 必须用grid用户解压。
$ cd /home/grid/
$ unzip p18706472_112040_Linux-x86-64.zip
######## 注意:开始在操作的时候解压到grid用户的home目录,在执行补丁安装的时候出错了,
##补丁包含了DB和GI的补丁,root执行patch auto后 会切换到 oracle 和 grid用户下分别执行一些任务,因此补丁解压后的目录
##用户 oracle & grid 应该都有wrx权限. 在第二次操作的时候将解压目录移动到 /tmp/下去了
##
## 第一次执行 失败
root@rhel:patch auto /home/grid/18706472 -ocmrf /u01/app/grid/product/11.2.0/grid/OPatch/ocm/bin/ocm.rsp
在执行日志中发现了以下内容
2014-07-16 02:18:31: s_run_as_user2: Running /bin/su oracle -c ' /u01/app/oracle/product/11.2.0/db_home/OPatch/opatch util checkMinimumOPatchV
ersion -ph /home/grid/18706472/18522509 -version 11.2.0.3.6 -oh /u01/app/oracle/product/11.2.0/db_home '
2014-07-16 02:18:32: Removing file /tmp/filepe8Glm
2014-07-16 02:18:32: Successfully removed file: /tmp/filepe8Glm
2014-07-16 02:18:32: /bin/su exited with rc=135
2014-07-16 02:18:32: The opatch minimum version check for patch /home/grid/18706472/18522509 failed for /u01/app/oracle/product/11.2.0/db_ho
me
2014-07-16 02:18:32: The opatch version check failed with following error
2014-07-16 02:18:32: Oracle Interim Patch Installer version 11.2.0.3.6
Copyright (c) 2013, Oracle Corporation. All rights reserved.
ZOP-50: The patch location is not valid because it may be not exist or current user has no permission to access it.
Argument(s) Error... Patch Location not valid
Please check the arguments and try again.
## 将解压文件转移到grid oracle都有 wrx 权限的目录下
[root@rhel grid]# mv /home/grid/18706472/ /tmp/
2.1.4 停止em agent
在oracle用户下执行
命令 emctl status dbconsole 查看是否在运行
执行命令 停止em:emctl stop dbconsole
2.2 检查补丁冲突
grid用户:
$ cd /tmp/18706472
$ ./$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir ./
Oracle Interim Patch Installer version 11.2.0.3.6
Copyright (c) 2013, Oracle Corporation. All rights reserved.
PREREQ session
Oracle Home : /u01/app/grid/product/11.2.0/grid
Central Inventory : /u01/app/oraInventory
from : /u01/app/grid/product/11.2.0/grid/oraInst.loc
OPatch version : 11.2.0.3.6
OUI version : 11.2.0.4.0
Log file location : /u01/app/grid/product/11.2.0/grid/cfgtoollogs/opatch/opatch2014-07-16_02-04-49AM_1.log
Invoking prereq "checkconflictagainstohwithdetail"
Prereq "checkConflictAgainstOHWithDetail" passed.
OPatch succeeded.
2.3 补丁安装
实际环境:oracle single instance database and GI for standalone
根据readme中的信息, 用root身份执行相关命令安装补丁(无需停止GI) ,执行了命令后,会自动停止GI和所有资源;
然后在GI和DB的ORACLE_HOME下都安装GI 和DB的PSU;
最后会GI和资源都启动。
# opatch auto -ocmrf
opatch auto /home/grid/18706472 -ocmrf /u01/app/grid/product/11.2.0/grid/OPatch/ocm/bin/ocm.rsp ##出错
Executing /u01/app/grid/product/11.2.0/grid/perl/bin/perl /u01/app/grid/product/11.2.0/grid/OPatch/crs/patch11203.pl -patchdir /home/grid -patchn 18706472 -ocmrf /u01/app/grid/product/11.2.0/grid/OPatch/ocm/bin/ocm.rsp -paramfile /u01/app/grid/product/11.2.0/grid/crs/install/crsconfig_params
This is the main log file: /u01/app/grid/product/11.2.0/grid/cfgtoollogs/opatchauto2014-07-16_02-18-19.log
This file will show your detected configuration and all the steps that opatchauto attempted to do on your system:
/u01/app/grid/product/11.2.0/grid/cfgtoollogs/opatchauto2014-07-16_02-18-19.report.log
2014-07-16 02:18:19: Starting Oracle Restart Patch Setup
Using configuration parameter file: /u01/app/grid/product/11.2.0/grid/crs/install/crsconfig_params
The opatch minimum version check for patch /home/grid/18706472/18522509 failed for /u01/app/oracle/product/11.2.0/db_home
The opatch minimum version check for patch /home/grid/18706472/18522515/custom/server/18522515 failed for /u01/app/oracle/product/11.2.0/db_home
Opatch version check failed for oracle home /u01/app/oracle/product/11.2.0/db_home
Opatch version check failed
ERROR: update the opatch version for the failed homes and retry
opatch auto failed.
#第二次执行 执行成功
opatch auto /tmp/18706472 -ocmrf /u01/app/grid/product/11.2.0/grid/OPatch/ocm/bin/ocm.rsp
Executing /u01/app/grid/product/11.2.0/grid/perl/bin/perl /u01/app/grid/product/11.2.0/grid/OPatch/crs/patch11203.pl -patchdir /tmp -patchn 18706472 -ocmrf /u01/app/grid/product/11.2.0/grid/OPatch/ocm/bin/ocm.rsp -paramfile /u01/app/grid/product/11.2.0/grid/crs/install/crsconfig_params
This is the main log file: /u01/app/grid/product/11.2.0/grid/cfgtoollogs/opatchauto2014-07-16_02-39-59.log
This file will show your detected configuration and all the steps that opatchauto attempted to do on your system:
/u01/app/grid/product/11.2.0/grid/cfgtoollogs/opatchauto2014-07-16_02-39-59.report.log
2014-07-16 02:39:59: Starting Oracle Restart Patch Setup
Using configuration parameter file: /u01/app/grid/product/11.2.0/grid/crs/install/crsconfig_params
Stopping RAC /u01/app/oracle/product/11.2.0/db_home ...
Stopped RAC /u01/app/oracle/product/11.2.0/db_home successfully
patch /tmp/18706472/18522509 apply successful for home /u01/app/oracle/product/11.2.0/db_home
patch /tmp/18706472/18522515/custom/server/18522515 apply successful for home /u01/app/oracle/product/11.2.0/db_home
Stopping CRS...
Stopped CRS successfully
patch /tmp/18706472/18522509 apply successful for home /u01/app/grid/product/11.2.0/grid
patch /tmp/18706472/18522515 apply successful for home /u01/app/grid/product/11.2.0/grid
patch /tmp/18706472/18522514 apply successful for home /u01/app/grid/product/11.2.0/grid
Starting CRS...
CRS-4123: Oracle High Availability Services has been started.
Starting RAC /u01/app/oracle/product/11.2.0/db_home ...
Started RAC /u01/app/oracle/product/11.2.0/db_home successfully
opatch auto succeeded.
2.4 Patch Post-InstallationInstructions
2.4.1 用oracle用户连接到数据库上:
cd $ORACLE_HOME/rdbms/admin
sqlplus /nolog
SQL> CONNECT / AS SYSDBA
SQL> STARTUP
SQL> @catbundle.sql psu apply
sys@ANDREW> select version, id, bundle_series, comments from dba_registry_history;
VERSION ID BUNDLE_SERIES COMMENTS
------------------------------ ---------- ------------------------------ ----------------------------------------
11.2.0.4 0 PSU Patchset 11.2.0.2.0
11.2.0.4 3 PSU PSU 11.2.0.4.3
2.4.3 如果您使用了RMAN,需要将RMAN catalog库升级一下,执行:
$ rman catalog andrew/password@ANDREWDB
RMAN> UPGRADE CATALOG;
Recovery Manager: Release 11.2.0.4.0 - Production on Wed Jul 16 03:12:31 2014
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to recovery catalog database
RMAN> upgrade catalog;
recovery catalog owner is RMAN
enter UPGRADE CATALOG command again to confirm catalog upgrade
RMAN> upgrade catalog;
recovery catalog upgraded to version 11.02.00.04
DBMS_RCVMAN package upgraded to version 11.02.00.04
DBMS_RCVCAT package upgraded to version 11.02.00.04
RMAN> exit
##
## latest patch p18706472_112040_Linux-x86-64.zip
## OS RedHat 6.4 64
## DB 11.2.0.4.0 Single instance owner user oracle
## ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_home
## GI 11.2.0.4.0 GI for standalone owner user grid
## ORACLE_HOME:/u01/app/grid/product/11.2.0/grid/
##
## target:
## install the latest patch p18706472_112040_Linux-x86-64 to the db and GI
## as detailed in readme, this file p18706472_112040_Linux-x86-64 include both patch for GI and DB
##
##
2.1.1 opatch tool
要 安装补丁p18706472_112040_Linux-x86-64.zip 的话,需要先给opatch这个工具升级,或者是给它打补丁
在oracle和grid用户下 重复执行 2.1.1.a and 2.1.1.b 的命令
2.1.1.a 确认opatch 的版本:
cd $ORACLE_HOME/OPatch
$[oracle@rhel ~]$./opatch version
or
[oracle@rhel ~]$ export PATH=$ORACLE_HOME/OPatch:$PATH
[oracle@rhel ~]$ opatch version
OPatch Version: 11.2.0.3.6
OPatch succeeded.
You must use the OPatch utility version 11.2.0.3.6 or later to apply this patch.
保证opatch的版本高于readme中要求的版本,GI PSU 11.2.0.4.3 的readme.txt中要求的opatch版本为最低11.2.0.6.0,否则的话,
请下载最新的opatch:https://updates.oracle.com/download/6880880.html
2.1.1.b 更新opatch tool
先备份原有的opatch
tar -cvf opatchbackup.tar ./OPatch
更新 opatch tool
unzip p6880880_112000_linux.zip -d $ORACLE_HOME
2.1.2 配置OCM
切换到 grid user
cd $ORACLE_HOME/OPatch/ocm/bin/
[grid@rhel bin]$ ./emocmrsp
emocmrsp
OCM Installation Response Generator 10.3.4.0.0 - Production
Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
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
The OCM configuration response file (ocm.rsp) was successfully created.
It will be created in $ORACLE_HOME/OPatch/ocm/bin/ocm.rsp
2.1.3 下载并解压GI PSU 11.2.0.4.3:
http://support.us.oracle.com
用grid 用户将文件上传到服务器并且解压, 必须用grid用户解压。
$ cd /home/grid/
$ unzip p18706472_112040_Linux-x86-64.zip
######## 注意:开始在操作的时候解压到grid用户的home目录,在执行补丁安装的时候出错了,
##补丁包含了DB和GI的补丁,root执行patch auto后 会切换到 oracle 和 grid用户下分别执行一些任务,因此补丁解压后的目录
##用户 oracle & grid 应该都有wrx权限. 在第二次操作的时候将解压目录移动到 /tmp/下去了
##
## 第一次执行 失败
root@rhel:patch auto /home/grid/18706472 -ocmrf /u01/app/grid/product/11.2.0/grid/OPatch/ocm/bin/ocm.rsp
在执行日志中发现了以下内容
2014-07-16 02:18:31: s_run_as_user2: Running /bin/su oracle -c ' /u01/app/oracle/product/11.2.0/db_home/OPatch/opatch util checkMinimumOPatchV
ersion -ph /home/grid/18706472/18522509 -version 11.2.0.3.6 -oh /u01/app/oracle/product/11.2.0/db_home '
2014-07-16 02:18:32: Removing file /tmp/filepe8Glm
2014-07-16 02:18:32: Successfully removed file: /tmp/filepe8Glm
2014-07-16 02:18:32: /bin/su exited with rc=135
2014-07-16 02:18:32: The opatch minimum version check for patch /home/grid/18706472/18522509 failed for /u01/app/oracle/product/11.2.0/db_ho
me
2014-07-16 02:18:32: The opatch version check failed with following error
2014-07-16 02:18:32: Oracle Interim Patch Installer version 11.2.0.3.6
Copyright (c) 2013, Oracle Corporation. All rights reserved.
ZOP-50: The patch location is not valid because it may be not exist or current user has no permission to access it.
Argument(s) Error... Patch Location not valid
Please check the arguments and try again.
## 将解压文件转移到grid oracle都有 wrx 权限的目录下
[root@rhel grid]# mv /home/grid/18706472/ /tmp/
2.1.4 停止em agent
在oracle用户下执行
命令 emctl status dbconsole 查看是否在运行
执行命令 停止em:emctl stop dbconsole
2.2 检查补丁冲突
grid用户:
$ cd /tmp/18706472
$ ./$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir ./
Oracle Interim Patch Installer version 11.2.0.3.6
Copyright (c) 2013, Oracle Corporation. All rights reserved.
PREREQ session
Oracle Home : /u01/app/grid/product/11.2.0/grid
Central Inventory : /u01/app/oraInventory
from : /u01/app/grid/product/11.2.0/grid/oraInst.loc
OPatch version : 11.2.0.3.6
OUI version : 11.2.0.4.0
Log file location : /u01/app/grid/product/11.2.0/grid/cfgtoollogs/opatch/opatch2014-07-16_02-04-49AM_1.log
Invoking prereq "checkconflictagainstohwithdetail"
Prereq "checkConflictAgainstOHWithDetail" passed.
OPatch succeeded.
2.3 补丁安装
实际环境:oracle single instance database and GI for standalone
根据readme中的信息, 用root身份执行相关命令安装补丁(无需停止GI) ,执行了命令后,会自动停止GI和所有资源;
然后在GI和DB的ORACLE_HOME下都安装GI 和DB的PSU;
最后会GI和资源都启动。
# opatch auto -ocmrf
opatch auto /home/grid/18706472 -ocmrf /u01/app/grid/product/11.2.0/grid/OPatch/ocm/bin/ocm.rsp ##出错
Executing /u01/app/grid/product/11.2.0/grid/perl/bin/perl /u01/app/grid/product/11.2.0/grid/OPatch/crs/patch11203.pl -patchdir /home/grid -patchn 18706472 -ocmrf /u01/app/grid/product/11.2.0/grid/OPatch/ocm/bin/ocm.rsp -paramfile /u01/app/grid/product/11.2.0/grid/crs/install/crsconfig_params
This is the main log file: /u01/app/grid/product/11.2.0/grid/cfgtoollogs/opatchauto2014-07-16_02-18-19.log
This file will show your detected configuration and all the steps that opatchauto attempted to do on your system:
/u01/app/grid/product/11.2.0/grid/cfgtoollogs/opatchauto2014-07-16_02-18-19.report.log
2014-07-16 02:18:19: Starting Oracle Restart Patch Setup
Using configuration parameter file: /u01/app/grid/product/11.2.0/grid/crs/install/crsconfig_params
The opatch minimum version check for patch /home/grid/18706472/18522509 failed for /u01/app/oracle/product/11.2.0/db_home
The opatch minimum version check for patch /home/grid/18706472/18522515/custom/server/18522515 failed for /u01/app/oracle/product/11.2.0/db_home
Opatch version check failed for oracle home /u01/app/oracle/product/11.2.0/db_home
Opatch version check failed
ERROR: update the opatch version for the failed homes and retry
opatch auto failed.
#第二次执行 执行成功
opatch auto /tmp/18706472 -ocmrf /u01/app/grid/product/11.2.0/grid/OPatch/ocm/bin/ocm.rsp
Executing /u01/app/grid/product/11.2.0/grid/perl/bin/perl /u01/app/grid/product/11.2.0/grid/OPatch/crs/patch11203.pl -patchdir /tmp -patchn 18706472 -ocmrf /u01/app/grid/product/11.2.0/grid/OPatch/ocm/bin/ocm.rsp -paramfile /u01/app/grid/product/11.2.0/grid/crs/install/crsconfig_params
This is the main log file: /u01/app/grid/product/11.2.0/grid/cfgtoollogs/opatchauto2014-07-16_02-39-59.log
This file will show your detected configuration and all the steps that opatchauto attempted to do on your system:
/u01/app/grid/product/11.2.0/grid/cfgtoollogs/opatchauto2014-07-16_02-39-59.report.log
2014-07-16 02:39:59: Starting Oracle Restart Patch Setup
Using configuration parameter file: /u01/app/grid/product/11.2.0/grid/crs/install/crsconfig_params
Stopping RAC /u01/app/oracle/product/11.2.0/db_home ...
Stopped RAC /u01/app/oracle/product/11.2.0/db_home successfully
patch /tmp/18706472/18522509 apply successful for home /u01/app/oracle/product/11.2.0/db_home
patch /tmp/18706472/18522515/custom/server/18522515 apply successful for home /u01/app/oracle/product/11.2.0/db_home
Stopping CRS...
Stopped CRS successfully
patch /tmp/18706472/18522509 apply successful for home /u01/app/grid/product/11.2.0/grid
patch /tmp/18706472/18522515 apply successful for home /u01/app/grid/product/11.2.0/grid
patch /tmp/18706472/18522514 apply successful for home /u01/app/grid/product/11.2.0/grid
Starting CRS...
CRS-4123: Oracle High Availability Services has been started.
Starting RAC /u01/app/oracle/product/11.2.0/db_home ...
Started RAC /u01/app/oracle/product/11.2.0/db_home successfully
opatch auto succeeded.
2.4 Patch Post-InstallationInstructions
2.4.1 用oracle用户连接到数据库上:
cd $ORACLE_HOME/rdbms/admin
sqlplus /nolog
SQL> CONNECT / AS SYSDBA
SQL> STARTUP
SQL> @catbundle.sql psu apply
sys@ANDREW> select version, id, bundle_series, comments from dba_registry_history;
VERSION ID BUNDLE_SERIES COMMENTS
------------------------------ ---------- ------------------------------ ----------------------------------------
11.2.0.4 0 PSU Patchset 11.2.0.2.0
11.2.0.4 3 PSU PSU 11.2.0.4.3
2.4.3 如果您使用了RMAN,需要将RMAN catalog库升级一下,执行:
$ rman catalog andrew/password@ANDREWDB
RMAN> UPGRADE CATALOG;
Recovery Manager: Release 11.2.0.4.0 - Production on Wed Jul 16 03:12:31 2014
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to recovery catalog database
RMAN> upgrade catalog;
recovery catalog owner is RMAN
enter UPGRADE CATALOG command again to confirm catalog upgrade
RMAN> upgrade catalog;
recovery catalog upgraded to version 11.02.00.04
DBMS_RCVMAN package upgraded to version 11.02.00.04
DBMS_RCVCAT package upgraded to version 11.02.00.04
RMAN> exit
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/21754115/viewspace-1220674/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/21754115/viewspace-1220674/