12c集群环境打补丁

环境介绍:

集群版本是12.2.0.1

                     数据库版本是12.1.0.1

两个补丁包都已经下载好分别放到了/tmp/grid20190107/   ---集群补丁

/tmp/oracle/grid20190107  ----数据库补丁

这次使用的是opatchauto打

这里重点说明一下,打补丁之前一定要看下README.HTML,就算英文不好也要尝试看下,里面会有很多打补丁的命令和步骤,习惯下多看看就会懂是什么意思,需要做一些什么

升级集群Opatch(2个节点都要这么做)

cd $ORACLE_HOME

mv OPatch  Opatch.bak  ---备份原来的OPatch

pwd

/grid/app/12.2.0/grid    ---集群ORACLE_HOME目录

mv /tmp/grid2019010/OPatch /grid/app/12.2.0/grid   ----移动升级Opatch

Chown –R oracle:oinstall xxxx

Chmod 755 –R xxxxx

升级完之后切换到grid用户输入opatch看下版本是否正确

12c集群环境打补丁-12.2.0.1

集群打补丁

补丁介绍:

12c集群环境打补丁-12.2.0.1

这次集群要打5个补丁,其中3个补丁DB不用打,grid打就行

检查补丁冲突

For Grid Infrastructure Home, as home user:grid补丁检查)

% $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /tmp/grid20190107//28714316/28662603

% $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /tmp/grid20190107//28714316/28662626

% $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /tmp/grid20190107//28714316/28662640

% $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /tmp/grid20190107//28714316/26839277

% $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /tmp/grid20190107//28714316/28566910

For Database home, as home user:oracle补丁检查)

% $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /tmp/oracle/grid20190107/28714316/28662603

% $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /tmp/oracle/grid20190107/28714316/28662626

Grid要打5个,DB打2个,检查都要sucessed才算成功没问题,以上都属于打集群的补丁

Grid开始打补丁

命令:

Opatchauto apply /tmp/20190107/28714316

报错1:2节点grid-opatch未升级

12c集群环境打补丁-12.2.0.1

刚开始输入Opatchauto apply /tmp/20190107/28714316  报的错,从报错信息看是脚本里没有找到auto无法打开,仔细一想二节点的grid好像没升级OPatch,这就是为什么再之前我要强调两个节点都要升级的原因

二节点升级完成之后再执行一下就成功了

 

Starting CRS service on home /grid/app/12.2.0/grid

Postpatch operation log file location: /grid/app/grid/crsdata/zjscfxstprac01/crsconfig/crspatch_zjscfxstprac01_2019-01-08_12-10-36AM.log

CRS service started successfully on home /grid/app/12.2.0/grid

 

OPatchAuto successful.

 

--------------------------------Summary--------------------------------

 

Patching is completed successfully. Please find the summary as follows:

 

Host:zjscfxstprac01

CRS Home:/grid/app/12.2.0/grid

Version:12.2.0.1.0

Summary:

 

==Following patches were SUCCESSFULLY applied:

 

Patch: /tmp/grid20190107/28714316/26839277

Log: /grid/app/12.2.0/grid/cfgtoollogs/opatchauto/core/opatch/opatch2019-01-08_12-08-36PM_1.log

 

Patch: /tmp/grid20190107/28714316/28566910

Log: /grid/app/12.2.0/grid/cfgtoollogs/opatchauto/core/opatch/opatch2019-01-08_12-08-36PM_1.log

 

Patch: /tmp/grid20190107/28714316/28662603

Log: /grid/app/12.2.0/grid/cfgtoollogs/opatchauto/core/opatch/opatch2019-01-08_12-08-36PM_1.log

 

Patch: /tmp/grid20190107/28714316/28662626

Log: /grid/app/12.2.0/grid/cfgtoollogs/opatchauto/core/opatch/opatch2019-01-08_12-08-36PM_1.log

 

Patch: /tmp/grid20190107/28714316/28662640

Log: /grid/app/12.2.0/grid/cfgtoollogs/opatchauto/core/opatch/opatch2019-01-08_12-08-36PM_1.log

 

 

 

Following homes are skipped during patching as patches are not applicable:

 

/oracle/app/oracle/product/12.2.0/db

 

报错2:进程阻塞

这里为什么会说跳过了补丁,刚才环境介绍的时候就已经说明了,集群环境是12.2.0.1 而数据库是12.1.0.1

README.HTML里也有说明

12c集群环境打补丁-12.2.0.1

12c集群环境打补丁-12.2.0.1

README还是挺重要的

 

所以这套12.2.0.1只能打grid,集群的oracle打不了,没有适用的

 

二节点也是同上的方法执行:Opatchauto apply /tmp/20190107/28714316

 

Opatchauto的优点就是不用手动关闭集群,关闭数据库,他会自动帮你管理,关闭集群关闭数据库,当然是关闭单节点

 

Oracle开始打补丁

升级OPatch方法和grid打补丁一样的,就不多说了,记得属组修改一下

Chown –R oracle:oinstall xxxx

Chmod 755 –R xxxxx

当然也要检查补丁冲突

unzip p28259833_121020_HPUX-IA64.zip

cd 28259833

opatch prereq CheckConflictAgainstOHWithDetail -ph ./

 

检查完后就开始打补丁

unzip 28259833_<version>_<platform>.zip

cd 28259833

opatch apply

 

报错1

Oracle Home       : /oracle/app/oracle/product/12.2.0/db

Central Inventory : /grid/app/oraInventory

   from           : /oracle/app/oracle/product/12.2.0/db/oraInst.loc

OPatch version    : 12.2.0.1.16

OUI version       : 12.1.0.2.0

