当前位置: 首页 > news >正文

Oracle单实例升级补丁

目录

  • 1.当前DB环境
  • 2.下载补丁包和opatch的升级包
  • 3.检查OPatch的版本
  • 4.检查补丁是否冲突
  • 5.关闭数据库实例,关闭监听
  • 6.应用patch
  • 7.加载变化的SQL到数据库
  • 8.ORACLE升级补丁查询

oracle19.3升级补丁到19.18

1.当前DB环境

[oracle@localhost ~]$ cat  /etc/redhat-release 
CentOS Linux release 7.9.2009 (Core)
[oracle@localhost ~]$ uname -r
3.10.0-1160.el7.x86_64
[oracle@localhost ~]$ lsnrctl statusLSNRCTL for Linux: Version 19.0.0.0.0 - Production on 08-AUG-2023 05:39:02Copyright (c) 1991, 2019, Oracle.  All rights reserved.Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 19.0.0.0.0 - Production
Start Date                12-JAN-2023 00:13:37
Uptime                    208 days 4 hr. 25 min. 25 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/19c/db_1/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/localhost/listener/alert/log.xml
Listening Endpoints Summary...(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521)))(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Services Summary...
Service "orcl" has 1 instance(s).Instance "orcl", status READY, has 1 handler(s) for this service...
Service "orclXDB" has 1 instance(s).Instance "orcl", status READY, has 1 handler(s) for this service...
The command completed successfully
[oracle@localhost ~]$ sqlplus / as sysdbaSQL*Plus: Release 19.0.0.0.0 - Production on Tue Aug 8 05:40:12 2023
Version 19.3.0.0.0Copyright (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

2.下载补丁包和opatch的升级包

要具有开源精神
opatch升级包:
链接:https://pan.baidu.com/s/1I2Kt44kMM2Y2rNMdjvintw
提取码:y09u
–来自百度网盘超级会员V1的分享
19.18的补丁包
链接:https://pan.baidu.com/s/1V-L6BJykTKqUSri1BqzFwg
提取码:narc
–来自百度网盘超级会员V1的分享

3.检查OPatch的版本

更新opatch,根据README要求,opatch工具版本至少12.2.0.1.34 或更高版本

[oracle@localhost ~]$ cd $ORACLE_HOME
[oracle@localhost db_1]$ cd OPatch/
[oracle@localhost OPatch]$ ./opatch version
OPatch Version: 12.2.0.1.17OPatch succeeded.

升级opatch版本

#备份OPatch
[oracle@localhost ~]$ mv $ORACLE_HOME/OPatch  $ORACLE_HOME/OPatch.bak#解压到$ORACLE_HOME目录下
[oracle@localhost ~]$ unzip p6880880_190000_Linux-x86-64.zip  -d $ORACLE_HOME#查看升级后的opatch的版本
[oracle@localhost ~]$ cd $ORACLE_HOME
[oracle@localhost db_1]$ cd OPatch/
[oracle@localhost OPatch]$ ./opatch version
OPatch Version: 12.2.0.1.36OPatch succeeded.

4.检查补丁是否冲突

[oracle@localhost ~]$ unzip p34762026_190000_Linux-x86-64.zip
[oracle@localhost ~]$ chown -R  oracle:oinstall   34762026/
[oracle@localhost ~]$ chmod 775 -R 34762026/
#检测冲突,依次检测
[oracle@localhost ~]$ $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -ph /home/oracle/34762026/33575402/
[oracle@localhost ~]$ $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -ph /home/oracle/34762026/34765931/
[oracle@localhost ~]$ $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -ph /home/oracle/34762026/34768559/
[oracle@localhost ~]$ $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -ph /home/oracle/34762026/34768569/
[oracle@localhost ~]$ $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -ph /home/oracle/34762026/34863894/
#出现以下字样,检测成功
Oracle Interim Patch Installer version 12.2.0.1.36
Copyright (c) 2023, Oracle Corporation.  All rights reserved.PREREQ sessionOracle Home       : /u01/app/oracle/product/19c/db_1
Central Inventory : /u01/oraInventoryfrom           : /u01/app/oracle/product/19c/db_1/oraInst.loc
OPatch version    : 12.2.0.1.36
OUI version       : 12.2.0.7.0
Log file location : /u01/app/oracle/product/19c/db_1/cfgtoollogs/opatch/opatch2023-08-08_06-47-50AM_1.logInvoking prereq "checkconflictagainstohwithdetail"Prereq "checkConflictAgainstOHWithDetail" passed.OPatch succeeded.

5.关闭数据库实例,关闭监听

[oracle@localhost ~]$ sqlplus / as sysdbaSQL*Plus: Release 19.0.0.0.0 - Production on Tue Aug 8 06:53:08 2023
Version 19.3.0.0.0Copyright (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.0SQL> 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
[oracle@localhost ~]$ lsnrctl stopLSNRCTL for Linux: Version 19.0.0.0.0 - Production on 08-AUG-2023 07:13:07Copyright (c) 1991, 2019, Oracle.  All rights reserved.Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521)))
The command completed successfully

