Oracle Patch清理

场景:
在对Oracle安装补丁后,会发现OS上被占用了大量的空间,本文档清理Opatch过程中的一些文件,释放空间

参考文档:
Can You Delete $ORACLE_HOME/.patch_storage Directory ? (Doc ID 403218.1)
How To Avoid Disk Full Issues Because OPatch Backups Take Big Amount Of Disk Space. (Doc ID 550522.1)

-- 查看$ORACLE_HOME下的隐藏文件夹.patch_storage。 可以看到之前的补丁过程,产生的一些文件。这些文件主要用于rollback补丁,如果不需要,可以清除,以释放空间。

[oracle@19ctest .patch_storage]$ du -sm *
1       29517242_Apr_17_2019_23_27_10
1       29585399_Apr_9_2019_19_12_47
2314    35042068_Apr_6_2023_15_25_04
1941    35320081_Jul_15_2023_12_54_11
2071    35643107_Oct_3_2023_13_34_29
1939    35943157_Jan_13_2024_05_42_55
2138    36233263_Apr_8_2024_17_16_56
1       interim_inventory.txt
1       LatestOPatchSession.properties
1       NApply
1       newdirs.txt
1       record_inventory.txt
[oracle@19ctest .patch_storage]$ pwd
/u01/app/oracle/product/19.0.0/db_1/.patch_storage
[oracle@19ctest .patch_storage]$ 

-- /u01目录剩余17G 

[oracle@19ctest .patch_storage]$ df -h
Filesystem                   Size  Used Avail Use% Mounted on
devtmpfs                     4.3G     0  4.3G   0% /dev
tmpfs                        4.4G     0  4.4G   0% /dev/shm
tmpfs                        4.4G  8.8M  4.4G   1% /run
tmpfs                        4.4G     0  4.4G   0% /sys/fs/cgroup
/dev/mapper/ol_19cdg01-root   17G  4.1G   13G  24% /
/dev/sdc1                    120G   74G   47G  62% /oradata
/dev/sdd1                    120G   60G   61G  50% /arch
/dev/sda1                   1014M  169M  846M  17% /boot
/dev/sde1                    100G   24G   76G  24% /mysql
/dev/sdf1                    120G   47G   74G  39% /oradatapdb
/dev/sdb1                     40G   24G   17G  59% /u01
tmpfs                        883M     0  883M   0% /run/user/0
[oracle@19ctest .patch_storage]$ 

-- opatch clean的帮助,该命令清除.patch_storage directory文件夹下的'restore.sh,make.txt' files and 'scratch,backup' 

[oracle@19ctest ~]$ opatch util cleanup -help
Oracle Interim Patch Installer version 12.2.0.1.41
Copyright (c) 2024, Oracle Corporation.  All rights reserved.DESCRIPTIONThis utility cleans up 'restore.sh,make.txt' files and 'scratch,backup' directories of the.patch_storage directory of Oracle Home.If -ps option is used, then, it cleans the above specified areas only for that patch, else for all patches under ORACLE_HOME/.patch_storage. You will be still able torollback patches after this cleanup.SYNTAX
opatch util cleanup  [-invPtrLoc <Path to oraInst.loc> ][-jre <LOC> ] [-oh <ORACLE_HOME> ][-silent] [-report][-ps <patch ID with time stamp>, this willbe located under ORACLE_HOME/.patch_storage/]OPTIONS   -invPtrLocUsed to locate the oraInst.loc file. Needed when theinstallation used the -invPtrLoc flag. This should bethe path to the oraInst.loc file.-jreThis option tells OPatch to use JRE (java) from thespecified location instead of the default locationunder Oracle Home. Both -jdk and -jre options cannotbe specified together. OPatch will display error inthat case.-ohThe oracle home to work on. This takes precedence overthe environment variable ORACLE_HOME.-psThis option is used to specify the Patch ID with timestamp.This Patch ID with timestamp should be the same as in.patch_storage directory.A directory by this name will be present underORACLE_HOME/.patch_storage. If this directory is specifiedand is valid, then the contents specified in the descriptionwill be cleaned up only for this patch. Otherwise, all patchrelated directories will be acted upon by this utility.-silent In silent mode, the cleanup always takes place.-report Prints the operations without actually executing them.OPatch succeeded.
[oracle@19ctest ~]$ 

-- 从清理过程看,会清理'restore.sh,make.txt' files and 'scratch,backup' directories.但仍然可以对补丁进行rollback 

