本文整理自网络,侵删。
所需补丁及高版本opatch
image上传后将p6880880_112000_Linux-x86-64.zip
解压覆盖$ORACLE_HOME/OPatch
目录即可
[oracle@localhost OPatch]$ ./opatch version OPatch Version: 11.2.0.3.16 OPatch succeeded.
检查环境是否需要打补丁,opatch版本安装环境可以看mos和readme 查看组件信息
12:40:47 SYS@std> set linesize 500 pagesize 600 12:40:49 SYS@std> col COMP_NAME for a30 12:41:06 SYS@std> select COMP_ID,COMP_NAME,VERSION,STATUS from DBA_REGISTRY; COMP_ID COMP_NAME VERSION STATUS ------------------------------ ------------------------------ ------------------------------ -------------------------------------------- OWB OWB 11.2.0.4.0 VALID APEX Oracle Application Express 3.2.1.00.12 VALID EM Oracle Enterprise Manager 11.2.0.4.0 VALID AMD OLAP Catalog 11.2.0.4.0 VALID SDO Spatial 11.2.0.4.0 VALID ORDIM Oracle Multimedia 11.2.0.4.0 VALID XDB Oracle XML Database 11.2.0.4.0 VALID CONTEXT Oracle Text 11.2.0.4.0 VALID EXF Oracle Expression Filter 11.2.0.4.0 VALID RUL Oracle Rules Manager 11.2.0.4.0 VALID OWM Oracle Workspace Manager 11.2.0.4.0 VALID CATALOG Oracle Database Catalog Views 11.2.0.4.0 VALID CATPROC Oracle Database Packages and T 11.2.0.4.0 VALID ypes JAVAVM JServer JAVA Virtual Machine 11.2.0.4.0 VALID XML Oracle XDK 11.2.0.4.0 VALID CATJAVA Oracle Database Java Packages 11.2.0.4.0 VALID APS OLAP Analytic Workspace 11.2.0.4.0 VALID XOQ Oracle OLAP API 11.2.0.4.0 VALID 18 rows selected. Elapsed: 00:00:00.04
查看补丁情况
12:41:11 SYS@std> col ACTION_TIME for a30 12:46:03 SYS@std> col COMMENTS for a30 12:46:07 SYS@std> select ACTION_TIME, ACTION,version, COMMENTS from sys.DBA_REGISTRY_HISTORY; ACTION_TIME ACTION VERSION COMMENTS ------------------------------ ------------------------------ ------------------------------ ------------------------------ 24-AUG-13 12.03.45.119862 PM APPLY 11.2.0.4 Patchset 11.2.0.2.0 22-MAR-19 12.02.16.970055 PM APPLY 11.2.0.4 Patchset 11.2.0.2.0 Elapsed: 00:00:00.01
查看无效对象
12:46:11 SYS@std> select count(*) from dba_objects where status<>'VALID'; COUNT(*) ---------- 0
测试兼容性,如果之前没打过,这步可以忽略
[oracle@localhost OPatch]$ ./opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /home/oracle/28689165/ -oh $ORACLE_HOME Oracle Interim Patch Installer version 11.2.0.3.16 Copyright (c) 2019, Oracle Corporation. All rights reserved. PREREQ session Oracle Home : /u01/app/oracle/product/11.2.0/dbhome_1 Central Inventory : /u01/app/oraInventory from : /u01/app/oracle/product/11.2.0/dbhome_1/oraInst.loc OPatch version : 11.2.0.3.16 OUI version : 11.2.0.4.0 Log file location : /u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch2019-03-22_13-02-45PM_1.log Invoking prereq "checkconflictagainstohwithdetail" Prereq "checkConflictAgainstOHWithDetail" passed. OPatch succeeded.
为数据库做冷备份,因为是学习用的库不是生产库,这步骤省了 停库 停止数据库外部进程
ps -ef|grep -v grep |grep LOCAL=NO|awk '{print $2}'|xargs kill -9
停库
13:11:12 SYS@std> shutdown immediate; Database closed. Database dismounted. ORACLE instance shut down. 13:11:28 SYS@std>
停止监听
[oracle@localhost OPatch]$ lsnrctl stop LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 22-MAR-2019 13:12:51 Copyright (c) 1991, 2013, Oracle. All rights reserved. Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521)) The command completed successfully [oracle@localhost OPatch]$
查看是否停干净
[oracle@localhost OPatch]$ ps -ef |grep ora_|grep -v grep [oracle@localhost OPatch]$ netstat -an |grep 1158 [oracle@localhost OPatch]$ netstat -an|grep 1521 [oracle@localhost OPatch]$
正式打补丁
相关阅读 >>
oracle impdp network_link参数使用介绍
oracle生成不重复票号与lpad,rpad与nextval函数解析
oracle数据库导出和oracle导入数据的二种方法(oracle导入导出数据)
更多相关阅读请进入《oracle》频道 >>

数据库系统概念 第6版
本书主要讲述了数据模型、基于对象的数据库和XML、数据存储和查询、事务管理、体系结构等方面的内容。