1、 下载最新的12.1.0.1的DB PSU 与 OPatch
p23054354_121010_Linux-x86-64.zip
p6880880_121010_Linux-x86-64.zip

2. 检查数据库当前OPatch版本
[oracle@host-172-16-3-132 ~]$ $ORACLE_HOME/OPatch/opatch version
OPatch Version: 12.1.0.1.0
OPatch succeeded.

3. 更新OPatch
[oracle@host-172-16-3-132 ~]$ echo $ORACLE_HOME
/u01/app/oracle/product/12.1.0/dbhome_1

-- root用户执行,/u01/app/oracle/product/12.1.0/dbhome_1/为oracle用户下的$ORACLE_HOME路径
[root@host-172-16-3-132 ~]# mv /u01/app/oracle/product/12.1.0/dbhome_1/OPatch /u01/app/oracle/product/12.1.0/dbhome_1/OPatch_bak
[root@host-172-16-3-132 u01]# ll p6880880_121010_Linux-x86-64.zip
-rw-r--r-- 1 oracle oinstall 80276058 Sep 12 18:16 p6880880_121010_Linux-x86-64.zi
[root@host-172-16-3-132 u01]# unzip p6880880_121010_Linux-x86-64.zip -d /u01/app/oracle/product/12.1.0/dbhome_1/
[root@host-172-16-3-132 u01]# chown -R oracle:oinstall /u01/app/oracle/product/12.1.0/dbhome_1/OPatch

4、 检查OPatch
[oracle@host-172-16-3-132 u01]$ $ORACLE_HOME/OPatch/opatch version
OPatch Version: 12.2.0.1.9
OPatch succeeded.

5. 解压补丁文件
[root@host-172-16-3-132 u01]# unzip p23054354_121010_Linux-x86-64.zip -d /u01/db_psu/
[root@host-172-16-3-132 u01]# chown -R oracle:oinstall /u01/db_psu/

6. 检查补丁之间有无冲突
[root@host-172-16-3-132 u01]# cd db_psu/
[root@host-172-16-3-132 db_psu]# ls
23054354 PatchSearch.xml
[root@host-172-16-3-132 db_psu]# cd 23054354/
[root@host-172-16-3-132 23054354]# ls
19769486 20831107 21951844 23054354 README.txt
20299016 21352619 22291141 README.html

[oracle@host-172-16-3-132 23054354]$ $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /u01/db_psu/23054354 -oh $ORACLE_HOME

Oracle Interim Patch Installer version 12.2.0.1.9
Copyright (c) 2017, Oracle Corporation. All rights reserved.
PREREQ session
Oracle Home : /u01/app/oracle/product/12.1.0/dbhome_1
Central Inventory : /u01/app/oraInventory
from : /u01/app/oracle/product/12.1.0/dbhome_1/oraInst.loc
OPatch version : 12.2.0.1.9
OUI version : 12.1.0.1.0
Log file location : /u01/app/oracle/product/12.1.0/dbhome_1/cfgtoollogs/opatch/opatch2017-09-13_10-14-32AM_1.log
Invoking prereq "checkconflictagainstohwithdetail"
Prereq "checkConflictAgainstOHWithDetail" passed.
OPatch succeeded.

7. 为数据库做冷备份 (如果不考虑安全性,这步可以省略,有点点风险)