[oracle@19ctest ~]$ opatch util cleanup
Oracle Interim Patch Installer version 12.2.0.1.41
Copyright (c) 2024, Oracle Corporation.  All rights reserved.Oracle Home       : /u01/app/oracle/product/19.0.0/db_1
Central Inventory : /u01/app/oraInventoryfrom           : /u01/app/oracle/product/19.0.0/db_1/oraInst.loc
OPatch version    : 12.2.0.1.41
OUI version       : 12.2.0.7.0
Log file location : /u01/app/oracle/product/19.0.0/db_1/cfgtoollogs/opatch/opatch2024-05-08_13-30-06PM_1.logInvoking utility "cleanup"
OPatch will clean up 'restore.sh,make.txt' files and 'scratch,backup' directories.
You will be still able to rollback patches after this cleanup.
Do you want to proceed? [y|n]
y
User Responded with: YBackup area for restore has been cleaned up. For a complete list of files/directories
deleted, Please refer log file.OPatch succeeded.
[oracle@19ctest ~]$ 

一些log 

[May 8, 2024 1:30:11 PM] [INFO]     [OPSR-MEMORY] Loaded all one offs from inventory. Heap memory in use: 29 (MB)
[May 8, 2024 1:30:11 PM] [INFO]     [OPSR-TIME] Raw inventory loaded successfully
[May 8, 2024 1:30:11 PM] [INFO]     Invoking utility "cleanup"
[May 8, 2024 1:30:11 PM] [INFO]     [OPSR-TIME] Cleaning up backup
[May 8, 2024 1:30:11 PM] [INFO]     OPatch will clean up 'restore.sh,make.txt' files and 'scratch,backup' directories.You will be still able to rollback patches after this cleanup.Do you want to proceed? [y|n]

-- 执行完毕后,貌似没有变化,可能和自己环境有关(19年开始测试补丁,基本上每个季度都测试,后面把又把数据库用RMAN做了迁移,又转换成了PDB模式)。

[oracle@19ctest ~]$ df -h
Filesystem                   Size  Used Avail Use% Mounted on
devtmpfs                     4.3G     0  4.3G   0% /dev
tmpfs                        4.4G     0  4.4G   0% /dev/shm
tmpfs                        4.4G  8.8M  4.4G   1% /run
tmpfs                        4.4G     0  4.4G   0% /sys/fs/cgroup
/dev/mapper/ol_19cdg01-root   17G  4.1G   13G  24% /
/dev/sdc1                    120G   74G   47G  62% /oradata
/dev/sdd1                    120G   60G   61G  50% /arch
/dev/sda1                   1014M  169M  846M  17% /boot
/dev/sde1                    100G   24G   76G  24% /mysql
/dev/sdf1                    120G   47G   74G  39% /oradatapdb
/dev/sdb1                     40G   24G   17G  59% /u01
tmpfs                        883M     0  883M   0% /run/user/0
[oracle@19ctest ~]$ 

-- 也可能和log中的以下有关 

[oracle@19ctest db_1]$ tail -f /u01/app/oracle/product/19.0.0/db_1/cfgtoollogs/opatch/opatch2024-05-08_13-30-06PM_1.log
[May 8, 2024 1:30:59 PM] [INFO]     Cannot delete as either pathToBeDeleted is empty or it does not contain .patch_storage :
[May 8, 2024 1:30:59 PM] [INFO]     Cannot delete as either pathToBeDeleted is empty or it does not contain .patch_storage :
[May 8, 2024 1:30:59 PM] [INFO]     Cannot delete as either pathToBeDeleted is empty or it does not contain .patch_storage :
[May 8, 2024 1:30:59 PM] [INFO]     Cannot delete as either pathToBeDeleted is empty or it does not contain .patch_storage :
[May 8, 2024 1:30:59 PM] [INFO]     Cannot delete as either pathToBeDeleted is empty or it does not contain .patch_storage :
[May 8, 2024 1:30:59 PM] [INFO]     Cannot delete as either pathToBeDeleted is empty or it does not contain .patch_storage :
[May 8, 2024 1:30:59 PM] [INFO]     Cannot delete as either pathToBeDeleted is empty or it does not contain .patch_storage :
[May 8, 2024 1:30:59 PM] [INFO]     Cannot delete as either pathToBeDeleted is empty or it does not contain .patch_storage :
[May 8, 2024 1:30:59 PM] [INFO]     [OPSR-TIME] Loading cooked inventory