6.应用patch

[oracle@localhost 34765931]$ pwd
/home/oracle/34762026/34765931
[oracle@localhost 34765931]$ $ORACLE_HOME/OPatch/opatch apply
Oracle Interim Patch Installer version 12.2.0.1.36
Copyright (c) 2023, Oracle Corporation.  All rights reserved.Oracle Home       : /u01/app/oracle/product/19c/db_1
Central Inventory : /u01/oraInventoryfrom           : /u01/app/oracle/product/19c/db_1/oraInst.loc
OPatch version    : 12.2.0.1.36
OUI version       : 12.2.0.7.0
Log file location : /u01/app/oracle/product/19c/db_1/cfgtoollogs/opatch/opatch2023-08-08_07-19-09AM_1.logVerifying environment and performing prerequisite checks...
......

7.加载变化的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

在这里插入图片描述

8.ORACLE升级补丁查询

1.查询dba_server_registry视图

SQL> select comp_name,version from dba_server_registry;

2.查询dba_registry_history

SQL> select * from dba_registry_history;

3.查询product_component_version视图

SQL> select product,version from product_component_version;

4.查询v$version视图

SQL> select * from v$version;
http://www.lryc.cn/news/115315.html

相关文章:

  • 力扣初级算法(二分查找)
  • 探索未来:直播实时美颜SDK在增强现实(AR)直播中的前景
  • SQL 单行子查询 、多行子查询、单行函数、聚合函数 IN 、ANY 、SOME 、ALL
  • 【第一阶段】kotlin的range表达式
  • 网络防御(5)
  • gradle 命令行单元测试执行问题
  • 剑指Offer12.矩阵中的路径 C++
  • 金鸣识别将无表格线的图片转为excel的几个常用方案
  • 刚刚更新win11,记事本消失怎么处理?你需要注意些什么?
  • 【QT】 QTabWidgetQTabBar控件样式设计(QSS)
  • 【个人记录】CentOS7 编译安装最新版本Git
  • 【Linux】计算机网络的背景和协议分层
  • 代理模式:静态代理+JDK/CGLIB 动态代理
  • gps虚拟定位 AnyGo for Mac 中文
  • LLM reasoners 入门实验 24点游戏
  • 【LeetCode 算法】Maximum Absolute Sum of Any Subarray 任意子数组和的绝对值的最大值-前缀和
  • 怎么建立大型语言模型
  • docker简介和安装
  • 记录问题: servlet获取项目包绝对路径
  • C语言文件操作基本方法
  • SQL 相关子查询 和 不相关子查询、Exists 、Not Exists、 多表连接(包含自连接)
  • 项目规范 编写规范(范例)
  • MongoDB数据库操作及操作命令
  • Linux命令(62)之tee
  • 搭建Repo服务器
  • 安卓:MMKV——键值存储库
  • 使用Python将图像转换为PDF:一次性解决您的批量转换需求
  • Vue——webpack
  • springboot房地产管理java购房租房二手房j客户sp源代码mysql
  • Gartner 发布影响数据科学和机器学习未来方向重要趋势