ORACLE 12C ADG 安装最新RU补丁
admin
2023-04-14 14:02:03
0次

参考文档:How do you apply a Patchset,PSU or CPU in a Data Guard Physical Standby configuration (文档 ID 278641.1)


------------------------------------------------------------------------------------------------------

1. Disable REDO transport on Primary.

------------------------------------------------------------------------------------------------------

sys@ora12c.primary> alter system set log_archive_dest_state_2=defer;


------------------------------------------------------------------------------------------------------

2. Shutdown the standby site and apply interim patchsets to the RDBMS binaries as per the README.

------------------------------------------------------------------------------------------------------


2.1 停数据库监听和实例

[oracle@oradb2 ~]$ lsnrctl stop

sys@ora12cdg.primary_instance> shudown immediate;


2.2 更新OPatch到最新版本 [You must use the OPatch utility version 12.2.0.1.14 or later to apply this patch.]

[oracle@oradb2 ~]$ mv $ORACLE_HOME/OPatch $ORACLE_HOME/OPatch.20190426

[oracle@oradb2 ~]$ mv /oradata/OPatch $ORACLE_HOME

[oracle@oradb2 ~]$ $ORACLE_HOME/OPatch/opatch version


2.3 执行补丁冲突检查

[oracle@oradb2 ~]$ cd /oradata/patch/29314339/

[oracle@oradb2 29314339]$ $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -ph ./


2.4 应用12.2最新 Release Update 29314339

[oracle@oradb2 ~]$ cd /oradata/patch/29314339/

[oracle@oradb2 29314339]$ $ORACLE_HOME/OPatch/opatch apply

Oracle Interim Patch Installer version 12.2.0.1.17

Copyright (c) 2019, Oracle Corporation.  All rights reserved.


2.5 检查补丁信息

[oracle@oradb2 29314339]$ $ORACLE_HOME/OPatch/opatch lspatches

29314339;Database Apr 2019 Release Update : 12.2.0.1.190416 (29314339)

28163190;OCW JUL 2018 RELEASE UPDATE 12.2.0.1.180717 (28163190)


------------------------------------------------------------------------------------------------------

3. Start the standby site to mount only, do not restart managed recovery.

------------------------------------------------------------------------------------------------------


[oracle@oradb2 29314339]$ lsnrctl start

[oracle@oradb2 29314339]$ export ORACLE_SID=ora12cdg

idle> startup mount;


------------------------------------------------------------------------------------------------------

4. Shutdown the primary site, apply the Patchset/PSU/CPU patch to the RDBMS binaries and patch the RDBMS itself using the instructions in the README

------------------------------------------------------------------------------------------------------


4.1 停监听和主库

[oracle@oradb1 ~]$ lsnrctl stop

sys@ora12c.primary> shutdown immediate;


4.2 更新OPatch到最新版本

[oracle@oradb1 ~]$ mv $ORACLE_HOME/OPatch $ORACLE_HOME/OPatch.20190426

[oracle@oradb1 ~]$ mv /oradata/OPatch $ORACLE_HOME

[oracle@oradb1 ~]$ $ORACLE_HOME/OPatch/opatch version


4.3 执行补丁冲突检查

[oracle@oradb1 ~]$ cd /oradata/patch/29314339/

[oracle@oradb1 29314339]$ $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -ph ./


4.4 应用12.2最新 Release Update 29314339

[oracle@oradb1 29314339]$ $ORACLE_HOME/OPatch/opatch apply

Oracle Interim Patch Installer version 12.2.0.1.17

Copyright (c) 2019, Oracle Corporation.  All rights reserved.


4.5 检查补丁信息

[oracle@oradb1 29314339]$ $ORACLE_HOME/OPatch/opatch lspatches

29314339;Database Apr 2019 Release Update : 12.2.0.1.190416 (29314339)

28163190;OCW JUL 2018 RELEASE UPDATE 12.2.0.1.180717 (28163190)


4.6 应用数据库补丁

