签到成功

知道了

CNDBA社区CNDBA社区

Oracle 19c 单实例 RU 从19.12.0 升级到19.14.0 操作手册

2022-02-09 19:02 2727 0 原创 Oracle 19c
作者: dave

关于Oracle 19c 的RU和RUR的说明,参考我之前的博客:

Oracle 12.2 家族的补丁 RU 和 RUR 说明
https://www.cndba.cn/dave/article/4063

http://www.cndba.cn/dave/article/106634

19.3 单实例的安装参考之前的博客:

Linux 7.4 平台下 Oracle 19.3 单实例安装手册
https://www.cndba.cn/dave/article/3427http://www.cndba.cn/dave/article/106634

Oracle 19c 单实例 RU 从19.3.0 升级到19.6.0 操作手册
https://www.cndba.cn/dave/article/4065http://www.cndba.cn/dave/article/106634

Oracle 19c 单实例 RU 从19.9.0 升级到19.10.0 操作手册
https://www.cndba.cn/dave/article/4358

Oracle 19c 单实例 RU 从19.11.0 升级到19.12.0 操作手册
https://www.cndba.cn/Dave/article/4617

当然也可以直接安装19.5的基础发布版,然后升级到19.10。

Oracle 19c 基础发布版 19.5 说明
https://www.cndba.cn/dave/article/4277

Oracle RU 19.14 发布了
https://www.cndba.cn/dave/article/106608

本篇博客我们在之前的环境上演示19.12.0 到 19.14.0 的RU的升级过程。

1当前DB 环境

[root@dave ~]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.7 (Maipo)
[root@dave ~]# uname -r
3.10.0-1062.el7.x86_64
[root@dave ~]#

[dave@www.cndba.cn  ~]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Wed Feb 9 16:12:20 2022
Version 19.12.0.0.0

Copyright (c) 1982, 2021, Oracle.  All rights reserved.


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.12.0.0.0

SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 DAVE                           READ WRITE NO
         4 USTC                           READ WRITE NO
SQL>

2从MOS下载19.14 的RU 补丁

Oracle RU 19.14 发布了
https://www.cndba.cn/dave/article/106608

3开始安装RU补丁

3.1 检查OPatch工具版本

要安装19.14的RU,OPatch 工具的版本必须大于 12.2.0.1.28 。 最新版本的OPatch 可以从MOS上下载,补丁号是:patch 6880880 。 OPatch 工具升级的方法参考我之前的博客,这里不再重复描述。

Oracle 更新 OPatch 工具版本 的方法 说明
https://www.cndba.cn/Dave/article/1353http://www.cndba.cn/dave/article/106634

我们这里OPatch 的版本如下:http://www.cndba.cn/dave/article/106634

[dave@www.cndba.cn  OPatch]$  ./opatch version
OPatch Version: 12.2.0.1.29

OPatch succeeded.
[dave@www.cndba.cn  OPatch]$

3.2 检查Patch 是否冲突

[dave@www.cndba.cn  u01]$ cd 33515361/
[dave@www.cndba.cn  33515361]$ pwd
/u01/33515361
[dave@www.cndba.cn  33515361]$  $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -ph ./
Oracle Interim Patch Installer version 12.2.0.1.29
Copyright (c) 2022, Oracle Corporation.  All rights reserved.

PREREQ session

Oracle Home       : /u01/app/oracle/product/19.3.0/dbhome_1
Central Inventory : /u01/app/oraInventory
   from           : /u01/app/oracle/product/19.3.0/dbhome_1/oraInst.loc
OPatch version    : 12.2.0.1.29
OUI version       : 12.2.0.7.0
Log file location : /u01/app/oracle/product/19.3.0/dbhome_1/cfgtoollogs/opatch/opatch2022-02-09_17-27-33PM_1.log

Invoking prereq "checkconflictagainstohwithdetail"

