一、准备工作
操作系统版本 : OracleLinux6.6 x64
数据库版本 : Oracle 11.2.0.4 x64 RAC
Grid : 11.2.0.4
Oracle database: 11.2.0.4
GI PSU : p20760892_112040_Linux-x86-64.zip
OPatch : p6880880_112000_Linux-x86-64.zip
DB PSU : p20760892_112040_Linux-x86-64.zip 仅单实例使用。
OPatch下载地址:
http://dl.download.csdn.net/down11/20160704/4d3c9d0a9bf07741d5192ff8537d242e.zip?response-content-disposition=attachment%3Bfilename%3D%22p6880880_112000_Linux-x86-64.zip%22&OSSAccessKeyId=9q6nvzoJGowBj4q1&Expires=1477572643&Signature=lIc7pl74crmn43wHNxssOu8LTGs%3D
注意:GI PSU包括DB PSU,CPU。
二、更新OPatch版本,必须要更新
说明:分别在两个节点更新OPatch版本。
(1) 上传p6880880_112000_Linux-x86-64.zip到/u01/software目录下, /u01/software给777权限,也可以采用/tmp目录。
(2) root用户下将原OPatch目录改名。
mv /u01/app/11.2.0/grid/OPatch /u01/app/11.2.0/grid/OPatchbk
mv /u01/app/oracle/product/11.2.0/db_1/OPatch /u01/app/oracle/product/11.2.0/db_1/OPatchBK
(1) root用户
cd /u01/software/;chown grid:oinstall p6880880_112000_Linux-x86-64.zip
(2) grid用户
su - grid
cd /u01/software/
unzip p6880880_112000_Linux-x86-64.zip
(3) root用户
cd /u01/software/
mv OPatch /u01/app/11.2.0/grid/
(4) grid用户测试
su - grid
/u01/app/11.2.0/grid/OPatch/opatch version
OPatch Version: 11.2.0.3.4
OPatch succeeded.
(1) root用户
cd /u01/software/;chown oracle:oinstall p6880880_112000_Linux-x86-64.zip
(2) oracle用户
su - oracle
cd /u01/software/
unzip p6880880_112000_Linux-x86-64.zip
(3) root用户
cd /u01/software/
mv OPatch /u01/app/oracle/product/11.2.0/db_1/
(4) oracle用户测试
su - oracle
/u01/app/oracle/product/11.2.0/db_1/OPatch/opatch version
OPatch Version: 11.2.0.3.4
OPatch succeeded.
三、开始升级GI PSU软件包
(1) root用户下打grid需要关闭grid(两节点都执行)
cd /u01/app/11.2.0/grid/bin
./crsctl stop has
(1) root用户操作
cd /u01/software/;chown grid:oinstall p21523375_112040_Linux-x86-64.zip
(2) grid用户操作
su - grid
cd /u01/software/;unzip p21523375_112040_Linux-x86-64.zip
$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /u01/software/21523375/21352649 -oh $ORACLE_HOME
$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /u01/software/21523375/21352642 -oh $ORACLE_HOME
$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /u01/software/21523375/21352635 -oh $ORACLE_HOME
----------------------------------------------------
执行示例如下:
Oracle Interim Patch Installer version 11.2.0.3.11
Copyright (c) 2015, Oracle Corporation. All rights reserved.
PREREQ session
Oracle Home : /u01/app/11.2.0/grid
Central Inventory : /u01/app/oraInventory
from : /u01/app/11.2.0/grid/oraInst.loc
OPatch version : 11.2.0.3.11
OUI version : 11.2.0.4.0
Log file location : /u01/app/11.2.0/grid/cfgtoollogs/opatch/opatch2015-12-18_16-21-46PM_1.log
Invoking prereq "checkconflictagainstohwithdetail"
Prereq "checkConflictAgainstOHWithDetail" passed.
OPatch succeeded.
四、开始升级GRID
第1步: 执行脚本, 一定要执行,否则无法成功,确保CRS是关闭状态。
也可以先查看补丁包中的README文件。
[root@db1 bin]# /u01/app/11.2.0/grid/crs/install/rootcrs.pl -unlock
Using configuration parameter file: /grid/grid_home/crs/install/crsconfig_params
CRS-4544: Unable to connect to OHAS
CRS-4000: Command Stop failed, or completed with errors.
Successfully unlock /grid/grid_home
[root@db1 bin]#
第2步:下载补丁包(目前11.2.0.4.8 PSU),准备升级
su - grid
/u01/app/11.2.0/grid/OPatch/opatch napply -oh $ORACLE_HOME -local /u01/software/21523375/21352649
/u01/app/11.2.0/grid/OPatch/opatch napply -oh $ORACLE_HOME -local /u01/software/21523375/21352642
/u01/app/11.2.0/grid/OPatch/opatch napply -oh $ORACLE_HOME -local /u01/software/21523375/21352635
过程中按三个Y
$ /u01/app/11.2.0/grid/OPatch/opatch lsinv
Patch 21352635 : applied on Fri Dec 18 17:38:24 CST 2015
Unique Patch ID: 19227862
Patch description: "Database Patch Set Update : 11.2.0.4.8 (21352635)"
Created on 1 Sep 2015, 07:49:44 hrs
Sub-patch 20760982; "Database Patch Set Update : 11.2.0.4.7 (20760982)"
Sub-patch 20299013; "Database Patch Set Update : 11.2.0.4.6 (20299013)"
Sub-patch 19769489; "Database Patch Set Update : 11.2.0.4.5 (19769489)"
Sub-patch 19121551; "Database Patch Set Update : 11.2.0.4.4 (19121551)"
Sub-patch 18522509; "Database Patch Set Update : 11.2.0.4.3 (18522509)"
Sub-patch 18031668; "Database Patch Set Update : 11.2.0.4.2 (18031668)"
Sub-patch 17478514; "Database Patch Set Update : 11.2.0.4.1 (17478514)"
Bugs fixed:
...
$ /u01/app/11.2.0/grid/OPatch/opatch lspatches
21352635;Database Patch Set Update : 11.2.0.4.8 (21352635)
21352642;ACFS Patch Set Update : 11.2.0.4.8 (21352642)
21352649;OCW Patch Set Update : 11.2.0.4.8 (21352649)
OPatch succeeded.
说明:因为是手动打PSU,需要手动进行关闭与启动操作。
# cd /u01/app/11.2.0/grid/bin
# ./crsctl start has
CRS-4123: Oracle High Availability Services has been started.
五、打database PSU补丁
(1) Root用户下,重新给PSU补丁包赋予权限
cd /u01/software/
rm -rf 21523375
chown oracle:oinstall p21523375_112040_Linux-x86-64.zip
(2) oracle用户
su - oracle
cd /u01/software/;unzip p21523375_112040_Linux-x86-64.zip
(3) Oracle用户下检查兼容性,针对多次打CPU的环境中。
$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /u01/software/21523375/21352635 -oh $ORACLE_HOME
----------------------------------------------------
Oracle Interim Patch Installer version 11.2.0.3.11
Copyright (c) 2015, Oracle Corporation. All rights reserved.
PREREQ session
Oracle Home : /u01/app/oracle/product/11.2.0/db_1
Central Inventory : /u01/app/oraInventory
from : /u01/app/oracle/product/11.2.0/db_1/oraInst.loc
OPatch version : 11.2.0.3.11
OUI version : 11.2.0.4.0
Log file location : /u01/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/opatch2015-12-21_09-25-57AM_1.log
Invoking prereq "checkconflictagainstohwithdetail"
Prereq "checkConflictAgainstOHWithDetail" passed.
OPatch succeeded.
----------------------------------------------------
su - oracle
/u01/app/oracle/product/11.2.0/db_1/OPatch/opatch napply -oh $ORACLE_HOME -local /u01/software/21523375/21352635
查看打补丁情况:
/u01/app/oracle/product/11.2.0/db_1/OPatch/opatch lsinv
/u01/app/oracle/product/11.2.0/db_1/OPatch/opatch lspatches
六、升级数据库数据字典(此步骤可选,如果还未创建数据库可以不用做此步骤)
(1) root用户下打grid需要关闭grid(两节点都执行)
cd /u01/app/11.2.0/grid/bin
./crsctl start has
或直接执行如下命令,同时关闭两个节点。
./crs_start -all
$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Fri Mar 15 13:40:39 2013
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup
ORA-01565: error in identifying file '+DATA/orcl/spfileorcl.ora'
ORA-17503: ksfdopn:2 Failed to open file +DATA/orcl/spfileorcl.ora
ORA-15001: diskgroup "DATA" does not exist or is not mounted
ORA-15040: diskgroup is incomplete
ORA-15040: diskgroup is incomplete
ORA-15040: diskgroup is incomplete
说明:无法启动数据库,经过查询是因为oracle权限被更改为oracle:oinstall。通过如下方式解决。
在集群的所有节点上执行如下命令修改:
# chown oracle:asmadmin /u01/app/oracle/product/11.2.0/db_1/bin/oracle
# chmod 6751 /u01/app/oracle/product/11.2.0/db_1/bin/oracle
SQL> startup
ORACLE instance started.
Total System Global Area 2505338880 bytes
Fixed Size 2255832 bytes
Variable Size 687866920 bytes
Database Buffers 1795162112 bytes
Redo Buffers 20054016 bytes
Database mounted.
Database opened.
SQL> @?/rdbms/admin/catbundle.sql psu apply
中间等待过程。
执行完后我们可以查到PSU更新信息:
SQL>
set line 150
col ACTION_TIME for a30
col ACTION for a8
col NAMESPACE for a8
col VERSION for a10
col BUNDLE_SERIES for a5
col COMMENTS for a20
select * from dba_registry_history;
ACTION_TIME ACTION NAMESPAC VERSION ID BUNDL COMMENTS
------------------------------ -------- -------- ---------- ---------- ----- --------------------
24-AUG-13 12.03.45.119862 PM APPLY SERVER 11.2.0.4 0 PSU Patchset 11.2.0.2.0
22-DEC-15 03.53.27.330912 PM APPLY SERVER 11.2.0.4 0 PSU Patchset 11.2.0.2.0
24-DEC-15 04.58.29.381100 PM APPLY SERVER 11.2.0.4 8 PSU PSU 11.2.0.4.8
3 rows selected.