使用root用户备份oracle_home (将#ORACLE_HOME上级目录整个备份)
tar -zcvpf db_20170913.tar.gz dbhome_1/

8. 关闭实例和监听 (注意静态监听与oem)
[oracle@host-172-16-3-132 23054354]$ lsnrctl stop
[oracle@host-172-16-3-132 23054354]$ lsnrctl status
[root]#ps -ef|grep -v grep |grep LOCAL=NO|awk '{print $2}'|xargs kill -9
[oracle@host-172-16-3-132 23054354]$ sqlplus / as sysdba
SQL> shutdown immediate;
[oracle]$ netstat -an |grep 1158

9、 手动更新补丁

[oracle@host-172-16-3-132 23054354]$ $ORACLE_HOME/OPatch/opatch apply
Oracle Interim Patch Installer version 12.2.0.1.9
Copyright (c) 2017, Oracle Corporation. All rights reserved.

Oracle Home : /u01/app/oracle/product/12.1.0/dbhome_1
Central Inventory : /u01/app/oraInventory
from : /u01/app/oracle/product/12.1.0/dbhome_1/oraInst.loc
OPatch version : 12.2.0.1.9
OUI version : 12.1.0.1.0
Log file location : /u01/app/oracle/product/12.1.0/dbhome_1/cfgtoollogs/opatch/opatch2017-09-13_12-21-10PM_1.log

Verifying environment and performing prerequisite checks...
OPatch continues with these patches: 19769486 20299016 20831107 21352619 21951844 22291141 23054354

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

Is the local system ready for patching? [y|n]
y
User Responded with: Y
Backing up files...
Applying sub-patch '19769486' to OH '/u01/app/oracle/product/12.1.0/dbhome_1'
ApplySession: Optional component(s) [ oracle.network.cman, 12.1.0.1.0 ] not present in the Oracle Home or a higher version is found.

Composite patch 23054354 successfully applied.
Log file location: /u01/app/oracle/product/12.1.0/dbhome_1/cfgtoollogs/opatch/opatch2017-09-13_12-21-10PM_1.log
OPatch succeeded.

SQL> startup;
ORACLE instance started.

Total System Global Area 2371719168 bytes
Fixed Size 2853264 bytes
Variable Size 654313072 bytes
Database Buffers 1694498816 bytes
Redo Buffers 20054016 bytes
Database mounted.
Database opened.
SQL> alter pluggable database all open;

Pluggable database altered.

10、 将补丁注册到数据字典中:

注意:12C的补丁注册改成了用datapatch工具,而不是以前版本的 @$ORACLE_HOME/rdbms/admin/catbundle.sql psu apply
[oracle@host-172-16-3-132 OPatch]$ cd $ORACLE_HOME/OPatch
[oracle@host-172-16-3-132 OPatch]$ ./datapatch -verbose
Connecting to database...OK
Determining current state...
Currently installed SQL Patches:
PDB CDB$ROOT:
PDB PDB$SEED:
PDB PDB01:
.....
logfile: /u01/app/oracle/product/12.1.0/dbhome_1/sqlpatch/23054354/23054354_apply_ANDYCDB_PDB01_2017Sep14_04_41_10.log (no errors)
catbundle generate logfile: /u01/app/oracle/cfgtoollogs/catbundle/catbundle_PSU_ANDYCDB_PDB01_GENERATE_2017Sep14_04_41_11.log (no errors)
catbundle apply logfile: /u01/app/oracle/cfgtoollogs/catbundle/catbundle_PSU_ANDYCDB_PDB01_APPLY_2017Sep14_04_41_13.log (no errors)
SQL Patching tool complete on Thu Sep 14 04:41:53 2017

11、 验证是否打补丁成功
col ACTION_TIME for a30;
col COMMENTS for a20;
col BUNDLE_SERIES for a10;
select ACTION_TIME,BUNDLE_SERIES,COMMENTS from dba_registry_history;

ACTION_TIME BUNDLE_SER COMMENTS
------------------------------ ---------- --------------------
14-SEP-17 03.46.47.445096 AM PSU Patchset 12.1.0.0.0
14-SEP-17 04.28.21.213333 AM PSU PSU 12.1.0.1.160719
14-SEP-17 04.28.32.004194 AM PSU PSU 12.1.0.1.160719
14-SEP-17 04.28.42.435304 AM PSU PSU 12.1.0.1.160719
14-SEP-17 04.28.53.797447 AM PSU PSU 12.1.0.1.160719
14-SEP-17 04.29.03.854827 AM PSU PSU 12.1.0.1.160719
14-SEP-17 04.29.14.465123 AM PSU PSU 12.1.0.1.160719
14-SEP-17 04.29.25.696294 AM PSU PSU 12.1.0.1.160719
8 rows selected

[oracle@12 OPatch]$ $ORACLE_HOME/OPatch/opatch lsinventory
Patch 23054354 : applied on Thu Sep 14 04:12:25 CST 2017
Unique Patch ID: 20238050

SQL> select count(*) from dba_objects where status<>'VALID';

COUNT(*)
----------
0

oracle12c之 单机12.1.0.1打补丁的更多相关文章

  1. 图形化升级单机oracle 11.2.0.4 到 12.2.0.1

    1. 讲补丁包上传到 Oracle server ,解压.安装 [oracle@11g tmp]$ unzip linuxx64_12201_database.zip 2. 检查当前版本 SQL> ...

  2. docker- 构建 oracle2c-r2(12.2.0.1) 的镜像

    需求 由于公司要数据库需要使用新的oracle版本(12c-r2 ->12.2.0.1),需要从之前的oracle11g迁移到12c.所以,我们今天就先来介绍一下如何构建oracle12c的镜像 ...

  3. Oracle 12c(12.1.0.5)OEM server agent 安装配置

    注意: 此文档为生产上操作文档,省略了IP,oracle用户server,agent 端至少需要sudo,ping,ssh,创建目录权限. 一.安装要求 1.1. 系统情况一览 IP 数据库 OEM ...

  4. 使用yum源的方式单机部署MySQL8.0.13

    使用yum源的方式单机部署MySQL8.0.13 作者:尹正杰  版权声明:原创作品,谢绝转载!否则将追究法律责任. 基本上开源的软件都支持三种安装方式,即rmp方式安装,源码安装和二进制方式安装.在 ...

  5. oracle2c-r2(12.2.0.1) 的镜像

    docker- 构建 oracle2c-r2(12.2.0.1) 的镜像   需求 由于公司的数据库需要使用新的oracle版本(12c-r2 -->12.2.0.1),从之前的oracle11 ...

  6. Oracle 12.1.0.2 New Feature翻译学习【In-Memory column store内存列存储】【原创】

    翻译没有追求信达雅,不是为了学英语翻译,是为了快速了解新特性,如有语义理解错误可以指正.欢迎加微信12735770或QQ12735770探讨oracle技术问题:) In-Memory Column ...

  7. DotNetBar for Windows Forms 12.9.0.0_冰河之刃重打包版及制作Visual Studio C#项目模板文件详解

    关于 DotNetBar for Windows Forms 12.9.0.0_冰河之刃重打包版 --------------------11.8.0.8_冰河之刃重打包版-------------- ...

  8. DotNetBar for Windows Forms 12.7.0.10_冰河之刃重打包版原创发布-带官方示例程序版

    关于 DotNetBar for Windows Forms 12.7.0.10_冰河之刃重打包版 --------------------11.8.0.8_冰河之刃重打包版------------- ...

  9. DotNetBar for Windows Forms 12.5.0.2_冰河之刃重打包版原创发布-带官方示例程序版

    关于 DotNetBar for Windows Forms 12.5.0.2_冰河之刃重打包版 --------------------11.8.0.8_冰河之刃重打包版-------------- ...

