1.上传补丁包到服务器
p6880880_122010_Linux-x86-64.zip
p32578973_190000_Linux-x86-64.zip
2.配置环境变量
[oracle@yuanzjora19c:/home/oracle]$ cat .bash_profile# .bash_profile# Get the aliases and functionsif [ -f ~/.bashrc ]; then. ~/.bashrcfi# User specific environment and startup programsPATH=$PATH:$HOME/.local/bin:$HOME/binexport PATH#Use for oracle12c install added by jt&&yzjPS1=[`whoami`@`hostname`:'$PWD]$ '; export PS1TMP=/tmp; export TMPTMPDIR=$TMP; export TMPDIRORACLE_BASE=/u01/app/oracle; export ORACLE_BASEORACLE_HOME=$ORACLE_BASE/product/19.0.0/dbhome_1; export ORACLE_HOMEORACLE_SID=orcl; export ORACLE_SIDORACLE_TERM=xterm; export ORACLE_TERMPATH=/usr/sbin:/usr/local/bin:$PATH:$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$PATH; export PATHLD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATHCLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATHNLS_LANG=AMERICAN_AMERICA.AL32UTF8; export NLS_LANGalias sqlplus='rlwrap sqlplus'alias rman='rlwrap rman'
3.升级OPatch版本
[oracle@yuanzjora19c:/home/oracle/soft]$ mv $ORACLE_HOME/OPatch mv $ORACLE_HOME/OPatch_bak[oracle@yuanzjora19c:/home/oracle/soft]$ unzip p6880880_122010_Linux-x86-64.zip -d $ORACLE_HOME
4.临时补丁冲突检测
[oracle@yuanzjora19c:/home/oracle/soft/32578973/32545008/32545013]$ opatch prereq CheckConflictAgainstOHWithDetail -ph ./Oracle 临时补丁程序安装程序版本 12.2.0.1.24版权所有 (c) 2021, Oracle Corporation。保留所有权利。PREREQ sessionOracle 主目录 :/u01/app/oracle/product/19.0.0/dbhome_1主产品清单:/u01/app/oraInventory来自 :/u01/app/oracle/product/19.0.0/dbhome_1/oraInst.locOPatch 版本 :12.2.0.1.24OUI 版本 :12.2.0.7.0日志文件位置:/u01/app/oracle/product/19.0.0/dbhome_1/cfgtoollogs/opatch/opatch2021-05-28_14-44-06下午_1.logInvoking prereq "checkconflictagainstohwithdetail"Prereq "checkConflictAgainstOHWithDetail" passed.OPatch succeeded.
5.补丁安装
[oracle@yuanzjora19c:/home/oracle/soft/32578973/32545008/32545013]$ opatch applyOracle 临时补丁程序安装程序版本 12.2.0.1.24版权所有 (c) 2021, Oracle Corporation。保留所有权利。Oracle 主目录 :/u01/app/oracle/product/19.0.0/dbhome_1主产品清单:/u01/app/oraInventory来自 :/u01/app/oracle/product/19.0.0/dbhome_1/oraInst.locOPatch 版本 :12.2.0.1.24OUI 版本 :12.2.0.7.0日志文件位置:/u01/app/oracle/product/19.0.0/dbhome_1/cfgtoollogs/opatch/opatch2021-05-28_15-41-30下午_1.logVerifying environment and performing prerequisite checks...OPatch continues with these patches: 32545013是否继续? [y|n]yUser Responded with: YAll checks passed.请关闭本地系统上在此 ORACLE_HOME 之外运行的 Oracle 实例。(Oracle 主目录 = '/u01/app/oracle/product/19.0.0/dbhome_1')本地系统是否已准备打补丁? [y|n]yUser Responded with: YBacking up files...正在将临时补丁程序 '32545013' 应用于 OH '/u01/app/oracle/product/19.0.0/dbhome_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.ons.cclient, 19.0.0.0.0 ] , [ oracle.options.olap, 19.0.0.0.0 ] , [ oracle.network.cman, 19.0.0.0.0 ] , [ oracle.oid.client, 19.0.0.0.0 ] , [ oracle.ons.eons.bwcompat, 19.0.0.0.0 ] , [ oracle.net.cman, 19.0.0.0.0 ] , [ oracle.xdk.companion, 19.0.0.0.0 ] , [ oracle.jdk, 1.8.0.191.0 ] , 或找到更高版本。正在为组件 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.buildtools.rsf, 19.0.0.0.0 打补丁...正在为组件 oracle.ctx, 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.dbtoolslistener, 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.marvel, 19.0.0.0.0 打补丁...正在为组件 oracle.network.rsf, 19.0.0.0.0 打补丁...正在为组件 oracle.oracore.rsf, 19.0.0.0.0 打补丁...正在为组件 oracle.precomp.common.core, 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.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.wwg.plsql, 19.0.0.0.0 打补丁...正在为组件 oracle.xdk, 19.0.0.0.0 打补丁...正在为组件 oracle.odbc, 19.0.0.0.0 打补丁...正在为组件 oracle.xdk.rsf, 19.0.0.0.0 打补丁...正在为组件 oracle.dbdev, 19.0.0.0.0 打补丁...正在为组件 oracle.xdk.parser.java, 19.0.0.0.0 打补丁...正在为组件 oracle.javavm.server, 19.0.0.0.0 打补丁...正在为组件 oracle.sdo.locator, 19.0.0.0.0 打补丁...正在为组件 oracle.rdbms.install.plugins, 19.0.0.0.0 打补丁...正在为组件 oracle.mgw.common, 19.0.0.0.0 打补丁...正在为组件 oracle.ons, 19.0.0.0.0 打补丁...正在为组件 oracle.ons.ic, 19.0.0.0.0 打补丁...正在为组件 oracle.ldap.rsf.ic, 19.0.0.0.0 打补丁...正在为组件 oracle.oraolap, 19.0.0.0.0 打补丁...正在为组件 oracle.ctx.atg, 19.0.0.0.0 打补丁...正在为组件 oracle.rdbms.install.common, 19.0.0.0.0 打补丁...正在为组件 oracle.sqlplus.ic, 19.0.0.0.0 打补丁...正在为组件 oracle.oraolap.dbscripts, 19.0.0.0.0 打补丁...正在为组件 oracle.xdk.xquery, 19.0.0.0.0 打补丁...正在为组件 oracle.network.listener, 19.0.0.0.0 打补丁...正在为组件 oracle.rdbms.dv, 19.0.0.0.0 打补丁...正在为组件 oracle.oraolap.api, 19.0.0.0.0 打补丁...正在为组件 oracle.rdbms.scheduler, 19.0.0.0.0 打补丁...正在为组件 oracle.rdbms.crs, 19.0.0.0.0 打补丁...正在为组件 oracle.ctx.rsf, 19.0.0.0.0 打补丁...正在为组件 oracle.ldap.security.osdt, 19.0.0.0.0 打补丁...正在为组件 oracle.precomp.rsf, 19.0.0.0.0 打补丁...正在为组件 oracle.ldap.client, 19.0.0.0.0 打补丁...正在为组件 oracle.network.client, 19.0.0.0.0 打补丁...正在为组件 oracle.rdbms.drdaas, 19.0.0.0.0 打补丁...正在为组件 oracle.rdbms.rman, 19.0.0.0.0 打补丁...正在为组件 oracle.rdbms.lbac, 19.0.0.0.0 打补丁...正在为组件 oracle.nlsrtl.rsf, 19.0.0.0.0 打补丁...正在为组件 oracle.ovm, 19.0.0.0.0 打补丁...正在为组件 oracle.rdbms.rsf.ic, 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 32545013 successfully applied.Sub-set patch [29517242] has become inactive due to the application of a super-set patch [32545013].Please refer to Doc ID 2161861.1 for any possible further required actions.Log file location: u01/app/oracle/product/19.0.0/dbhome_1/cfgtoollogs/opatch/opatch2021-05-28_15-41-30下午_1.logOPatch succeeded.
6.将修改后的SQL文件加载到数据库中
[oracle@yuanzjora19c:/home/oracle/soft/32578973/32545008/32545013]$ sqlplus / as sysdbaSQL*Plus: Release 19.0.0.0.0 - Production on Fri May 28 15:50:51 2021Version 19.11.0.0.0Copyright (c) 1982, 2020, Oracle. All rights reserved.Connected to an idle instance.SYS@orcl> startupORACLE instance started.Total System Global Area 1660941672 bytesFixed Size 9135464 bytesVariable Size 1006632960 bytesDatabase Buffers 637534208 bytesRedo Buffers 7639040 bytesDatabase mounted.Database opened.SYS@orcl> alter pluggable database all open;Pluggable database altered.SYS@orcl> show pdbs;CON_ID CON_NAME OPEN MODE RESTRICTED---------- ------------------------------ ---------- ----------2 PDB$SEED READ ONLY NO3 ORCLPDB1 READ WRITE NO4 ORCLPDB2 READ WRITE NO5 ORCLPDB3 READ WRITE NO6 ORCLPDB4 READ WRITE NOSYS@orcl> exitDisconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - ProductionVersion 19.11.0.0.0[oracle@yuanzjora19c:/home/oracle/soft/32578973/32545008/32545013]$ datapatch -verboseSQL Patching tool version 19.11.0.0.0 Production on Fri May 28 15:52:30 2021Copyright (c) 2012, 2021, Oracle. All rights reserved.Log file for this invocation: u01/app/oracle/cfgtoollogs/sqlpatch/sqlpatch_3138_2021_05_28_15_52_30/sqlpatch_invocation.logConnecting to database...OKGathering database info...doneNote: Datapatch will only apply or rollback SQL fixes for PDBsthat 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)Bootstrapping registry and package to current versions...doneDetermining current state...doneCurrent state of interim SQL patches:No interim patches foundCurrent state of release update SQL patches:Binary registry:19.11.0.0.0 Release_Update 210413004009: InstalledPDB CDB$ROOT:Applied 19.3.0.0.0 Release_Update 190410122720 successfully on 28-MAY-21 03.11.46.783853 PMPDB ORCLPDB1:Applied 19.3.0.0.0 Release_Update 190410122720 successfully on 28-MAY-21 03.19.17.050086 PMPDB ORCLPDB2:Applied 19.3.0.0.0 Release_Update 190410122720 successfully on 28-MAY-21 03.19.17.050086 PMPDB ORCLPDB3:Applied 19.3.0.0.0 Release_Update 190410122720 successfully on 28-MAY-21 03.19.17.050086 PMPDB ORCLPDB4:Applied 19.3.0.0.0 Release_Update 190410122720 successfully on 28-MAY-21 03.19.17.050086 PMPDB PDB$SEED:Applied 19.3.0.0.0 Release_Update 190410122720 successfully on 28-MAY-21 03.19.17.050086 PMAdding patches to installation queue and performing prereq checks...doneInstallation queue:For the following PDBs: CDB$ROOT PDB$SEED ORCLPDB1 ORCLPDB2 ORCLPDB3 ORCLPDB4No interim patches need to be rolled backPatch 32545013 (Database Release Update : 19.11.0.0.210420 (32545013)):Apply from 19.3.0.0.0 Release_Update 190410122720 to 19.11.0.0.0 Release_Update 210413004009No interim patches need to be appliedInstalling patches...Patch installation complete. Total patches installed: 6Validating logfiles...donePatch 32545013 apply (pdb CDB$ROOT): SUCCESSlogfile: /u01/app/oracle/cfgtoollogs/sqlpatch/32545013/24175065/32545013_apply_ORCL_CDBROOT_2021May28_15_53_16.log (no errors)Patch 32545013 apply (pdb PDB$SEED): SUCCESSlogfile: /u01/app/oracle/cfgtoollogs/sqlpatch/32545013/24175065/32545013_apply_ORCL_PDBSEED_2021May28_16_00_29.log (no errors)Patch 32545013 apply (pdb ORCLPDB1): SUCCESSlogfile: /u01/app/oracle/cfgtoollogs/sqlpatch/32545013/24175065/32545013_apply_ORCL_ORCLPDB1_2021May28_16_00_28.log (no errors)Patch 32545013 apply (pdb ORCLPDB2): SUCCESSlogfile: /u01/app/oracle/cfgtoollogs/sqlpatch/32545013/24175065/32545013_apply_ORCL_ORCLPDB2_2021May28_16_00_29.log (no errors)Patch 32545013 apply (pdb ORCLPDB3): SUCCESSlogfile: /u01/app/oracle/cfgtoollogs/sqlpatch/32545013/24175065/32545013_apply_ORCL_ORCLPDB3_2021May28_16_00_29.log (no errors)Patch 32545013 apply (pdb ORCLPDB4): SUCCESSlogfile: /u01/app/oracle/cfgtoollogs/sqlpatch/32545013/24175065/32545013_apply_ORCL_ORCLPDB4_2021May28_16_20_02.log (no errors)Please refer to MOS Note 1609718.1 and/or the invocation log/u01/app/oracle/cfgtoollogs/sqlpatch/sqlpatch_3138_2021_05_28_15_52_30/sqlpatch_invocation.logfor information on how to resolve the above errors.SQL Patching tool complete on Fri May 28 16:27:17 2021
7.编译无效对象(pdb数据库依次执行),以cdb为例:
SYS@orcl> @$ORACLE_HOME/rdbms/admin/utlrp.sqlSession altered.TIMESTAMP------------------------------------------------------------------------------------------------------------------------COMP_TIMESTAMP UTLRP_BGN 2021-05-28 18:05:54DOC> The following PL/SQL block invokes UTL_RECOMP to recompile invalidDOC> objects in the database. Recompilation time is proportional to theDOC> number of invalid objects in the database, so this command may takeDOC> a long time to execute on a database with a large number of invalidDOC> objects.DOC>DOC> Use the following queries to track recompilation progress:DOC>DOC> 1. Query returning the number of invalid objects remaining. ThisDOC> 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 numberDOC> should increase with time.DOC> SELECT COUNT(*) FROM UTL_RECOMP_COMPILED;DOC>DOC> This script automatically chooses serial or parallel recompilationDOC> based on the number of CPUs available (parameter cpu_count) multipliedDOC> 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 parallelDOC> recompilation. Jobs are created without instance affinity so that theyDOC> can migrate across RAC nodes. Use the following queries to verifyDOC> whether UTL_RECOMP jobs are being created and run correctly:DOC>DOC> 1. Query showing jobs created by UTL_RECOMPDOC> SELECT job_name FROM dba_scheduler_jobsDOC> WHERE job_name like 'UTL_RECOMP_SLAVE_%';DOC>DOC> 2. Query showing UTL_RECOMP jobs that are runningDOC> SELECT job_name FROM dba_scheduler_running_jobsDOC> WHERE job_name like 'UTL_RECOMP_SLAVE_%';DOC>#PL/SQL procedure successfully completed.TIMESTAMP------------------------------------------------------------------------------------------------------------------------COMP_TIMESTAMP UTLRP_END 2021-05-28 18:05:55DOC> The following query reports the number of invalid objects.DOC>DOC> If the number is higher than expected, please examine the errorDOC> messages reported with each object (using SHOW ERRORS) to see if theyDOC> point to system misconfiguration or resource constraints that must beDOC> fixed before attempting to recompile these objects.DOC>#OBJECTS WITH ERRORS-------------------0DOC> The following query reports the number of exceptions caught duringDOC> recompilation. If this number is non-zero, please query the errorDOC> messages in the table UTL_RECOMP_ERRORS to see if any of these errorsDOC> are due to misconfiguration or resource constraints that must beDOC> fixed before objects can compile successfully.DOC> Note: Typical compilation errors (due to coding errors) are notDOC> logged into this table: they go into DBA_ERRORS instead.DOC>#ERRORS DURING RECOMPILATION---------------------------0Function created.PL/SQL procedure successfully completed.Function dropped.PL/SQL procedure successfully completed.
9.临时补丁冲突检测
[oracle@yuanzjora19c:/home/oracle/soft/32578973/32399816]$ opatch prereq CheckConflictAgainstOHWithDetail -ph ./Oracle 临时补丁程序安装程序版本 12.2.0.1.24版权所有 (c) 2021, Oracle Corporation。保留所有权利。PREREQ sessionOracle 主目录 :/u01/app/oracle/product/19.0.0/dbhome_1主产品清单:/u01/app/oraInventory来自 :/u01/app/oracle/product/19.0.0/dbhome_1/oraInst.locOPatch 版本 :12.2.0.1.24OUI 版本 :12.2.0.7.0日志文件位置:/u01/app/oracle/product/19.0.0/dbhome_1/cfgtoollogs/opatch/opatch2021-05-28_18-23-50下午_1.logInvoking prereq "checkconflictagainstohwithdetail"Prereq "checkConflictAgainstOHWithDetail" passed.OPatch succeeded.
10.补丁安装
[oracle@yuanzjora19c:/home/oracle/soft/32578973/32399816]$ opatch applyOracle 临时补丁程序安装程序版本 12.2.0.1.24版权所有 (c) 2021, Oracle Corporation。保留所有权利。Oracle 主目录 :/u01/app/oracle/product/19.0.0/dbhome_1主产品清单:/u01/app/oraInventory来自 :/u01/app/oracle/product/19.0.0/dbhome_1/oraInst.locOPatch 版本 :12.2.0.1.24OUI 版本 :12.2.0.7.0日志文件位置:/u01/app/oracle/product/19.0.0/dbhome_1/cfgtoollogs/opatch/opatch2021-05-28_18-27-07下午_1.logVerifying environment and performing prerequisite checks...OPatch continues with these patches: 32399816是否继续? [y|n]yUser Responded with: YAll checks passed.请关闭本地系统上在此 ORACLE_HOME 之外运行的 Oracle 实例。(Oracle 主目录 = '/u01/app/oracle/product/19.0.0/dbhome_1')本地系统是否已准备打补丁? [y|n]yUser Responded with: YBacking up files...正在将临时补丁程序 '32399816' 应用于 OH '/u01/app/oracle/product/19.0.0/dbhome_1'正在为组件 oracle.javavm.server, 19.0.0.0.0 打补丁...正在为组件 oracle.javavm.server.core, 19.0.0.0.0 打补丁...正在为组件 oracle.rdbms.dbscripts, 19.0.0.0.0 打补丁...正在为组件 oracle.rdbms, 19.0.0.0.0 打补丁...正在为组件 oracle.javavm.client, 19.0.0.0.0 打补丁...Patch 32399816 successfully applied.Log file location: u01/app/oracle/product/19.0.0/dbhome_1/cfgtoollogs/opatch/opatch2021-05-28_18-27-07下午_1.logOPatch succeeded.
11.将修改后的SQL文件加载到数据库中
[oracle@yuanzjora19c:/home/oracle/soft/32578973/32399816]$ datapatch -verboseSQL Patching tool version 19.11.0.0.0 Production on Fri May 28 18:31:03 2021Copyright (c) 2012, 2021, Oracle. All rights reserved.Log file for this invocation: u01/app/oracle/cfgtoollogs/sqlpatch/sqlpatch_17317_2021_05_28_18_31_03/sqlpatch_invocation.logConnecting to database...OKGathering database info...doneNote: Datapatch will only apply or rollback SQL fixes for PDBsthat 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)Bootstrapping registry and package to current versions...doneDetermining current state...doneCurrent state of interim SQL patches:Interim patch 32399816 (OJVM RELEASE UPDATE: 19.11.0.0.210420 (32399816)):Binary registry: InstalledPDB CDB$ROOT: Not installedPDB ORCLPDB1: Not installedPDB ORCLPDB2: Not installedPDB ORCLPDB3: Not installedPDB ORCLPDB4: Not installedPDB PDB$SEED: Not installedCurrent state of release update SQL patches:Binary registry:19.11.0.0.0 Release_Update 210413004009: InstalledPDB CDB$ROOT:Applied 19.11.0.0.0 Release_Update 210413004009 successfully on 28-MAY-21 04.26.42.143856 PMPDB ORCLPDB1:Applied 19.11.0.0.0 Release_Update 210413004009 successfully on 28-MAY-21 04.26.54.981034 PMPDB ORCLPDB2:Applied 19.11.0.0.0 Release_Update 210413004009 successfully on 28-MAY-21 05.59.20.976194 PMPDB ORCLPDB3:Applied 19.11.0.0.0 Release_Update 210413004009 successfully on 28-MAY-21 04.27.07.892486 PMPDB ORCLPDB4:Applied 19.11.0.0.0 Release_Update 210413004009 successfully on 28-MAY-21 04.27.14.171102 PMPDB PDB$SEED:Applied 19.11.0.0.0 Release_Update 210413004009 successfully on 28-MAY-21 04.26.48.607759 PMAdding patches to installation queue and performing prereq checks...doneInstallation queue:For the following PDBs: CDB$ROOT PDB$SEED ORCLPDB1 ORCLPDB2 ORCLPDB3 ORCLPDB4No interim patches need to be rolled backNo release update patches need to be installedThe following interim patches will be applied:32399816 (OJVM RELEASE UPDATE: 19.11.0.0.210420 (32399816))Installing patches...Patch installation complete. Total patches installed: 6Validating logfiles...donePatch 32399816 apply (pdb CDB$ROOT): SUCCESSlogfile: u01/app/oracle/cfgtoollogs/sqlpatch/32399816/24099425/32399816_apply_ORCL_CDBROOT_2021May28_18_31_33.log (no errors)Patch 32399816 apply (pdb PDB$SEED): SUCCESSlogfile: u01/app/oracle/cfgtoollogs/sqlpatch/32399816/24099425/32399816_apply_ORCL_PDBSEED_2021May28_18_32_18.log (no errors)Patch 32399816 apply (pdb ORCLPDB1): SUCCESSlogfile: u01/app/oracle/cfgtoollogs/sqlpatch/32399816/24099425/32399816_apply_ORCL_ORCLPDB1_2021May28_18_32_18.log (no errors)Patch 32399816 apply (pdb ORCLPDB2): SUCCESSlogfile: u01/app/oracle/cfgtoollogs/sqlpatch/32399816/24099425/32399816_apply_ORCL_ORCLPDB2_2021May28_18_32_19.log (no errors)Patch 32399816 apply (pdb ORCLPDB3): SUCCESSlogfile: u01/app/oracle/cfgtoollogs/sqlpatch/32399816/24099425/32399816_apply_ORCL_ORCLPDB3_2021May28_18_32_19.log (no errors)Patch 32399816 apply (pdb ORCLPDB4): SUCCESSlogfile: u01/app/oracle/cfgtoollogs/sqlpatch/32399816/24099425/32399816_apply_ORCL_ORCLPDB4_2021May28_18_32_43.log (no errors)SQL Patching tool complete on Fri May 28 18:32:57 2021[oracle@yuanzjora19c:/home/oracle/soft/32578973/32399816]$ sqlplus as sysdbaSQL*Plus: Release 19.0.0.0.0 - Production on Fri May 28 18:36:48 2021Version 19.11.0.0.0Copyright (c) 1982, 2020, Oracle. All rights reserved.Connected to:Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - ProductionVersion 19.11.0.0.0SYS@orcl> show pdbs;CON_ID CON_NAME OPEN MODE RESTRICTED---------- ------------------------------ ---------- ----------2 PDB$SEED MIGRATE YES3 ORCLPDB1 MIGRATE YES4 ORCLPDB2 MIGRATE YES5 ORCLPDB3 MIGRATE YES6 ORCLPDB4 MIGRATE YESSYS@orcl> shu immediate;Database closed.Database dismounted.ORACLE instance shut down.SYS@orcl> startupORACLE instance started.Total System Global Area 2147482336 bytesFixed Size 9136864 bytesVariable Size 1778384896 bytesDatabase Buffers 352321536 bytesRedo Buffers 7639040 bytesDatabase mounted.Database opened.SYS@orcl> alter pluggable database all open;Pluggable database altered.SYS@orcl> show pdbs;CON_ID CON_NAME OPEN MODE RESTRICTED---------- ------------------------------ ---------- ----------2 PDB$SEED READ ONLY NO3 ORCLPDB1 READ WRITE NO4 ORCLPDB2 READ WRITE NO5 ORCLPDB3 READ WRITE NO6 ORCLPDB4 READ WRITE NO
12.编译无效对象(cdb和pdb依次执行,以cdb为例)
SYS@orcl> @$ORACLE_HOME/rdbms/admin/utlrp.sqlSession altered.TIMESTAMP------------------------------------------------------------------------------------------------------------------------COMP_TIMESTAMP UTLRP_BGN 2021-05-28 18:42:48DOC> The following PL/SQL block invokes UTL_RECOMP to recompile invalidDOC> objects in the database. Recompilation time is proportional to theDOC> number of invalid objects in the database, so this command may takeDOC> a long time to execute on a database with a large number of invalidDOC> objects.DOC>DOC> Use the following queries to track recompilation progress:DOC>DOC> 1. Query returning the number of invalid objects remaining. ThisDOC> 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 numberDOC> should increase with time.DOC> SELECT COUNT(*) FROM UTL_RECOMP_COMPILED;DOC>DOC> This script automatically chooses serial or parallel recompilationDOC> based on the number of CPUs available (parameter cpu_count) multipliedDOC> 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 parallelDOC> recompilation. Jobs are created without instance affinity so that theyDOC> can migrate across RAC nodes. Use the following queries to verifyDOC> whether UTL_RECOMP jobs are being created and run correctly:DOC>DOC> 1. Query showing jobs created by UTL_RECOMPDOC> SELECT job_name FROM dba_scheduler_jobsDOC> WHERE job_name like 'UTL_RECOMP_SLAVE_%';DOC>DOC> 2. Query showing UTL_RECOMP jobs that are runningDOC> SELECT job_name FROM dba_scheduler_running_jobsDOC> WHERE job_name like 'UTL_RECOMP_SLAVE_%';DOC>#PL/SQL procedure successfully completed.TIMESTAMP------------------------------------------------------------------------------------------------------------------------COMP_TIMESTAMP UTLRP_END 2021-05-28 18:42:49DOC> The following query reports the number of invalid objects.DOC>DOC> If the number is higher than expected, please examine the errorDOC> messages reported with each object (using SHOW ERRORS) to see if theyDOC> point to system misconfiguration or resource constraints that must beDOC> fixed before attempting to recompile these objects.DOC>#OBJECTS WITH ERRORS-------------------0DOC> The following query reports the number of exceptions caught duringDOC> recompilation. If this number is non-zero, please query the errorDOC> messages in the table UTL_RECOMP_ERRORS to see if any of these errorsDOC> are due to misconfiguration or resource constraints that must beDOC> fixed before objects can compile successfully.DOC> Note: Typical compilation errors (due to coding errors) are notDOC> logged into this table: they go into DBA_ERRORS instead.DOC>#ERRORS DURING RECOMPILATION---------------------------0Function created.PL/SQL procedure successfully completed.Function dropped.PL/SQL procedure successfully completed.
13.查看补丁信息
1* select * from dba_registry_historyACTION_TIME ACTION NAMESPACE VERSION ID COMMENTS BUNDLE_SERIES----------------------------------- ------------------------- ------------------------- ------------------------------ ---------- ---------------------------------------- ----------------------------------------BOOTSTRAP DATAPATCH 19 RDBMS_19.11.0.0.0DBRU_LINUX.X64_21041228-MAY-21 03.10.35.132987 PM RU_APPLY SERVER 19.0.0.0.0 Patch applied on 19.3.0.0.0: Release_Update - 19041012272028-MAY-21 03.59.46.212052 PM RU_APPLY SERVER 19.0.0.0.0 Patch applied from 19.3.0.0.0 to 19.11.0.0.0: Release_Update - 21041300400928-MAY-21 06.32.17.658968 PM jvmpsu.sql SERVER 19.11.0.0.210420OJVMRU 0 RAN jvmpsu.sql28-MAY-21 06.32.17.682096 PM APPLY SERVER 19.11.0.0.210420OJVMRU 0 OJVM RU post-install
最后修改时间:2021-06-04 16:36:45
文章转载自yuanzj,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。