Prereq "checkConflictAgainstOHWithDetail" passed.

OPatch succeeded.
[dave@www.cndba.cn  33515361]$

3.3 应用patch

这里有几点注意事项:http://www.cndba.cn/dave/article/106634

1.如果是物理DG,那么主备库都需要安装Patch,可以先在备库安装,再安装主库,操作步骤可以参考:Document 278641.1。
2.对于RAC 环境,可以使用OPatch rolling 方式来安装,这样没有停机时间,具体操作可以参考:Document 244241.1。
3.对于单实例,必须关闭待升级ORACLE HOME关联的所有实例和监听,并且包括退出所有的sqlplus窗口。

关闭实例和监听,并退出sqlplus。

[dave@www.cndba.cn  OPatch]$ lsnrctl stop

LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 09-FEB-2022 17:31:16

Copyright (c) 1991, 2021, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=dave)(PORT=1521)))
The command completed successfully
[dave@www.cndba.cn  OPatch]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Wed Feb 9 17:31:21 2022
Version 19.12.0.0.0

Copyright (c) 1982, 2021, Oracle.  All rights reserved.


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.12.0.0.0

SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 DAVE                           READ WRITE NO
         4 USTC                           READ WRITE NO
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.12.0.0.0
[dave@www.cndba.cn  OPatch]$

应用patch:http://www.cndba.cn/dave/article/106634

[dave@www.cndba.cn  33515361]$ $ORACLE_HOME/OPatch/opatch apply
Oracle Interim Patch Installer version 12.2.0.1.29
Copyright (c) 2022, Oracle Corporation.  All rights reserved.


Oracle Home       : /u01/app/oracle/product/19.3.0/dbhome_1
Central Inventory : /u01/app/oraInventory
   from           : /u01/app/oracle/product/19.3.0/dbhome_1/oraInst.loc
OPatch version    : 12.2.0.1.29
OUI version       : 12.2.0.7.0
Log file location : /u01/app/oracle/product/19.3.0/dbhome_1/cfgtoollogs/opatch/opatch2022-02-09_17-39-43PM_1.log

Verifying environment and performing prerequisite checks...
OPatch continues with these patches:   33515361

Do you want to proceed? [y|n]

Could not recognize input. Please re-enter.
y
User Responded with: Y
All checks passed.

Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
(Oracle Home = '/u01/app/oracle/product/19.3.0/dbhome_1')


Is the local system ready for patching? [y|n]
y
User Responded with: Y
Backing up files...
Applying interim patch '33515361' to OH '/u01/app/oracle/product/19.3.0/dbhome_1'
ApplySession: Optional component(s) [ oracle.network.gsm, 19.0.0.0.0 ] , [ oracle.rdbms.ic, 19.0.0.0.0 ] , [ oracle.rdbms.tg4db2, 19.0.0.0.0 ] , [ oracle.tfa, 19.0.0.0.0 ] , [ oracle.options.olap.api, 19.0.0.0.0 ] , [ oracle.ons.cclient, 19.0.0.0.0 ] , [ oracle.network.cman, 19.0.0.0.0 ] , [ oracle.rdbms.tg4sybs, 19.0.0.0.0 ] , [ oracle.rdbms.tg4msql, 19.0.0.0.0 ] , [ oracle.rdbms.tg4ifmx, 19.0.0.0.0 ] , [ oracle.oid.client, 19.0.0.0.0 ] , [ oracle.rdbms.tg4tera, 19.0.0.0.0 ] , [ oracle.net.cman, 19.0.0.0.0 ] , [ oracle.xdk.companion, 19.0.0.0.0 ] , [ oracle.ons.eons.bwcompat, 19.0.0.0.0 ] , [ oracle.options.olap, 19.0.0.0.0 ] , [ oracle.jdk, 1.8.0.191.0 ]  not present in the Oracle Home or a higher version is found.

Patching component oracle.help.ohj, 11.1.1.7.0...

