补丁包版本
OPatch: 11.2.0.3.27 PSU: p31718723_112040_Linux-x86-64_GI 使用oracle用户上传补丁包至/home/oracle目录并解压 使用grid用户上传补丁包至/home/grid目录并解压
注意事项
先打grid目录,再打oracle目录,用root用户执行,打补丁前关数据库,不停crs
文件权限确认:
#grid用户$ORACLE_HOME/bin目录下oracle文件权限
[root@his ~]# ll /u01/app/11.2.0.4/grid/bin/oracle
-rwsr-s--x 1 grid oinstall 209914513 4月 6 17:46 /u01/app/11.2.0.4/grid/bin/oracle
#oracle用户$ORACLE_HOME/bin目录下oracle文件权限
[root@his ~]# ll /u01/app/oracle/product/11.2.0.4/db_home/bin/oracle
#补丁升级前
-rwsr-s--x 1 oracle asmadmin 239626683 4月 6 17:53 /u01/app/oracle/product/11.2.0.4/db_home/bin/oracle
#补丁升级后
-rwsr-s--x 1 oracle oinstall 239987345 4月 8 14:33 /u01/app/oracle/product/11.2.0.4/db_home/bin/oracle
直接启动数据库会报如下错误
ORA-00205: error in identifying control file, check alert log for more info
这是由于补丁升级后用户组由asmadmin变成oinstall,可以通过手工修改文件属性或者重启操作系统解决
升级OPatch版本
用11.2.0.3.27版本OPatch分别替换grid用户和oracle用户$ORACLE_HOME目录下的OPatch
[grid@localhost ~]$ mv $ORACLE_HOME/OPatch $ORACLE_HOME/OPatchbak
[grid@localhost ~]$ mv ~/OPatch $ORACLE_HOME/OPatch
[grid@localhost ~]$ $ORACLE_HOME/OPatch/opatch version
OPatch Version: 11.2.0.3.27
[oracle@localhost ~]$ mv $ORACLE_HOME/OPatch $ORACLE_HOME/OPatchbak
[oracle@localhost ~]$ mv ~/OPatch $ORACLE_HOME/OPatch
[oracle@localhost ~]$ $ORACLE_HOME/OPatch/opatch version
OPatch Version: 11.2.0.3.27
停OEM管理器
su - root
[root@his ~]# /u01/app/11.2.0.4/grid/bin/emctl stop console
关闭数据库
su - oracle
[oracle@his:/home/oracle]$sqlplus "/as sysdba"
SQL*Plus: Release 11.2.0.4.0 Production on Thu Apr 8 14:13:11 2021
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> exit
检查有效性
[grid@his:/home/grid]$/u01/app/11.2.0.4/grid/OPatch/opatch lsinventory -detail -oh $ORACLE_HOME
Oracle Interim Patch Installer version 11.2.0.3.27
Copyright (c) 2021, Oracle Corporation. All rights reserved.
Oracle Home : /u01/app/11.2.0.4/grid
Central Inventory : /u01/app/oraInventory
from : /u01/app/11.2.0.4/grid/oraInst.loc
OPatch version : 11.2.0.3.27
OUI version : 11.2.0.4.0
Log file location : /u01/app/11.2.0.4/grid/cfgtoollogs/opatch/opatch2021-04-08_14-09-45PM_1.log
Lsinventory Output file location : /u01/app/11.2.0.4/grid/cfgtoollogs/opatch/lsinv/lsinventory2021-04-08_14-09-45PM.txt
--------------------------------------------------------------------------------
Local Machine Information::
Hostname: his
ARU platform id: 226
ARU platform description:: Linux x86-64
Installed Top-level Products (1):
Oracle Grid Infrastructure 11g 11.2.0.4.0
There are 1 products installed in this Oracle Home.
Installed Products (89):
Agent Required Support Files 10.2.0.4.5
...
There are 89 products installed in this Oracle Home.
There are no Interim patches installed in this Oracle Home.
--------------------------------------------------------------------------------
OPatch succeeded.
补丁安装(grid)
#先打grid目录
su - root
[root@his ~]# export LANG=C
[root@his ~]# /u01/app/11.2.0.4/grid/OPatch/opatch auto /home/grid/31718723 -oh /u01/app/11.2.0.4/grid
Executing /u01/app/11.2.0.4/grid/perl/bin/perl /u01/app/11.2.0.4/grid/OPatch/crs/patch11203.pl -patchdir /home/grid -patchn 31718723 -oh /u01/app/11.2.0.4/grid -paramfile /u01/app/11.2.0.4/grid/crs/install/crsconfig_params
This is the main log file: /u01/app/11.2.0.4/grid/cfgtoollogs/opatchauto2021-04-08_14-16-06.log
This file will show your detected configuration and all the steps that opatchauto attempted to do on your system:
/u01/app/11.2.0.4/grid/cfgtoollogs/opatchauto2021-04-08_14-16-06.report.log
2021-04-08 14:16:06: Starting Oracle Restart Patch Setup
Using configuration parameter file: /u01/app/11.2.0.4/grid/crs/install/crsconfig_params
Stopping CRS...
Stopped CRS successfully
patch /home/grid/31718723/29938455 apply successful for home /u01/app/11.2.0.4/grid
patch /home/grid/31718723/31537677 apply successful for home /u01/app/11.2.0.4/grid
patch /home/grid/31718723/29509309 apply successful for home /u01/app/11.2.0.4/grid
Starting CRS...
CRS-4123: Oracle High Availability Services has been started.
opatch auto succeeded.
验证
su - grid
[grid@his:/home/grid]$opatch lsinv
Oracle Interim Patch Installer version 11.2.0.3.27
Copyright (c) 2021, Oracle Corporation. All rights reserved.
Oracle Home : /u01/app/11.2.0.4/grid
Central Inventory : /u01/app/oraInventory
from : /u01/app/11.2.0.4/grid/oraInst.loc
OPatch version : 11.2.0.3.27
OUI version : 11.2.0.4.0
Log file location : /u01/app/11.2.0.4/grid/cfgtoollogs/opatch/opatch2021-04-08_14-26-47PM_1.log
Lsinventory Output file location : /u01/app/11.2.0.4/grid/cfgtoollogs/opatch/lsinv/lsinventory2021-04-08_14-26-47PM.txt
--------------------------------------------------------------------------------
Local Machine Information::
Hostname: his
ARU platform id: 226
ARU platform description:: Linux x86-64
Installed Top-level Products (1):
Oracle Grid Infrastructure 11g 11.2.0.4.0
There are 1 products installed in this Oracle Home.
Interim patches (3) :
Patch 29509309 : applied on Thu Apr 08 14:23:06 CST 2021
Unique Patch ID: 23206872
Patch description: "ACFS Patch Set Update : 11.2.0.4.190716 (29509309)"
Created on 26 Jun 2019, 01:24:42 hrs PST8PDT
Bugs fixed:
28069955, 26247490, 16318126, 21369858, 19690653, 17203009, 17503605
...
Patch 31537677 : applied on Thu Apr 08 14:22:07 CST 2021
Unique Patch ID: 23828543
Patch description: "Database Patch Set Update : 11.2.0.4.201020 (31537677)"
Created on 24 Sep 2020, 06:02:11 hrs PST8PDT
Sub-patch 31103343; "Database Patch Set Update : 11.2.0.4.200714 (31103343)"
...
Bugs fixed:
18619917, 19309466, 28876684, 28855981, 18189036, 19781326, 13609098
...
Patch 29938455 : applied on Thu Apr 08 14:20:30 CST 2021
Unique Patch ID: 23206871
Patch description: "OCW Patch Set Update : 11.2.0.4.191015 (29938455)"
Created on 23 Aug 2019, 01:51:32 hrs PST8PDT
Bugs fixed:
18328800, 19270660, 18691572, 18508710, 20038451, 21251192, 22162062
...
--------------------------------------------------------------------------------
OPatch succeeded.
[grid@his:/home/grid]$opatch lspatches
29509309;ACFS Patch Set Update : 11.2.0.4.190716 (29509309)
31537677;Database Patch Set Update : 11.2.0.4.201020 (31537677)
29938455;OCW Patch Set Update : 11.2.0.4.191015 (29938455)
OPatch succeeded.
补丁安装(oracle)
su - root
[root@his ~]# export LANG=C
[root@his ~]# /u01/app/oracle/product/11.2.0.4/db_home/OPatch/opatch auto /home/oracle/31718723 -oh /u01/app/oracle/product/11.2.0.4/db_home
Executing /u01/app/11.2.0.4/grid/perl/bin/perl /u01/app/oracle/product/11.2.0.4/db_home/OPatch/crs/patch11203.pl -patchdir /home/oracle -patchn 31718723 -oh /u01/app/oracle/product/11.2.0.4/db_home -paramfile /u01/app/11.2.0.4/grid/crs/install/crsconfig_params
This is the main log file: /u01/app/oracle/product/11.2.0.4/db_home/cfgtoollogs/opatchauto2021-04-08_14-29-45.log
This file will show your detected configuration and all the steps that opatchauto attempted to do on your system:
/u01/app/oracle/product/11.2.0.4/db_home/cfgtoollogs/opatchauto2021-04-08_14-29-45.report.log
2021-04-08 14:29:45: Starting Oracle Restart Patch Setup
Using configuration parameter file: /u01/app/11.2.0.4/grid/crs/install/crsconfig_params
Stopping RAC /u01/app/oracle/product/11.2.0.4/db_home ...
Stopped RAC /u01/app/oracle/product/11.2.0.4/db_home successfully
patch /home/oracle/31718723/29938455/custom/server/29938455 apply successful for home /u01/app/oracle/product/11.2.0.4/db_home
patch /home/oracle/31718723/31537677 apply successful for home /u01/app/oracle/product/11.2.0.4/db_home
Starting RAC /u01/app/oracle/product/11.2.0.4/db_home ...
Started RAC /u01/app/oracle/product/11.2.0.4/db_home successfully
opatch auto succeeded.
验证
su - oracle
[oracle@his:/home/oracle]$opatch lsinv
Oracle Interim Patch Installer version 11.2.0.3.27
Copyright (c) 2021, Oracle Corporation. All rights reserved.
Oracle Home : /u01/app/oracle/product/11.2.0.4/db_home
Central Inventory : /u01/app/oraInventory
from : /u01/app/oracle/product/11.2.0.4/db_home/oraInst.loc
OPatch version : 11.2.0.3.27
OUI version : 11.2.0.4.0
Log file location : /u01/app/oracle/product/11.2.0.4/db_home/cfgtoollogs/opatch/opatch2021-04-08_14-33-56PM_1.log
Lsinventory Output file location : /u01/app/oracle/product/11.2.0.4/db_home/cfgtoollogs/opatch/lsinv/lsinventory2021-04-08_14-33-56PM.txt
--------------------------------------------------------------------------------
Local Machine Information::
Hostname: his
ARU platform id: 226
ARU platform description:: Linux x86-64
Installed Top-level Products (1):
Oracle Database 11g 11.2.0.4.0
There are 1 products installed in this Oracle Home.
Interim patches (2) :
Patch 31537677 : applied on Thu Apr 08 14:32:42 CST 2021
Unique Patch ID: 23828543
Patch description: "Database Patch Set Update : 11.2.0.4.201020 (31537677)"
Created on 24 Sep 2020, 06:02:11 hrs PST8PDT
Sub-patch 31103343; "Database Patch Set Update : 11.2.0.4.200714 (31103343)"
...
Bugs fixed:
18619917, 19309466, 28876684, 28855981, 18189036, 19781326, 13609098
...
Patch 29938455 : applied on Thu Apr 08 14:30:23 CST 2021
Unique Patch ID: 23206871
Patch description: "OCW Patch Set Update : 11.2.0.4.191015 (29938455)"
Created on 23 Aug 2019, 01:51:24 hrs PST8PDT
Bugs fixed:
18328800, 19270660, 18691572, 18508710, 20038451, 21251192, 22162062
...
--------------------------------------------------------------------------------
OPatch succeeded.
[oracle@his:/home/oracle]$opatch lspatches
31537677;Database Patch Set Update : 11.2.0.4.201020 (31537677)
29938455;OCW Patch Set Update : 11.2.0.4.191015 (29938455)
OPatch succeeded.
重新编译
su - oracle
[oracle@his:/home/oracle]$sqlplus "/as sysdba"
SQL*Plus: Release 11.2.0.4.0 Production on Thu Apr 8 14:57:42 2021
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup
ORACLE instance started.
Total System Global Area 8351150080 bytes
Fixed Size 2269872 bytes
Variable Size 2046823760 bytes
Database Buffers 6291456000 bytes
Redo Buffers 10600448 bytes
Database mounted.
Database opened.
SQL> @?/rdbms/admin/catbundle.sql psu apply