-- 查看到的补丁

SYS@cdbtest SQL> select comments from dba_registry_history;COMMENTS
--------------------------------------------------------------------------------
RDBMS_19.23.0.0.0DBRU_LINUX.X64_240405
Patch applied from 19.3.0.0.0 to 19.21.0.0.0: Release_Update - 230930151951
Patch applied from 19.21.0.0.0 to 19.22.0.0.0: Release_Update - 240104023954
Patch applied from 19.22.0.0.0 to 19.23.0.0.0: Release_Update - 240406004238SYS@cdbtest SQL> alter session set container =test;Session altered.SYS@cdbtest SQL> select comments from dba_registry_history;COMMENTS
--------------------------------------------------------------------------------
RDBMS_19.23.0.0.0DBRU_LINUX.X64_240405
Patch applied on 19.3.0.0.0: Release_Update - 190410122720
Patch applied from 19.3.0.0.0 to 19.5.0.0.0: Release_Update - 190909180549
Patch applied from 19.5.0.0.0 to 19.11.2.0.0: Release_Update_Revision - 21100717
1159RAN jvmpsu.sql
OJVM RU post-install
Patch rolled back from 19.11.2.0.0 to 19.11.0.0.0: Release_Update - 210413004009
Patch applied from 19.11.0.0.0 to 19.14.0.0.0: Release_Update - 211225122123
Patch applied from 19.14.0.0.0 to 19.15.0.0.0: Release_Update - 220331125408COMMENTS
--------------------------------------------------------------------------------
Patch applied from 19.15.0.0.0 to 19.17.0.0.0: Release_Update - 220924224051
Patch applied from 19.17.0.0.0 to 19.18.0.0.0: Release_Update - 230111171738
Patch applied on 19.18.0.0.0: Release_Update - 230111171738
Patch applied on 19.18.0.0.0: Release_Update - 230111171738
Patch applied from 19.18.0.0.0 to 19.19.0.0.0: Release_Update - 230322020406
Patch applied from 19.19.0.0.0 to 19.20.0.0.0: Release_Update - 230715022800
Patch applied from 19.20.0.0.0 to 19.21.0.0.0: Release_Update - 230930151951
Patch applied on 19.21.0.0.0: Release_Update - 230930151951
Patch applied on 19.21.0.0.0: Release_Update - 230930151951
Patch applied on 19.21.0.0.0: Release_Update - 230930151951
Patch applied on 19.21.0.0.0: Release_Update - 230930151951COMMENTS
--------------------------------------------------------------------------------
Patch applied on 19.21.0.0.0: Release_Update - 230930151951
Patch applied on 19.21.0.0.0: Release_Update - 230930151951
Patch applied on 19.21.0.0.0: Release_Update - 230930151951
OJVM RU post-deinstall
Patch applied on 19.21.0.0.0: Release_Update - 230930151951
Patch applied from 19.21.0.0.0 to 19.22.0.0.0: Release_Update - 240104023954
Patch applied from 19.22.0.0.0 to 19.23.0.0.0: Release_Update - 24040600423827 rows selected.SYS@cdbtest SQL> 

-- 也可以手工清除,官网上对于手工清除,是这样说明的 

Additionally, further cleanup of the $ORACLE_HOME/.patch_storage is possible if there are directories from patches applied to previous versions. This can be done manually as follows:

1.  run command:

$ opatch lsinventory

2.  Remove all the sub-directories from $ORACLE_HOME/.patch_storage that are not present in the list of installed patches. Directory names would be prefaced with the patchid for example:

13343438_<timestamp>

example to find sub-directories : $ opatch lsinventory | grep -E "(^Patch.*applied)|(^Sub-patch)"

Note: List of patches include the sub patches of install Bundle patches, PSU, GI PSU.  Hence you should NOT remove the sub patch folders.

[oracle@19ctest ~]$ opatch lsinventory | grep -E "(^Patch.*applied)|(^Sub-patch)"
Patch  36233263     : applied on Fri Apr 19 08:54:31 CST 2024
Patch  29585399     : applied on Thu Apr 18 15:21:33 CST 2019
[oracle@19ctest ~]$ 

-- 手工清理掉

rm -rf  29517242_Apr_17_2019_23_27_10
rm -rf  35042068_Apr_6_2023_15_25_04
rm -rf  35320081_Jul_15_2023_12_54_11
rm -rf  35643107_Oct_3_2023_13_34_29
rm -rf  35943157_Jan_13_2024_05_42_55