随机推荐

  1. webpack模块解析

    前面的话 在web存在多种支持JavaScript模块化的工具(如requirejs和r.js),这些工具各有优势和限制.webpack基于从这些系统获得的经验教训,并将模块的概念应用于项目中的任何文 ...

  2. 31. leetcode 122. Best Time to Buy and Sell Stock II

    122. Best Time to Buy and Sell Stock II Say you have an array for which the ith element is the price ...

  3. 16. leetcode 404. Sum of Left Leaves

    Find the sum of all left leaves in a given binary tree. Example:     3    / \   9  20     /  \    15 ...

  4. Spring Boot中使用Swagger2构建API文档

    程序员都很希望别人能写技术文档,自己却很不愿意写文档.因为接口数量繁多,并且充满业务细节,写文档需要花大量的时间去处理格式排版,代码修改后还需要同步修改文档,经常因为项目时间紧等原因导致文档滞后于代码 ...

  5. Selenium+Java显示等待和隐式等待

    描述:用来操作界面上的等待时间,显示等待是等待某一条件满足,条件满足后进行后面的操作:隐式等待是给出一个等待时间,在时间到达之前若满足条件,则立即执行后续操作. public class TestSe ...

  6. C语言程序设计进阶 翁恺 第4周编程练习

    第4周编程练习 查看帮助 返回 第4周编程练习 依照学术诚信条款,我保证此作业是本人独立完成的. 温馨提示: 1.本次作业属于Online Judge题目,提交后由系统即时判分. 2.学生可以在作业 ...

  7. Spyder项目创建,打开与使用

    1.Spyder项目的创建 新建一个Spyder项目需要点击Spyder上方标签栏中的Projects中的New Project 2.Spyder项目的打开 Spyder项目文件夹必须 存在.spyp ...

  8. [NOIP2011] 聪明的质监员 二分+前缀和

    考试的时候打的二分但没有用前缀和维护.但是有个小细节手误打错了结果挂掉了. 绝对值的话可能会想到三分,但是注意到w增大的时候y是减小的,所以单调性很明显,用二分就可以.但注意一个问题,就是二分最后的结 ...

  9. mysql阅读收录

    --mysql阅读收录 -----------------2014/07/02 # 复制相关: 1. 解释基于语句的复制中怎样处理functions,triggers,events和auto_incr ...

  10. Web存储—简易注册登录

    Web Storage是HTML5引入的一个非常重要的功能,可以在客户端本地存储数据,类似HTML4的cookie,但可实现功能要比cookie强大的多,cookie大小被限制在4KB,cookie只 ...