[oracle@oradb1 29314339]$ sqlplus /nolog

idle> conn / as sysdba

idle> startup;

idle> show pdbs;


--如果pdb状态不是READ WRITE,打开pdb

idle> alter pluggable database all open;

idle> exit;


[oracle@oradb1 29314339]$ cd $ORACLE_HOME/OPatch

[oracle@oradb1 OPatch]$ ./datapatch -verbose


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)


SQL Patching tool complete on Fri Apr 26 13:55:24 2019


4.7 检查补丁应用日志

[oracle@oradb1 OPatch]$ cd $ORACLE_BASE/cfgtoollogs/sqlpatch/29314339/


Check the following log files in $ORACLE_BASE/cfgtoollogs/sqlpatch/29314339/ for errors:

29314339_apply___.log


4.8 编译无效对象

[oracle@oradb1 29314339]$ cd $ORACLE_HOME/rdbms/admin


[oracle@oradb1 admin]$ sqlplus /nolog

idle> conn / as sysdba

sys@ora12c.primary> set linesize 160;

sys@ora12c.primary> col owner for a15;

sys@ora12c.primary> select owner, count(1) from dba_objects where status = 'INVALID' group by owner;


sys@ora12c.primary> @utlrp.sql


sys@ora12c.primary> select owner, count(1) from dba_objects where status = 'INVALID' group by owner;


------------------------------------------------------------------------------------------------------

5. Start the primary site, re-enable log shipping to the standby.

------------------------------------------------------------------------------------------------------


sys@ora12c.primary> alter system set log_archive_dest_state_2=enable;


------------------------------------------------------------------------------------------------------

6. At the standby site start the MRP(managed recovery).

------------------------------------------------------------------------------------------------------


sys@ora12cdg.physical_standby> alter database open;

sys@ora12cdg.physical_standby> alter database recover managed standby database disconnect from session;


------------------------------------------------------------------------------------------------------

7. 主备切换

------------------------------------------------------------------------------------------------------

sys@ora12c.primary> alter database switchover to ora12cdg verify;


sys@ora12c.primary> alter database switchover to ora12cdg;


相关内容

热门资讯

空调连续工作多久需要停机休息 空调连续工作的时间取决于多个因素,包括空调的型号、功率、使用环境和维护情况等。一般来说,空调可以连续...
空调哪个符号是除湿的 空调除湿功能通常用一个水滴形状的符号表示。不同品牌和型号的空调遥控器可能会有所差异,但一般来说,除湿...
格力空调多长时间加一次氟利昂 1、一般情况下,空调对氟利昂的使用量是非常小的,所以在空调使用了四年左右的时候再考虑加也没问题。2、...
空调用多长时间需要加氟一次 一般情况下是五年。当出现以下这几种情况时,空调才需要加氟。1、空调的室内机和室外机各有两个接口,当接...
格调生活·C标思享荟:卡萨帝在... 9月12日的郑州龙湖金融岛,夜风轻拂,灯光璀璨。“C标时刻共传奇——卡萨帝思享荟暨20周年品牌盛典郑...
品牌价值破千亿、高端份额持续领... 9月12日,“C标时刻共传奇——卡萨帝思享荟暨20周年品牌盛典郑州站”在郑州龙湖金融岛举办。2026...
空调主板坏了修800还是换新的 空调主板坏了是修还是换新,需要考虑多个因素,以下是一些建议:1. 维修成本:如果维修费用较低,比如 ...
空调开多久需要休息多长时间 问题:空调开多久需要休息多长时间回答:1、在使用空调的过程中,一般空调开7~8个小时左右需要休息2~...
中央空调多长时间清洗一次 1、一般空调开机前清洗一次即可,空调开机中间时段再清洗一次,空调关机时清洗一次,这样比较合理。2、空...
中央空调氟利昂多久加一次 看空调制热和制冷程度,很多人的观点认为氟利昂必须一年放一次,其实这个观点是错误的,理解上面有点偏差,...