--清理后空间,剩余25G 

[oracle@19ctest .patch_storage]$ df -h
Filesystem                   Size  Used Avail Use% Mounted on
devtmpfs                     4.3G     0  4.3G   0% /dev
tmpfs                        4.4G     0  4.4G   0% /dev/shm
tmpfs                        4.4G  8.8M  4.4G   1% /run
tmpfs                        4.4G     0  4.4G   0% /sys/fs/cgroup
/dev/mapper/ol_19cdg01-root   17G  4.1G   13G  24% /
/dev/sdc1                    120G   74G   47G  62% /oradata
/dev/sdd1                    120G   60G   61G  50% /arch
/dev/sda1                   1014M  169M  846M  17% /boot
/dev/sde1                    100G   24G   76G  24% /mysql
/dev/sdf1                    120G   47G   74G  39% /oradatapdb
/dev/sdb1                     40G   16G   25G  39% /u01
tmpfs                        883M     0  883M   0% /run/user/0
[oracle@19ctest .patch_storage]$ 

END

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/pingmian/8707.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

【Redis7】10大数据类型之Hash类型

文章目录 1.Hash类型2.常用命令3.示例hset和hgethgetallhlenhkeys和hvalshexistshdelhincrby和hincrbyfloathsetnx 1.Hash类型 Redis中的Hash类型是一种高效的数据结构&#xff0c;用于存储键值对的集合。这种类型特别适用于表示对象&#xff0c;因为它允许你将对象的多个属性…

Context capture/Pix4Dmapper/AutoCAD/CASS/EPS软件的安装流程与使用方法;土方量计算;无人机摄影测量数据处理

目录 专题一 无人机摄影测量技术应用现状及其发展 专题二 基本原理和关键技术讲解 专题三 无人机影像外业数据获取 专题四 数据处理环境建立与软件熟悉 专题五 GNSS数据土方量计算 专题六 基于无人机影像数据的正射影像制作 专题七 基于无人机影像数据的三维模型制作 专…

gocator导出图片

想用3D扫描后的图片&#xff0c;但是系统自带的导出方法很麻烦&#xff0c;所以考虑通过sdk导出 首先需要设置点云亮度 这里是导出图片的关键代码 case GoDataMessageType.SurfaceIntensity: { Debug.WriteLine("SurfaceIntensity "); GoSu…

线段树专题

落谷1607 #include<bits/stdc.h> using namespace std;#define ls u<<1 #define rs u<<1|1const int N 1e5;int n, k, c, ans; struct line {int l, r, m; // m为候车的牛的数量bool operator<(line b) {return r < b.r;} }s[N];struct tree {int l, …

antV X6的简要使用教程

&#x1f9d1;‍&#x1f393; 个人主页&#xff1a;《爱蹦跶的大A阿》 &#x1f525;当前正在更新专栏&#xff1a;《VUE》 、《JavaScript保姆级教程》、《krpano》、《krpano中文文档》 ​ ​ ✨ 前言 在我们的日常开发工作中&#xff0c;我们经常需要构建复杂的交互式图…

【MM32F3270火龙果】点亮led

文章目录 前言GPIO的工作模式一、有哪些工作模式&#xff1f;1.1 GPIO的详细介绍1.2 GPIO的内部框图输入模式输出部分 二、操作GPIO点亮led2.1 初始化gpio2.2 写gpio 三、示例代码总结 前言 本文将介绍如何在MM32F3270火龙果微控制器上使用Keil开发环境点亮LED。MM32F3270火龙…

Java中使用FlatBuffers实现序列化

Java 中的 FlatBuffers有助于高速数据序列化/反序列化&#xff0c;消除解析开销。它由 Google 开发&#xff0c;为跨平台数据交换提供无模式、内存高效的解决方案。 Java 开发人员可以利用其直接内存访问来实现最佳性能和最小内存占用&#xff0c;从而提高应用程序速度、可扩展…

Kamailio openssl 3.0.x 需要注意的事项

我们留意到 Debian Bookworm 安装的 openssl 版本是 3.0.x 这里有几个地方要注意&#xff1a; modparam("tls", "init_mode", 1)核心参数 tls_threads_mode 配置为 1 或者 配置为 2版本建议用 v 5.8.1 参考链接&#xff1a; #3832#3765#3791 目前官方…

北交所佣金费率标准是多少?北交所相关信息科普

