Oracle 19c 单实例 19.3.0 升级到19.11.0 详细教程

171 篇文章 14 订阅

一、查看当前DB环境

$ cat  /etc/redhat-release
Red Hat Enterprise Linux Server release 7.7 (Maipo)

$ uname -r
4.14.35-1902.3.2.el7uek.x86_64

$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Fri Jul 29 11:09:11 2022
Version 19.3.0.0.0

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


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

SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 OCP                            READ WRITE NO

二、安装19.11 的RU补丁

19.11 的DB补丁是:p32545013_190000_Linux-x86-64.zip
可以直接从MOS上下载,解压之后查阅readme文档。

1.检查OPatch工具版本

要安装19C的RU,OPatch 工具的版本必须大于 12.2.0.1.23。
在Oracle 19.3的版本中,OPatch版本是12.2.0.1.17的。 所以需要单独的更新OPatch。

$ cd /u01/app/oracle/product/19.3.0/dbhome_1/OPatch/
$ ./opatch version
OPatch Version: 12.2.0.1.17
OPatch succeeded.
2.查看OPatch是否冲突
$ unzip p32545013_190000_Linux-x86-64.zip
$ cd 32545013/
$ $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -ph ./
3.应用opatch

这里有几点注意事项:

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

3.1 关闭监听
$ lsnrctl stop

LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 29-JUL-2022 14:29:44

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

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
The command completed successfully
3.2 关闭数据库
SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 OCP                            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.3.0.0.0
3.3 应用opatch
$ cd /oradata/oracle/32545013
$ $ORACLE_HOME/OPatch/opatch apply
Oracle Interim Patch Installer version 12.2.0.1.17
Copyright (c) 2022, Oracle Corporation.  All rights reserved.


Oracle Home       : /u01/app/oracle/product/19.3/dbhome_1
Central Inventory : /u01/app/oraInventory
   from           : /u01/app/oracle/product/19.3/dbhome_1/oraInst.loc
OPatch version    : 12.2.0.1.17
OUI version       : 12.2.0.7.0
Log file location : /u01/app/oracle/product/19.3/dbhome_1/cfgtoollogs/opatch/opatch2022-07-29_14-34-57PM_1.log

Verifying environment and performing prerequisite checks...
Prerequisite check "CheckMinimumOPatchVersion" failed.
The details are:


The OPatch being used has version 12.2.0.1.17 while the following patch(es) require higher versions:
Patch 32545013 requires OPatch version 12.2.0.1.23.
Please download latest OPatch from My Oracle Support.

UtilSession failed: Prerequisite check "CheckMinimumOPatchVersion" failed.
Log file location: /u01/app/oracle/product/19.3/dbhome_1/cfgtoollogs/opatch/opatch2022-07-29_14-34-57PM_1.log

OPatch failed with error code 73

如果报错,需要安装psmisc包

# yum install -y psmisc
Loaded plugins: ulninfo
base                                                                                                                           | 3.6 kB  00:00:00
epel                                                                                                                           | 4.7 kB  00:00:00
Resolving Dependencies
--> Running transaction check
---> Package psmisc.x86_64 0:22.20-16.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

======================================================================================================================================================
 Package                           Arch                              Version                                    Repository                       Size
======================================================================================================================================================
Installing:
 psmisc                            x86_64                            22.20-16.el7                               base                            141 k

Transaction Summary
======================================================================================================================================================
Install  1 Package

Total download size: 141 k
Installed size: 475 k
Downloading packages:
psmisc-22.20-16.el7.x86_64.rpm                                                                                                 | 141 kB  00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : psmisc-22.20-16.el7.x86_64                                                                                                         1/1
  Verifying  : psmisc-22.20-16.el7.x86_64                                                                                                         1/1

Installed:
  psmisc.x86_64 0:22.20-16.el7

Complete!

再次应用opatch依然报错
$ $ORACLE_HOME/OPatch/opatch apply

经查询网络资源,找到参考文章http://blog.itpub.net/20674423/viewspace-1383112/
得出方法:下载一个最新的OPatch工具,并通过该工具进行补丁的apply即可。

$ cp p6880880_122010_Linux-x86-64.zip $ORACLE_HOME
$ cd $ORACLE_HOME
$ mv OPatch OPatch_OLD
$ unzip p6880880_122010_Linux-x86-64.zip
$ ./opatch version
OPatch Version: 12.2.0.1.25

OPatch succeeded.

再次应用OPatch

$ $ORACLE_HOME/OPatch/opatch apply
Oracle Interim Patch Installer version 12.2.0.1.25
Copyright (c) 2022, Oracle Corporation.  All rights reserved.


Oracle Home       : /u01/app/oracle/product/19.3/dbhome_1
Central Inventory : /u01/app/oraInventory
   from           : /u01/app/oracle/product/19.3/dbhome_1/oraInst.loc
OPatch version    : 12.2.0.1.25
OUI version       : 12.2.0.7.0
Log file location : /u01/app/oracle/product/19.3/dbhome_1/cfgtoollogs/opatch/opatch2022-07-29_15-02-00PM_1.log

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

Do you want to proceed? [y|n]
y                               --------输入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/dbhome_1')