Patching component oracle.perlint, 5.28.1.0.0...

Patching component oracle.rdbms.locator, 19.0.0.0.0...

Patching component oracle.perlint.expat, 2.0.1.0.4...

Patching component oracle.rdbms.rsf, 19.0.0.0.0...

Patching component oracle.rdbms.util, 19.0.0.0.0...

Patching component oracle.rdbms, 19.0.0.0.0...

Patching component oracle.assistants.acf, 19.0.0.0.0...

Patching component oracle.assistants.deconfig, 19.0.0.0.0...

Patching component oracle.assistants.server, 19.0.0.0.0...

Patching component oracle.buildtools.rsf, 19.0.0.0.0...

Patching component oracle.ctx, 19.0.0.0.0...

Patching component oracle.dbjava.ic, 19.0.0.0.0...

Patching component oracle.dbjava.jdbc, 19.0.0.0.0...

Patching component oracle.dbjava.ucp, 19.0.0.0.0...

Patching component oracle.duma, 19.0.0.0.0...

Patching component oracle.javavm.client, 19.0.0.0.0...

Patching component oracle.ldap.owm, 19.0.0.0.0...

Patching component oracle.ldap.rsf, 19.0.0.0.0...

Patching component oracle.ldap.security.osdt, 19.0.0.0.0...

Patching component oracle.marvel, 19.0.0.0.0...

Patching component oracle.network.rsf, 19.0.0.0.0...

Patching component oracle.odbc.ic, 19.0.0.0.0...

Patching component oracle.oracore.rsf, 19.0.0.0.0...

Patching component oracle.precomp.common.core, 19.0.0.0.0...

Patching component oracle.rdbms.dbscripts, 19.0.0.0.0...

Patching component oracle.rdbms.deconfig, 19.0.0.0.0...

Patching component oracle.rdbms.oci, 19.0.0.0.0...

Patching component oracle.rhp.db, 19.0.0.0.0...

Patching component oracle.sdo, 19.0.0.0.0...

Patching component oracle.sdo.locator.jrf, 19.0.0.0.0...

Patching component oracle.sqlplus, 19.0.0.0.0...

Patching component oracle.sqlplus.ic, 19.0.0.0.0...

Patching component oracle.wwg.plsql, 19.0.0.0.0...

Patching component oracle.rdbms.crs, 19.0.0.0.0...

Patching component oracle.rdbms.drdaas, 19.0.0.0.0...

Patching component oracle.xdk.xquery, 19.0.0.0.0...

Patching component oracle.network.client, 19.0.0.0.0...

Patching component oracle.javavm.server, 19.0.0.0.0...

Patching component oracle.rdbms.rman, 19.0.0.0.0...

Patching component oracle.xdk.rsf, 19.0.0.0.0...

Patching component oracle.rdbms.hsodbc, 19.0.0.0.0...

Patching component oracle.odbc, 19.0.0.0.0...

Patching component oracle.precomp.rsf, 19.0.0.0.0...

Patching component oracle.rdbms.lbac, 19.0.0.0.0...

Patching component oracle.oraolap.api, 19.0.0.0.0...

Patching component oracle.rdbms.dv, 19.0.0.0.0...

Patching component oracle.ldap.ssl, 19.0.0.0.0...

Patching component oracle.ons, 19.0.0.0.0...

Patching component oracle.ovm, 19.0.0.0.0...

Patching component oracle.ctx.atg, 19.0.0.0.0...

Patching component oracle.dbdev, 19.0.0.0.0...

Patching component oracle.mgw.common, 19.0.0.0.0...

Patching component oracle.ldap.client, 19.0.0.0.0...

Patching component oracle.ons.ic, 19.0.0.0.0...

Patching component oracle.oraolap, 19.0.0.0.0...

Patching component oracle.oraolap.dbscripts, 19.0.0.0.0...