北交所的佣金费率并非固定不变&#xff0c;而是可以根据投资者的需求和证券公司的政策进行调整。目前北交所的佣金费率最低是万分之二。 一般来说&#xff0c;北交所的佣金费率默认在万分之三左右&#xff0c;但这不是固定的费率。根据证券公司的不同&#xff0c;佣金费率可以…

绝地求生:PCL第五轮数据出炉,XDD与林树入选最佳阵容,韦神真在做事了

距离PCL季后赛开赛还有两天时间&#xff0c;小梦还沉浸在常规赛最后一场WCG和TSG争名额的关键之战&#xff0c;现在看来WCG硬贴PeRo房区那波真是没道理&#xff0c;只能解释为太想拿分导致上头了&#xff0c;导致决赛圈没有余力限制TSG&#xff0c;但这何尝不是TSG自己的剧本&a…

算法训练Day52 | ● 84.柱状图中最大的矩形

84.柱状图中最大的矩形 class Solution { public:int largestRectangleArea(vector<int>& heights) {stack<int> s;s.push(-1);s.push(0);int space 0;for(int i1; i<heights.size(); i){while(s.top()! -1 && (iheights.size() || heights[i]<…

SAF文件选择与真实路径转换

一、构建选择文件与回调方法 //文件选择回调ActivityResultLauncher<String[]> pickFile registerForActivityResult(new ActivityResultContracts.OpenDocument(), uri->{if (uri ! null) {Log.e("cxy", "返回的uri:" uri);Log.e("cxy&q…

【JavaEE初阶系列】——利用Servlet API实现表白墙网站(1.6w字深刻了解前后端交互逻辑)

目录 &#x1f393;准备工作 &#x1f393;了解前端部分知识(主要JS&#xff09; &#x1f393;前后端交互部分 &#x1f388;主要思路 &#x1f6a9;提交信息 &#x1f36d;让前端发起一个ajax请求 &#x1f36d;服务器读取上述请求&#xff0c;并计算出响应 &#x1…

【Stylus详解与引入】

文章目录 Stylus详解与引入一、Stylus简介二、Stylus的特性1. 变量2. 嵌套规则3. 混合&#xff08;Mixins&#xff09;4. 函数5. 条件语句和循环 三、Stylus的引入与配置1. 安装Stylus和stylus-loader2. 配置Webpack3. 在Vue项目中使用Stylus4. 编译Stylus代码四、Stylus的性能…

Gateway的基本配置

Gateway的基本配置通常涉及网络、路由、安全性以及其他一些关键元素。以下是一个关于Gateway基本配置的详细指南&#xff1a; 网络连接配置&#xff1a; 设备连接&#xff1a;确保网关设备与内部网络的交换机、集线器或服务器/计算机正确连接。网络拓扑结构应支持内外通信。IP地…

2024-05-08 问AI: 在深度学习中,介绍一下RMSProp 优化器

文心一言 在深度学习中&#xff0c;RMSProp&#xff08;Root Mean Square Propagation&#xff09;优化器是一种常用的优化算法&#xff0c;主要用于神经网络训练的梯度下降算法的变体。它是对Adagrad优化器的一种改进&#xff0c;旨在解决Adagrad中学习率过快下降的问题。 R…

设计模式有哪些基本原则

目录 开闭原则(Open Closed Principle) 里氏替换原则(Liskov Substitution principle) 单一职责原则(Single Responsibility Principle,SRP)

RAC GCS_SERVER_PROCESSES参数

参考文档&#xff1a; GCS_SERVER_PROCESSES (oracle.com) 在awr报告中&#xff0c;看到addm建议如下&#xff1a; 其中有Global Cache Messaging和 Global Cache Congestion Activity During the Analysis Period ----------------------------------- Total database tim…

Linux的编译器

程序编译的过程 程序的编译过程是将源代码转换为可执行文件的一系列步骤。这个过程涉及多个阶段&#xff0c;主要包括预处理、编译、汇编和链接。下面详细介绍每个阶段&#xff1a; 1. 预处理&#xff08;Preprocessing&#xff09; 在实际编译之前&#xff0c;源代码文件首…

Android bootchart 分析启动性能工具使用

bootchart简介 bootchart 可为整个系统提供所有进程的 CPU 和 I/O 负载细分。该工具不需要重建系统映像&#xff0c;可以用作进入 systrace 之前的快速健全性检查。 1. 板端配置&#xff1a; 在Android 板端启用 bootchart&#xff0c;请运行以下命令&#xff1a; 2. Bootch…