使用 -applyRU 升级安装 Oracle19C RAC 到19.17,导致数据库 OCW 未升级成功。主从数据库配置 ogg 后,抽取数据,主库就宕机。
个人为人这是 19.17 的psu 的bug , 数据库的psu 中缺少35320149 这个补丁。
step 1.解压 p34416665_190000_Linux-x86-64.zip
[oracle@cdrbak 34416665]$ ll
总用量 136
drwxr-x--- 4 oracle oinstall 48 10月 17 2022 33575402
drwxr-x--- 5 oracle oinstall 81 10月 17 2022 34419443
drwxr-x--- 5 oracle oinstall 62 10月 17 2022 34428761
drwxr-x--- 5 oracle oinstall 62 10月 17 2022 34444834
drwxr-x--- 4 oracle oinstall 48 10月 17 2022 34580338
drwxr-x--- 2 oracle oinstall 4096 10月 17 2022 automation
-rw-rw-r-- 1 oracle oinstall 5824 10月 17 2022 bundle.xml
-rw-r--r-- 1 oracle oinstall 126234 10月 18 2022 README.html
-rw-r--r-- 1 oracle oinstall 0 10月 17 2022 README.txt
[oracle@cdrbak 34416665]$
step 2.安装 PSU
[oracle@cdrbak 34416665]$ cd 34419443/
[oracle@cdrbak 34419443]$ ll
总用量 84
drwxr-x--- 3 oracle oinstall 21 10月 17 2022 custom
drwxr-x--- 3 oracle oinstall 20 10月 17 2022 etc
drwxr-x--- 39 oracle oinstall 4096 10月 17 2022 files
-rw-r--r-- 1 oracle oinstall 77441 10月 17 2022 README.html
-rw-r--r-- 1 oracle oinstall 21 10月 17 2022 README.txt
[oracle@cdrbak 34419443]$ /u01/app/oracle/product/19.3.0/db_1/OPatch/opatch apply
Oracle 临时补丁程序安装程序版本 12.2.0.1.32
版权所有 (c) 2023, Oracle Corporation。保留所有权利。
Oracle 主目录 :/u01/app/oracle/product/19.3.0/db_1
主产品清单:/u01/app/oraInventory
来自 :/u01/app/oracle/product/19.3.0/db_1/oraInst.loc
OPatch 版本 :12.2.0.1.32
OUI 版本 :12.2.0.7.0
日志文件位置:/u01/app/oracle/product/19.3.0/db_1/cfgtoollogs/opatch/opatch2023-12-19_23-07-14下午_1.log
Verifying environment and performing prerequisite checks...
OPatch continues with these patches: 34419443
是否继续? [y|n]
y
User Responded with: Y
All checks passed.
请关闭本地系统上在此 ORACLE_HOME 之外运行的 Oracle 实例。
(Oracle 主目录 = '/u01/app/oracle/product/19.3.0/db_1')
本地系统是否已准备打补丁? [y|n]
y
User Responded with: Y
Backing up files...
正在将临时补丁程序 '34419443' 应用于 OH '/u01/app/oracle/product/19.3.0/db_1'
ApplySession: Oracle 主目录中不存在可选组件 [ oracle.network.gsm, 19.0.0.0.0 ] , [ oracle.rdbms.ic, 19.0.0.0.0 ] , [ oracle.rdbms.tg4db2, 19.0.0.0.0 ] , [ oracle.tfa, 19.0.0.0.0 ] , [ oracle.options.olap.api, 19.0.0.0.0 ] , [ oracle.sdo.companion, 19.0.0.0.0 ] , [ oracle.ons.eons.bwcompat, 19.0.0.0.0 ] , [ oracle.rdbms.tg4msql, 19.0.0.0.0 ] , [ oracle.oid.client, 19.0.0.0.0 ] , [ oracle.ons.cclient, 19.0.0.0.0 ] , [ oracle.rdbms.tg4sybs, 19.0.0.0.0 ] , [ oracle.network.cman, 19.0.0.0.0 ] , [ oracle.net.cman, 19.0.0.0.0 ] , [ oracle.options.olap, 19.0.0.0.0 ] , [ oracle.rdbms.tg4tera, 19.0.0.0.0 ] , [ oracle.rdbms.tg4ifmx, 19.0.0.0.0 ] , [ oracle.xdk.companion, 19.0.0.0.0 ] , [ oracle.jdk, 1.8.0.191.0 ] , 或找到更高版本。
正在为组件 oracle.ordim.jai, 19.0.0.0.0 打补丁...
正在为组件 oracle.bali.jewt, 11.1.1.6.0 打补丁...
正在为组件 oracle.bali.ewt, 11.1.1.6.0 打补丁...
正在为组件 oracle.help.ohj, 11.1.1.7.0 打补丁...
正在为组件 oracle.perlint, 5.28.1.0.0 打补丁...
正在为组件 oracle.rdbms.locator, 19.0.0.0.0 打补丁...
正在为组件 oracle.perlint.expat, 2.0.1.0.4 打补丁...
正在为组件 oracle.rdbms.rsf, 19.0.0.0.0 打补丁...
正在为组件 oracle.rdbms.util, 19.0.0.0.0 打补丁...
正在为组件 oracle.rdbms, 19.0.0.0.0 打补丁...
正在为组件 oracle.assistants.acf, 19.0.0.0.0 打补丁...
正在为组件 oracle.assistants.deconfig, 19.0.0.0.0 打补丁...
正在为组件 oracle.assistants.server, 19.0.0.0.0 打补丁...
正在为组件 oracle.blaslapack, 19.0.0.0.0 打补丁...
正在为组件 oracle.buildtools.rsf, 19.0.0.0.0 打补丁...
正在为组件 oracle.ctx, 19.0.0.0.0 打补丁...
正在为组件 oracle.dbdev, 19.0.0.0.0 打补丁...
正在为组件 oracle.dbjava.ic, 19.0.0.0.0 打补丁...
正在为组件 oracle.dbjava.jdbc, 19.0.0.0.0 打补丁...
正在为组件 oracle.dbjava.ucp, 19.0.0.0.0 打补丁...
正在为组件 oracle.duma, 19.0.0.0.0 打补丁...
正在为组件 oracle.javavm.client, 19.0.0.0.0 打补丁...
正在为组件 oracle.ldap.owm, 19.0.0.0.0 打补丁...
正在为组件 oracle.ldap.rsf, 19.0.0.0.0 打补丁...
正在为组件 oracle.ldap.security.osdt, 19.0.0.0.0 打补丁...
正在为组件 oracle.marvel, 19.0.0.0.0 打补丁...
正在为组件 oracle.network.rsf, 19.0.0.0.0 打补丁...
正在为组件 oracle.odbc.ic, 19.0.0.0.0 打补丁...
正在为组件 oracle.ons, 19.0.0.0.0 打补丁...
正在为组件 oracle.ons.ic, 19.0.0.0.0 打补丁...
正在为组件 oracle.oracore.rsf, 19.0.0.0.0 打补丁...
正在为组件 oracle.precomp.common.core, 19.0.0.0.0 打补丁...
正在为组件 oracle.rdbms.crs, 19.0.0.0.0 打补丁...
正在为组件 oracle.rdbms.dbscripts, 19.0.0.0.0 打补丁...
正在为组件 oracle.rdbms.deconfig, 19.0.0.0.0 打补丁...
正在为组件 oracle.rdbms.oci, 19.0.0.0.0 打补丁...
正在为组件 oracle.rdbms.rsf.ic, 19.0.0.0.0 打补丁...
正在为组件 oracle.rhp.db, 19.0.0.0.0 打补丁...
正在为组件 oracle.sdo, 19.0.0.0.0 打补丁...
正在为组件 oracle.sdo.locator.jrf, 19.0.0.0.0 打补丁...
正在为组件 oracle.sqlplus, 19.0.0.0.0 打补丁...
正在为组件 oracle.sqlplus.ic, 19.0.0.0.0 打补丁...
正在为组件 oracle.wwg.plsql, 19.0.0.0.0 打补丁...
正在为组件 oracle.ldap.ssl, 19.0.0.0.0 打补丁...
正在为组件 oracle.network.client, 19.0.0.0.0 打补丁...
正在为组件 oracle.xdk, 19.0.0.0.0 打补丁...
正在为组件 oracle.ldap.rsf.ic, 19.0.0.0.0 打补丁...
正在为组件 oracle.ldap.client, 19.0.0.0.0 打补丁...
正在为组件 oracle.nlsrtl.rsf, 19.0.0.0.0 打补丁...
正在为组件 oracle.rdbms.install.common, 19.0.0.0.0 打补丁...
正在为组件 oracle.oraolap.dbscripts, 19.0.0.0.0 打补丁...
正在为组件 oracle.oraolap.api, 19.0.0.0.0 打补丁...
正在为组件 oracle.rdbms.scheduler, 19.0.0.0.0 打补丁...
正在为组件 oracle.mgw.common, 19.0.0.0.0 打补丁...
正在为组件 oracle.ctx.rsf, 19.0.0.0.0 打补丁...
正在为组件 oracle.precomp.rsf, 19.0.0.0.0 打补丁...
正在为组件 oracle.ctx.atg, 19.0.0.0.0 打补丁...
正在为组件 oracle.sdo.locator, 19.0.0.0.0 打补丁...
正在为组件 oracle.xdk.xquery, 19.0.0.0.0 打补丁...
正在为组件 oracle.xdk.rsf, 19.0.0.0.0 打补丁...
正在为组件 oracle.xdk.parser.java, 19.0.0.0.0 打补丁...
正在为组件 oracle.install.deinstalltool, 19.0.0.0.0 打补丁...
正在为组件 oracle.javavm.server, 19.0.0.0.0 打补丁...
正在为组件 oracle.rdbms.hs_common, 19.0.0.0.0 打补丁...
正在为组件 oracle.rdbms.drdaas, 19.0.0.0.0 打补丁...
正在为组件 oracle.rdbms.dv, 19.0.0.0.0 打补丁...
正在为组件 oracle.dbtoolslistener, 19.0.0.0.0 打补丁...
正在为组件 oracle.rdbms.rman, 19.0.0.0.0 打补丁...
正在为组件 oracle.rdbms.hsodbc, 19.0.0.0.0 打补丁...
正在为组件 oracle.rdbms.lbac, 19.0.0.0.0 打补丁...
正在为组件 oracle.rdbms.install.plugins, 19.0.0.0.0 打补丁...
正在为组件 oracle.oraolap, 19.0.0.0.0 打补丁...
正在为组件 oracle.network.listener, 19.0.0.0.0 打补丁...
正在为组件 oracle.odbc, 19.0.0.0.0 打补丁...
正在为组件 oracle.ovm, 19.0.0.0.0 打补丁...
正在为组件 oracle.precomp.common, 19.0.0.0.0 打补丁...
正在为组件 oracle.precomp.lang, 19.0.0.0.0 打补丁...
正在为组件 oracle.jdk, 1.8.0.201.0 打补丁...
Patch 34419443 successfully applied.
Sub-set patch [29517242] has become inactive due to the application of a super-set patch [34419443].
Please refer to Doc ID 2161861.1 for any possible further required actions.
Log file location: /u01/app/oracle/product/19.3.0/db_1/cfgtoollogs/opatch/opatch2023-12-19_23-07-14下午_1.log
OPatch succeeded.
[oracle@cdrbak 34419443]$
step 3.Run the Datapatch Utility
安装补丁之后,还需要将有变化的SQL加载到数据库中,这里可以直接运行Datapatch工具将这些修改的SQL重新加载到数据库中,RAC环境,只需要在一个节点执行就可以了。
[oracle@cdrbak pfile]$ cd /u01/app/oracle/product/19.3.0/db_1/OPatch
[oracle@cdrbak OPatch]$ ./datapatch -verbose
SQL Patching tool version 19.17.0.0.0 Production on Tue Dec 19 23:32:14 2023
Copyright (c) 2012, 2022, Oracle. All rights reserved.
Log file for this invocation: /u01/app/oracle/cfgtoollogs/sqlpatch/sqlpatch_2331453_2023_12_19_23_32_14/sqlpatch_invocation.log
Connecting to database...OK
Gathering database info...done
Bootstrapping registry and package to current versions...done
Determining current state...done
Current state of interim SQL patches:
No interim patches found
Current state of release update SQL patches:
Binary registry:
19.17.0.0.0 Release_Update 220924224051: Installed
SQL registry:
Applied 19.3.0.0.0 Release_Update 190410122720 successfully on 27-NOV-23 10.11.45.052148 AM
Adding patches to installation queue and performing prereq checks...done
Installation queue:
No interim patches need to be rolled back
Patch 34419443 (Database Release Update : 19.17.0.0.221018 (34419443)):
Apply from 19.3.0.0.0 Release_Update 190410122720 to 19.17.0.0.0 Release_Update 220924224051
No interim patches need to be applied
Installing patches...
Patch installation complete. Total patches installed: 1
Validating logfiles...done
Patch 34419443 apply: SUCCESS
logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/34419443/24972075/34419443_apply_CDR_2023Dec19_23_32_47.log (no errors)
Automatic recompilation incomplete; run utlrp.sql to revalidate.
SQL Patching tool complete on Tue Dec 19 23:39:43 2023
[oracle@cdrbak OPatch]$
step 4.编译无效对象
[oracle@cdrbak OPatch]$ cd /u01/app/oracle/product/19.3.0/db_1/rdbms/admin/
[oracle@cdrbak admin]$ sqlplus / as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Tue Dec 19 23:41:48 2023
Version 19.17.0.0.0
Copyright (c) 1982, 2022, Oracle. All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.17.0.0.0
SQL> @utlrp.sql
Session altered.
TIMESTAMP
--------------------------------------------------------------------------------
COMP_TIMESTAMP UTLRP_BGN 2023-12-19 23:41:58
DOC> The following PL/SQL block invokes UTL_RECOMP to recompile invalid
DOC> objects in the database. Recompilation time is proportional to the
DOC> number of invalid objects in the database, so this command may take
DOC> a long time to execute on a database with a large number of invalid
DOC> objects.
DOC>
DOC> Use the following queries to track recompilation progress:
DOC>
DOC> 1. Query returning the number of invalid objects remaining. This
DOC> number should decrease with time.
DOC> SELECT COUNT(*) FROM obj$ WHERE status IN (4, 5, 6);
DOC>
DOC> 2. Query returning the number of objects compiled so far. This number
DOC> should increase with time.
DOC> SELECT COUNT(*) FROM UTL_RECOMP_COMPILED;
DOC>
DOC> This script automatically chooses serial or parallel recompilation
DOC> based on the number of CPUs available (parameter cpu_count) multiplied
DOC> by the number of threads per CPU (parameter parallel_threads_per_cpu).
DOC> On RAC, this number is added across all RAC nodes.
DOC>
DOC> UTL_RECOMP uses DBMS_SCHEDULER to create jobs for parallel
DOC> recompilation. Jobs are created without instance affinity so that they
DOC> can migrate across RAC nodes. Use the following queries to verify
DOC> whether UTL_RECOMP jobs are being created and run correctly:
DOC>
DOC> 1. Query showing jobs created by UTL_RECOMP
DOC> SELECT job_name FROM dba_scheduler_jobs
DOC> WHERE job_name like 'UTL_RECOMP_SLAVE_%';
DOC>
DOC> 2. Query showing UTL_RECOMP jobs that are running
DOC> SELECT job_name FROM dba_scheduler_running_jobs
DOC> WHERE job_name like 'UTL_RECOMP_SLAVE_%';
DOC>#
PL/SQL procedure successfully completed.
TIMESTAMP
--------------------------------------------------------------------------------
COMP_TIMESTAMP UTLRP_END 2023-12-19 23:42:06
DOC> The following query reports the number of invalid objects.
DOC>
DOC> If the number is higher than expected, please examine the error
DOC> messages reported with each object (using SHOW ERRORS) to see if they
DOC> point to system misconfiguration or resource constraints that must be
DOC> fixed before attempting to recompile these objects.
DOC>#
OBJECTS WITH ERRORS
-------------------
0
DOC> The following query reports the number of exceptions caught during
DOC> recompilation. If this number is non-zero, please query the error
DOC> messages in the table UTL_RECOMP_ERRORS to see if any of these errors
DOC> are due to misconfiguration or resource constraints that must be
DOC> fixed before objects can compile successfully.
DOC> Note: Typical compilation errors (due to coding errors) are not
DOC> logged into this table: they go into DBA_ERRORS instead.
DOC>#
ERRORS DURING RECOMPILATION
---------------------------
0
Function created.
PL/SQL procedure successfully completed.
Function dropped.
PL/SQL procedure successfully completed.
SQL>
step 5.查看数据库版本
SQL> set linesize 2000
SQL> SELECT * FROM v$version;
BANNER BANNER_FULL BANNER_LEGACY CON_ID
-------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------- ----------
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production 0
Version 19.17.0.0.0
SQL>
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。