Patching component oracle.ctx.rsf, 19.0.0.0.0...

Patching component oracle.sdo.locator, 19.0.0.0.0...

Patching component oracle.rdbms.install.common, 19.0.0.0.0...

Patching component oracle.xdk, 19.0.0.0.0...

Patching component oracle.rdbms.install.plugins, 19.0.0.0.0...

Patching component oracle.xdk.parser.java, 19.0.0.0.0...

Patching component oracle.rdbms.scheduler, 19.0.0.0.0...

Patching component oracle.rdbms.hs_common, 19.0.0.0.0...

Patching component oracle.dbtoolslistener, 19.0.0.0.0...

Patching component oracle.ldap.rsf.ic, 19.0.0.0.0...

Patching component oracle.network.listener, 19.0.0.0.0...

Patching component oracle.nlsrtl.rsf, 19.0.0.0.0...

Patching component oracle.rdbms.rsf.ic, 19.0.0.0.0...

Patching component oracle.precomp.common, 19.0.0.0.0...

Patching component oracle.precomp.lang, 19.0.0.0.0...

Patching component oracle.jdk, 1.8.0.201.0...
Patch 33515361 successfully applied.
Sub-set patch [32904851] has become inactive due to the application of a super-set patch [33515361].
Please refer to Doc ID 2161861.1 for any possible further required actions.
Log file location: /u01/app/oracle/product/19.3.0/dbhome_1/cfgtoollogs/opatch/opatch2022-02-09_17-39-43PM_1.log

OPatch succeeded.
[dave@www.cndba.cn  33515361]$

3.4 加载变化的SQL到数据库

安装补丁之后,还需要将有变化的SQL加载到数据库中,这里可以直接运行Datapatch工具将这些修改的SQL重新加载到数据库中,如果是RAC环境,只需要在一个节点执行就可以了。

根据readme的说明,操作步骤如下:

sqlplus /nolog
SQL> Connect / as sysdba
SQL> startup
SQL> alter pluggable database all open;
SQL> quit
cd $ORACLE_HOME/OPatch
./datapatch -verbose

datapatch命令只对打开的数据库生效,所有Oracle建议在执行该命令之前将CDB和所有的PDB都打开,一次更新掉。 但如果有部分PDB没有打开,也可以在打开之后,重新运行datapatch命令并制定pdb实例名,比如: ./datapatch -pdbs davehttp://www.cndba.cn/dave/article/106634

这种情况可以参考之前的博客:http://www.cndba.cn/dave/article/106634

Oracle 18c 单实例 RUR 从18.3.0 升级到18.3.1 操作手册
https://www.cndba.cn/dave/article/3138

我们这里将所有的PDB 都打开后在执行datapatch工具。

启动实例:

[dave@www.cndba.cn  32904851]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Wed Feb 9 18:42:01 2022
Version 19.14.0.0.0

Copyright (c) 1982, 2021, Oracle.  All rights reserved.


Connected to an idle instance.

SQL> startup
ORACLE instance started.

Total System Global Area 1543500824 bytes
Fixed Size                  9135128 bytes
Variable Size             822083584 bytes
Database Buffers          704643072 bytes
Redo Buffers                7639040 bytes
Database mounted.
Database opened.
SQL> alter pluggable database all open;

Pluggable database altered.

SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 DAVE                           READ WRITE NO
         4 USTC                           READ WRITE NO
SQL>

运行datapatch工具:在我虚拟机上执行了大约 10 分钟。 该过程消耗CPU 资源较多,生产环境应该不需要这么长时间。

[dave@www.cndba.cn  33515361]$  $ORACLE_HOME/OPatch/datapatch -verbose
SQL Patching tool version 19.14.0.0.0 Production on Wed Feb  9 18:44:53 2022
Copyright (c) 2012, 2021, Oracle.  All rights reserved.

