当前位置:网站首页>Oracle 19c 单实例 19.3.0 升级到19.11.0 详细教程
Oracle 19c 单实例 19.3.0 升级到19.11.0 详细教程
2022-08-04 12:27:00 【夜光小兔纸】
一、查看当前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
参考:
https://blog.csdn.net/hbhe0316/article/details/121313644
边栏推荐
猜你喜欢
Why is Luo Zhenyu's A-share dream so difficult to fulfill?
1314元的七夕礼盒,收割了多少直男?
Access Huawei game anti-addiction, click the anti-addiction pop-up window, the game crashes
基于BiLSTM的回归预测方法
Programmer Qixi Gift - How to quickly build an exclusive chat room for your girlfriend in 30 minutes
systemdd-dev病毒杀
Nacos手摸手教学【二】Nacos注册中心
“蔚来杯“2022牛客暑期多校训练营2 G、J、K
【VSCode】一文详解vscode下安装vim后无法使用Ctrl+CV复制粘贴 使用Vim插件的配置记录
LeetCode Daily Question (858. Mirror Reflection)
随机推荐
UMA&港理工&阿里提出SP-ViT,为视觉Transformer学习2D空间先验知识!
活动报名:如何高效应对当下的实时场景需求?
Linux-Docker-Mysql安装
拥有一台服务器,程序猿装X的开始
Redis (1) installation and configuration
考研数一数二数三之间的具体详细区别
Valentine's Day Romantic 3D Photo Wall [with source code]
Hit the interview!The latest interview booklet of Ali Jin, nine silver and ten is stable!
#夏日挑战赛#OpenHarmony 给你的输入法加点彩—星球崛起
新消费、出海、大健康......电子烟寻找“避风港”
COMSOL空气反应 模型框架
技术分享| 融合调度系统中的电子围栏功能说明
如何让 WPF 程序更好地适配 UI 自动化
外置USB供电与内置锂电池供电自动切换电路
TensorFlow学习记录(三):高阶操作 & 神经网络与全连接层
String is a reference type
2022上半年各银行理财子公司深耕差异化发展,净值型产品数量增加
接到“网站动态换主题”的需求,我是如何踩坑的
简要介绍电源效率测试
隐私计算与数据流通:关系、作用及功能