Is the local system ready for patching? [y|n]
y                               --------输入y
User Responded with: Y
Backing up files...
Applying interim patch '32545013' to OH '/u01/app/oracle/product/19.3/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.options.olap, 19.0.0.0.0 ] , [ oracle.network.cman, 19.0.0.0.0 ] , [ oracle.oid.client, 19.0.0.0.0 ] , [ oracle.ons.eons.bwcompat, 19.0.0.0.0 ] , [ oracle.net.cman, 19.0.0.0.0 ] , [ oracle.xdk.companion, 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.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.dbtoolslistener, 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.marvel, 19.0.0.0.0...

Patching component oracle.network.rsf, 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.wwg.plsql, 19.0.0.0.0...

Patching component oracle.xdk, 19.0.0.0.0...

Patching component oracle.odbc, 19.0.0.0.0...

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

Patching component oracle.dbdev, 19.0.0.0.0...

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

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

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

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

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

Patching component oracle.ons, 19.0.0.0.0...

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

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

Patching component oracle.oraolap, 19.0.0.0.0...

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Patching component oracle.ovm, 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 32545013 successfully applied.
Sub-set patch [29517242] has become inactive due to the application of a super-set patch [32545013].
Please refer to Doc ID 2161861.1 for any possible further required actions.
Log file location: /u01/app/oracle/product/19.3/dbhome_1/cfgtoollogs/opatch/opatch2022-07-29_15-02-00PM_1.log

OPatch succeeded.
3.4 启动数据库
$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Fri Jul 29 15:10:03 2022
Version 19.11.0.0.0

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

Connected to an idle instance.

SQL> startup
ORACLE instance started.

Total System Global Area 4.0400E+10 bytes
Fixed Size                 19763976 bytes
Variable Size            5234491392 bytes
Database Buffers         3.5031E+10 bytes
Redo Buffers              114450432 bytes
Database mounted.
Database opened.

SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 OCP                            MOUNTED
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 OCP                            READ WRITE NO
3.5 加载变化的SQL到数据库
$ ./datapatch -verbos
OPatch Version: 12.2.0.1.25

OPatch succeeded.
$ ./opatch version
OPatch Version: 12.2.0.1.25

OPatch succeeded.
$ ./datapatch -verbos
SQL Patching tool version 19.11.0.0.0 Production on Fri Jul 29 15:14:22 2022
Copyright (c) 2012, 2021, Oracle.  All rights reserved.

Log file for this invocation: /u01/app/oracle/cfgtoollogs/sqlpatch/sqlpatch_128840_2022_07_29_15_14_22/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.11.0.0.0 Release_Update 210413004009: Installed
  PDB CDB$ROOT:
    Applied 19.3.0.0.0 Release_Update 190410122720 successfully on 27-JUL-22 06.07.41.663285 PM
  PDB OCP:
    Applied 19.3.0.0.0 Release_Update 190410122720 successfully on 27-JUL-22 06.15.08.453976 PM
  PDB PDB$SEED:
    Applied 19.3.0.0.0 Release_Update 190410122720 successfully on 27-JUL-22 06.15.08.453976 PM

Adding patches to installation queue and performing prereq checks...done
Installation queue:
  For the following PDBs: CDB$ROOT OCP
    No interim patches need to be rolled back
    Patch 32545013 (Database Release Update : 19.11.0.0.210420 (32545013)):
      Apply from 19.3.0.0.0 Release_Update 190410122720 to 19.11.0.0.0 Release_Update 210413004009
    No interim patches need to be applied
  For the following PDBs: PDB$SEED
    No interim patches need to be rolled back
    Patch 32545013 (Database Release Update : 19.11.0.0.210420 (32545013)):
      Apply from 19.3.0.0.0 Release_Update 190410122720 to 19.11.0.0.0 Release_Update 210413004009
    No interim patches need to be applied

Installing patches...
Patch installation complete.  Total patches installed: 3

Validating logfiles...done
Patch 32545013 apply (pdb CDB$ROOT): SUCCESS
  logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/32545013/24175065/32545013_apply_WIN_CDBROOT_2022Jul29_15_14_51.log (no errors)
Patch 32545013 apply (pdb OCP): SUCCESS
  logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/32545013/24175065/32545013_apply_WIN_OCP_2022Jul29_15_20_40.log (no errors)
Patch 32545013 apply (pdb PDB$SEED): SUCCESS
  logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/32545013/24175065/32545013_apply_WIN_PDBSEED_2022Jul29_15_25_48.log (no errors)
SQL Patching tool complete on Fri Jul 29 15:31:08 2022
4.查看版本变化
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    27-JUL-22 06.07.41.663285 PM
Database Release Update : 19.3.0.0.190416 (29517242)

  32545013 RU         APPLY      INITIALIZE 29-JUL-22 03.14.51.590477 PM
Database Release Update : 19.11.0.0.210420 (32545013)

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.11.0.0.0DBRU_LINUX.X64_210412

27-JUL-22 06.07.36.178974 PM   19.0.0.0.0
Patch applied on 19.3.0.0.0: Release_Update - 190410122720

29-JUL-22 03.20.13.679758 PM   19.0.0.0.0
Patch applied from 19.3.0.0.0 to 19.11.0.0.0: Release_Update - 210413004009

相关文章:
《Oracle19c安装图文教程》


参考:
https://blog.csdn.net/hbhe0316/article/details/121313644

  • 2
    点赞
  • 16
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值