Log file for this invocation: /u01/app/oracle/cfgtoollogs/sqlpatch/sqlpatch_128027_2022_02_09_18_44_53/sqlpatch_invocation.log

Connecting to database...OK
Gathering database info...done

Note:  Datapatch will only apply or rollback SQL fixes for PDBs
       that are in an open state, no patches will be applied to closed PDBs.
       Please refer to Note: Datapatch: Database 12c Post Patch SQL Automation
       (Doc ID 1585822.1)

Bootstrapping registry and package to current versions...done
Determining current state...done

Current state of interim SQL patches:
  No interim patches found

Current state of release update SQL patches:
  Binary registry:
    19.14.0.0.0 Release_Update 211225122123: Installed
  PDB CDB$ROOT:
    Applied 19.12.0.0.0 Release_Update 210716141810 successfully on 26-JUL-21 08.41.27.255616 AM
  PDB DAVE:
    Applied 19.12.0.0.0 Release_Update 210716141810 successfully on 26-JUL-21 08.41.27.763016 AM
  PDB PDB$SEED:
    Applied 19.12.0.0.0 Release_Update 210716141810 successfully on 26-JUL-21 08.41.27.513130 AM
  PDB USTC:
    Applied 19.12.0.0.0 Release_Update 210716141810 successfully on 26-JUL-21 08.41.28.005607 AM

Adding patches to installation queue and performing prereq checks...done
Installation queue:
  For the following PDBs: CDB$ROOT PDB$SEED DAVE USTC
    No interim patches need to be rolled back
    Patch 33515361 (Database Release Update : 19.14.0.0.220118 (33515361)):
      Apply from 19.12.0.0.0 Release_Update 210716141810 to 19.14.0.0.0 Release_Update 211225122123
    No interim patches need to be applied

Installing patches...

Patch installation complete.  Total patches installed: 4

Validating logfiles...done
Patch 33515361 apply (pdb CDB$ROOT): SUCCESS
  logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/33515361/24589353/33515361_apply_CNDBA_CDBROOT_2022Feb09_18_45_37.log (no errors)
Patch 33515361 apply (pdb PDB$SEED): SUCCESS
  logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/33515361/24589353/33515361_apply_CNDBA_PDBSEED_2022Feb09_18_47_52.log (no errors)
Patch 33515361 apply (pdb DAVE): SUCCESS
  logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/33515361/24589353/33515361_apply_CNDBA_DAVE_2022Feb09_18_47_52.log (no errors)
Patch 33515361 apply (pdb USTC): SUCCESS
  logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/33515361/24589353/33515361_apply_CNDBA_USTC_2022Feb09_18_47_52.log (no errors)

Automatic recompilation incomplete; run utlrp.sql to revalidate.
  PDBs: DAVE PDB$SEED USTC

SQL Patching tool complete on Wed Feb  9 18:50:31 2022
[dave@www.cndba.cn  33515361]$

3.5 查看版本变化

datapatch 工具加载修改的SQL之后会将patch添加到dba_registry_sqlpatch试图中,以反应patch的应用情况。 查询试图可以看到patch的APPLY状态为”SUCCESS”。

SQL> col status for a10
SQL> col action for a10
SQL> col action_time for a30
SQL> col description for a60
SQL> select patch_id,patch_type,action,status,action_time,description from dba_registry_sqlpatch;

  PATCH_ID PATCH_TYPE                     ACTION     STATUS     ACTION_TIME
---------- ------------------------------ ---------- ---------- ------------------------------
DESCRIPTION
------------------------------------------------------------
  29517242 RU                             APPLY      SUCCESS    09-MAR-20 05.46.29.610224 PM
Database Release Update : 19.3.0.0.190416 (29517242)

  30557433 RU                             APPLY      SUCCESS    10-MAR-20 03.04.16.941816 PM
Database Release Update : 19.6.0.0.200114 (30557433)

  31771877 RU                             APPLY      SUCCESS    08-DEC-20 05.15.11.407633 PM