Log file location : /oracle/app/oracle/product/12.2.0/db/cfgtoollogs/opatch/opatch2019-01-08_12-43-33PM_1.log

 

Verifying environment and performing prerequisite checks...

Prerequisite check "CheckActiveFilesAndExecutables" failed.

The details are:

 

 

Following active executables are not used by opatch process :

/oracle/app/oracle/product/12.2.0/db/lib/libclntsh.so.12.1

 

Following active executables are used by opatch process :

 

Prerequisite check "CheckActiveFilesAndExecutables" failed.

The details are:

 

 

Following active executables are not used by opatch process :

/oracle/app/oracle/product/12.2.0/db/lib/libsqlplus.so

 

Following active executables are used by opatch process :

 

UtilSession failed: Prerequisite check "CheckActiveFilesAndExecutables" failed.Prerequisite check "CheckActiveFilesAndExecutables" failed.

Log file location: /oracle/app/oracle/product/12.2.0/db/cfgtoollogs/opatch/opatch2019-01-08_12-43-33PM_1.log

 

OPatch failed with error code 73

 

这里看似这么多报错信息,还是需要仔细看,不是只能单看.log文档

上述报错信息中有

有一个进程阻塞了我的opatch apply打补丁

要找到这个阻塞过程是干嘛的,打补丁的时候集群和数据库理论上都应该停掉这样打补丁好一点,所以找到了这个阻塞进程需要kill掉

[[email protected] ~]$ ll /oracle/app/oracle/product/12.2.0/db/lib/libclntsh.so.12.1

-rwxr-xr-x 1 oracle oinstall 58795804 Nov 23 19:37 /oracle/app/oracle/product/12.2.0/db/lib/libclntsh.so.12.1

[[email protected] ~]$ fuser /oracle/app/oracle/product/12.2.0/db/lib/libclntsh.so.12.1

/oracle/app/oracle/product/12.2.0/db/lib/libclntsh.so.12.1: 358637m

[[email protected] ~]$ ps -ef|grep 358637

oracle   358637 358598  0 Jan07 pts/3    00:00:00 sqlplus   as sysdba

oracle   434406 431953  0 12:44 pts/1    00:00:00 grep --color=auto 358637

[[email protected] ~]$ kill -9 358637

[[email protected] ~]$ ps -ef|grep 358637

oracle   434424 431953  0 12:45 pts/1    00:00:00 grep --color=auto 358637

[[email protected] ~]$ fuser /oracle/app/oracle/product/12.2.0/db/lib/libclntsh.so.12.1

[[email protected] ~]$ fuser /oracle/app/oracle/product/12.2.0/db/lib/libclntsh.so.12.1

[[email protected] ~]$

Kill掉这个进程后,重新打补丁

[[email protected] 28259833]$ $ORACLE_HOME/OPatch/opatch apply

Oracle Interim Patch Installer version 12.2.0.1.16

Copyright (c) 2019, Oracle Corporation.  All rights reserved.

 

 

Oracle Home       : /oracle/app/oracle/product/12.2.0/db

Central Inventory : /grid/app/oraInventory

   from           : /oracle/app/oracle/product/12.2.0/db/oraInst.loc

OPatch version    : 12.2.0.1.16

OUI version       : 12.1.0.2.0

Log file location : /oracle/app/oracle/product/12.2.0/db/cfgtoollogs/opatch/opatch2019-01-08_12-45-22PM_1.log

 

Verifying environment and performing prerequisite checks...

09783  26713565  26925311  27338041  27547329  28259833 

 

Do you want to proceed? [y|n]

y

User Responded with: Y

All checks passed.

 

Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.

(Oracle Home = '/oracle/app/oracle/product/12.2.0/db')

 

 

Is the local system ready for patching? [y|n]

y

User Responded with: Y

Backing up files...

Applying sub-patch '19769480' to OH '/oracle/app/oracle/product/12.2.0/db'

 

Patching component oracle.rdbms.deconfig, 12.1.0.2.0...

 

 

Patching component oracle.ldap.client, 12.1.0.2.0...

 

Patching component oracle.rdbms.crs, 12.1.0.2.0...

 

Patching component oracle.sqlplus.rsf, 12.1.0.2.0...

Applying sub-patch '27547329' to OH '/oracle/app/oracle/product/12.2.0/db'

 

Patching component oracle.network.rsf, 12.1.0.2.0...

 

Patching component oracle.tfa, 12.1.0.2.0...

 

Patching component oracle.rdbms, 12.1.0.2.0...

 

Patching component oracle.rdbms.dbscripts, 12.1.0.2.0...

 

Patching component oracle.ldap.rsf, 12.1.0.2.0...

 

Patching component oracle.ctx.rsf, 12.1.0.2.0...

 

Patching component oracle.rdbms.rman, 12.1.0.2.0...

………………………….(省略)

 

OPatch Session completed.

 

另一个节点也这么操作

当两个节点都执行完毕后,就需要./datapatch –verbose

12c集群环境打补丁-12.2.0.1

只要在任意一个节点上运行一次就行了

 

接着重新编译一下无效对象

cd $ORACLE_HOME/rdbms/admin

sqlplus /nolog

SQL> CONNECT / AS SYSDBA

SQL> @utlrp.sql

 

检查查询下数据库打的补丁代码

12c集群环境打补丁-12.2.0.1

相关文章:

  • 2021-08-08
  • 2022-01-21
  • 2021-11-18
  • 2022-01-21
  • 2021-12-05
  • 2021-12-05
  • 2022-12-23
  • 2021-08-15
猜你喜欢
  • 2021-04-20
  • 2021-07-10
  • 2021-11-18
  • 2022-12-23
  • 2021-07-04
相关资源
相似解决方案