Database Release Update : 19.9.0.0.201020 (31771877)

  32218454 RU                             APPLY      SUCCESS    22-JAN-21 05.41.28.310050 PM
Database Release Update : 19.10.0.0.210119 (32218454)

  32545013 RU                             APPLY      SUCCESS    23-APR-21 01.25.43.807920 PM
Database Release Update : 19.11.0.0.210420 (32545013)

  32904851 RU                             APPLY      SUCCESS    26-JUL-21 08.41.27.763016 AM
Database Release Update : 19.12.0.0.210720 (32904851)

  33515361 RU                             APPLY      SUCCESS    09-FEB-22 06.50.24.423670 PM
Database Release Update : 19.14.0.0.220118 (33515361)


7 rows selected.



SQL> col version for a25
SQL> col comments for a80
SQL> select ACTION_TIME,VERSION,COMMENTS from dba_registry_history;

ACTION_TIME                    VERSION
------------------------------ -------------------------
COMMENTS
--------------------------------------------------------------------------------
                               19
RDBMS_19.14.0.0.0DBRU_LINUX.X64_211224.3

09-MAR-20 05.46.24.428460 PM   19.0.0.0.0
Patch applied on 19.3.0.0.0: Release_Update - 190410122720

10-MAR-20 03.02.50.893273 PM   19.0.0.0.0
Patch applied from 19.3.0.0.0 to 19.6.0.0.0: Release_Update - 191217155004

08-DEC-20 05.14.01.024966 PM   19.0.0.0.0
Patch applied from 19.6.0.0.0 to 19.9.0.0.0: Release_Update - 200930183249

22-JAN-21 05.40.33.576872 PM   19.0.0.0.0
Patch applied from 19.9.0.0.0 to 19.10.0.0.0: Release_Update - 210108185017

23-APR-21 01.24.33.806560 PM   19.0.0.0.0
Patch applied from 19.10.0.0.0 to 19.11.0.0.0: Release_Update - 210413004009

26-JUL-21 08.40.34.520440 AM   19.0.0.0.0
Patch applied from 19.11.0.0.0 to 19.12.0.0.0: Release_Update - 210716141810

09-FEB-22 06.50.03.846247 PM   19.0.0.0.0
Patch applied from 19.12.0.0.0 to 19.14.0.0.0: Release_Update - 211225122123


8 rows selected.



SQL>

3.6 处理无效对象

最后一步就是处理无效对象,因为之前datapatch命令会加载SQL,这个过程可能会产生无效对象。 可以执行@utlrp.sql脚本处理这些无效对象。

[dave@www.cndba.cn  33515361]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Wed Feb 9 18:55:36 2022
Version 19.14.0.0.0

Copyright (c) 1982, 2021, Oracle.  All rights reserved.


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.14.0.0.0
SQL> @?/rdbms/admin/utlrp.sql

Session altered.

至此,我们从19.12升级19.14 的操作全部结束。 http://www.cndba.cn/dave/article/106634

版权声明:本文为博主原创文章,未经博主允许不得转载。

用户评论
* 以下用户言论只代表其个人观点,不代表CNDBA社区的观点或立场
dave

dave

关注

人的一生应该是这样度过的:当他回首往事的时候,他不会因为虚度年华而悔恨,也不会因为碌碌无为而羞耻;这样,在临死的时候,他就能够说:“我的整个生命和全部精力,都已经献给世界上最壮丽的事业....."

  • 2261
    原创
  • 3
    翻译
  • 578
    转载
  • 191
    评论
  • 访问:7967928次
  • 积分:4346
  • 等级:核心会员
  • 排名:第1名
精华文章
    最新问题
    查看更多+
    热门文章
      热门用户
      推荐用户
        Copyright © 2016 All Rights Reserved. Powered by CNDBA · 皖ICP备2022006297号-1·

        QQ交流群

        注册联系QQ