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 functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/.local/bin:$HOME/bin
export PATH
#Use for oracle12c install added by jt&&yzj
PS1=[`whoami`@`hostname`:'$PWD]$ '; export PS1
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/19.0.0/dbhome_1; export ORACLE_HOME
ORACLE_SID=orcl; export ORACLE_SID
ORACLE_TERM=xterm; export ORACLE_TERM
PATH=/usr/sbin:/usr/local/bin:$PATH:$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$PATH; export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH
NLS_LANG=AMERICAN_AMERICA.AL32UTF8; export NLS_LANG
alias 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 session
Oracle 主目录 :/u01/app/oracle/product/19.0.0/dbhome_1
主产品清单:/u01/app/oraInventory
来自 :/u01/app/oracle/product/19.0.0/dbhome_1/oraInst.loc
OPatch 版本 :12.2.0.1.24
OUI 版本 :12.2.0.7.0
日志文件位置:/u01/app/oracle/product/19.0.0/dbhome_1/cfgtoollogs/opatch/opatch2021-05-28_14-44-06下午_1.log
Invoking prereq "checkconflictagainstohwithdetail"
Prereq "checkConflictAgainstOHWithDetail" passed.
OPatch succeeded.
复制
5.补丁安装
[oracle@yuanzjora19c:/home/oracle/soft/32578973/32545008/32545013]$ opatch apply
Oracle 临时补丁程序安装程序版本 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.loc
OPatch 版本 :12.2.0.1.24
OUI 版本 :12.2.0.7.0
日志文件位置:/u01/app/oracle/product/19.0.0/dbhome_1/cfgtoollogs/opatch/opatch2021-05-28_15-41-30下午_1.log
Verifying environment and performing prerequisite checks...
OPatch continues with these patches: 32545013
是否继续? [y|n]
y
User Responded with: Y
All checks passed.
请关闭本地系统上在此 ORACLE_HOME 之外运行的 Oracle 实例。
(Oracle 主目录 = '/u01/app/oracle/product/19.0.0/dbhome_1')
本地系统是否已准备打补丁? [y|n]
y
User Responded with: Y
Backing 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.log
OPatch succeeded.
复制
6.将修改后的SQL文件加载到数据库中
[oracle@yuanzjora19c:/home/oracle/soft/32578973/32545008/32545013]$ sqlplus / as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Fri May 28 15:50:51 2021
Version 19.11.0.0.0
Copyright (c) 1982, 2020, Oracle. All rights reserved.
Connected to an idle instance.
SYS@orcl> startup
ORACLE instance started.
Total System Global Area 1660941672 bytes
Fixed Size 9135464 bytes
Variable Size 1006632960 bytes
Database Buffers 637534208 bytes
Redo Buffers 7639040 bytes
Database 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 NO
3 ORCLPDB1 READ WRITE NO
4 ORCLPDB2 READ WRITE NO
5 ORCLPDB3 READ WRITE NO
6 ORCLPDB4 READ WRITE NO
SYS@orcl> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.11.0.0.0
[oracle@yuanzjora19c:/home/oracle/soft/32578973/32545008/32545013]$ datapatch -verbose
SQL Patching tool version 19.11.0.0.0 Production on Fri May 28 15:52:30 2021
Copyright (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.log
Connecting to database...OK
Gathering database info...done
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)
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.11.0.0.0 Release_Update 210413004009: Installed
PDB CDB$ROOT:
Applied 19.3.0.0.0 Release_Update 190410122720 successfully on 28-MAY-21 03.11.46.783853 PM
PDB ORCLPDB1:
Applied 19.3.0.0.0 Release_Update 190410122720 successfully on 28-MAY-21 03.19.17.050086 PM
PDB ORCLPDB2:
Applied 19.3.0.0.0 Release_Update 190410122720 successfully on 28-MAY-21 03.19.17.050086 PM
PDB ORCLPDB3:
Applied 19.3.0.0.0 Release_Update 190410122720 successfully on 28-MAY-21 03.19.17.050086 PM
PDB ORCLPDB4:
Applied 19.3.0.0.0 Release_Update 190410122720 successfully on 28-MAY-21 03.19.17.050086 PM
PDB PDB$SEED:
Applied 19.3.0.0.0 Release_Update 190410122720 successfully on 28-MAY-21 03.19.17.050086 PM
Adding patches to installation queue and performing prereq checks...done
Installation queue:
For the following PDBs: CDB$ROOT PDB$SEED ORCLPDB1 ORCLPDB2 ORCLPDB3 ORCLPDB4
No interim patches need to be rolled back
Patch 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 210413004009
No interim patches need to be applied
Installing patches...
Patch installation complete. Total patches installed: 6
Validating logfiles...done
Patch 32545013 apply (pdb CDB$ROOT): SUCCESS
logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/32545013/24175065/32545013_apply_ORCL_CDBROOT_2021May28_15_53_16.log (no errors)
Patch 32545013 apply (pdb PDB$SEED): SUCCESS
logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/32545013/24175065/32545013_apply_ORCL_PDBSEED_2021May28_16_00_29.log (no errors)
Patch 32545013 apply (pdb ORCLPDB1): SUCCESS
logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/32545013/24175065/32545013_apply_ORCL_ORCLPDB1_2021May28_16_00_28.log (no errors)
Patch 32545013 apply (pdb ORCLPDB2): SUCCESS
logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/32545013/24175065/32545013_apply_ORCL_ORCLPDB2_2021May28_16_00_29.log (no errors)
Patch 32545013 apply (pdb ORCLPDB3): SUCCESS
logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/32545013/24175065/32545013_apply_ORCL_ORCLPDB3_2021May28_16_00_29.log (no errors)
Patch 32545013 apply (pdb ORCLPDB4): SUCCESS
logfile: /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.log
for 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.sql
Session altered.
TIMESTAMP
------------------------------------------------------------------------------------------------------------------------
COMP_TIMESTAMP UTLRP_BGN 2021-05-28 18:05:54
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 2021-05-28 18:05:55
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.
复制
9.临时补丁冲突检测
[oracle@yuanzjora19c:/home/oracle/soft/32578973/32399816]$ opatch prereq CheckConflictAgainstOHWithDetail -ph ./
Oracle 临时补丁程序安装程序版本 12.2.0.1.24
版权所有 (c) 2021, Oracle Corporation。保留所有权利。
PREREQ session
Oracle 主目录 :/u01/app/oracle/product/19.0.0/dbhome_1
主产品清单:/u01/app/oraInventory
来自 :/u01/app/oracle/product/19.0.0/dbhome_1/oraInst.loc
OPatch 版本 :12.2.0.1.24
OUI 版本 :12.2.0.7.0
日志文件位置:/u01/app/oracle/product/19.0.0/dbhome_1/cfgtoollogs/opatch/opatch2021-05-28_18-23-50下午_1.log
Invoking prereq "checkconflictagainstohwithdetail"
Prereq "checkConflictAgainstOHWithDetail" passed.
OPatch succeeded.
复制
10.补丁安装
[oracle@yuanzjora19c:/home/oracle/soft/32578973/32399816]$ opatch apply
Oracle 临时补丁程序安装程序版本 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.loc
OPatch 版本 :12.2.0.1.24
OUI 版本 :12.2.0.7.0
日志文件位置:/u01/app/oracle/product/19.0.0/dbhome_1/cfgtoollogs/opatch/opatch2021-05-28_18-27-07下午_1.log
Verifying environment and performing prerequisite checks...
OPatch continues with these patches: 32399816
是否继续? [y|n]
y
User Responded with: Y
All checks passed.
请关闭本地系统上在此 ORACLE_HOME 之外运行的 Oracle 实例。
(Oracle 主目录 = '/u01/app/oracle/product/19.0.0/dbhome_1')
本地系统是否已准备打补丁? [y|n]
y
User Responded with: Y
Backing 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.log
OPatch succeeded.
复制
11.将修改后的SQL文件加载到数据库中
[oracle@yuanzjora19c:/home/oracle/soft/32578973/32399816]$ datapatch -verbose
SQL Patching tool version 19.11.0.0.0 Production on Fri May 28 18:31:03 2021
Copyright (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.log
Connecting to database...OK
Gathering database info...done
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)
Bootstrapping registry and package to current versions...done
Determining current state...done
Current state of interim SQL patches:
Interim patch 32399816 (OJVM RELEASE UPDATE: 19.11.0.0.210420 (32399816)):
Binary registry: Installed
PDB CDB$ROOT: Not installed
PDB ORCLPDB1: Not installed
PDB ORCLPDB2: Not installed
PDB ORCLPDB3: Not installed
PDB ORCLPDB4: Not installed
PDB PDB$SEED: Not installed
Current state of release update SQL patches:
Binary registry:
19.11.0.0.0 Release_Update 210413004009: Installed
PDB CDB$ROOT:
Applied 19.11.0.0.0 Release_Update 210413004009 successfully on 28-MAY-21 04.26.42.143856 PM
PDB ORCLPDB1:
Applied 19.11.0.0.0 Release_Update 210413004009 successfully on 28-MAY-21 04.26.54.981034 PM
PDB ORCLPDB2:
Applied 19.11.0.0.0 Release_Update 210413004009 successfully on 28-MAY-21 05.59.20.976194 PM
PDB ORCLPDB3:
Applied 19.11.0.0.0 Release_Update 210413004009 successfully on 28-MAY-21 04.27.07.892486 PM
PDB ORCLPDB4:
Applied 19.11.0.0.0 Release_Update 210413004009 successfully on 28-MAY-21 04.27.14.171102 PM
PDB PDB$SEED:
Applied 19.11.0.0.0 Release_Update 210413004009 successfully on 28-MAY-21 04.26.48.607759 PM
Adding patches to installation queue and performing prereq checks...done
Installation queue:
For the following PDBs: CDB$ROOT PDB$SEED ORCLPDB1 ORCLPDB2 ORCLPDB3 ORCLPDB4
No interim patches need to be rolled back
No release update patches need to be installed
The following interim patches will be applied:
32399816 (OJVM RELEASE UPDATE: 19.11.0.0.210420 (32399816))
Installing patches...
Patch installation complete. Total patches installed: 6
Validating logfiles...done
Patch 32399816 apply (pdb CDB$ROOT): SUCCESS
logfile: u01/app/oracle/cfgtoollogs/sqlpatch/32399816/24099425/32399816_apply_ORCL_CDBROOT_2021May28_18_31_33.log (no errors)
Patch 32399816 apply (pdb PDB$SEED): SUCCESS
logfile: u01/app/oracle/cfgtoollogs/sqlpatch/32399816/24099425/32399816_apply_ORCL_PDBSEED_2021May28_18_32_18.log (no errors)
Patch 32399816 apply (pdb ORCLPDB1): SUCCESS
logfile: u01/app/oracle/cfgtoollogs/sqlpatch/32399816/24099425/32399816_apply_ORCL_ORCLPDB1_2021May28_18_32_18.log (no errors)
Patch 32399816 apply (pdb ORCLPDB2): SUCCESS
logfile: u01/app/oracle/cfgtoollogs/sqlpatch/32399816/24099425/32399816_apply_ORCL_ORCLPDB2_2021May28_18_32_19.log (no errors)
Patch 32399816 apply (pdb ORCLPDB3): SUCCESS
logfile: u01/app/oracle/cfgtoollogs/sqlpatch/32399816/24099425/32399816_apply_ORCL_ORCLPDB3_2021May28_18_32_19.log (no errors)
Patch 32399816 apply (pdb ORCLPDB4): SUCCESS
logfile: 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 sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Fri May 28 18:36:48 2021
Version 19.11.0.0.0
Copyright (c) 1982, 2020, Oracle. All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.11.0.0.0
SYS@orcl> show pdbs;
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED MIGRATE YES
3 ORCLPDB1 MIGRATE YES
4 ORCLPDB2 MIGRATE YES
5 ORCLPDB3 MIGRATE YES
6 ORCLPDB4 MIGRATE YES
SYS@orcl> shu immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SYS@orcl> startup
ORACLE instance started.
Total System Global Area 2147482336 bytes
Fixed Size 9136864 bytes
Variable Size 1778384896 bytes
Database Buffers 352321536 bytes
Redo Buffers 7639040 bytes
Database 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 NO
3 ORCLPDB1 READ WRITE NO
4 ORCLPDB2 READ WRITE NO
5 ORCLPDB3 READ WRITE NO
6 ORCLPDB4 READ WRITE NO
复制
12.编译无效对象(cdb和pdb依次执行,以cdb为例)
SYS@orcl> @$ORACLE_HOME/rdbms/admin/utlrp.sql
Session altered.
TIMESTAMP
------------------------------------------------------------------------------------------------------------------------
COMP_TIMESTAMP UTLRP_BGN 2021-05-28 18:42:48
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 2021-05-28 18:42:49
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.
复制
13.查看补丁信息
1* select * from dba_registry_history
ACTION_TIME ACTION NAMESPACE VERSION ID COMMENTS BUNDLE_SERIES
----------------------------------- ------------------------- ------------------------- ------------------------------ ---------- ---------------------------------------- ----------------------------------------
BOOTSTRAP DATAPATCH 19 RDBMS_19.11.0.0.0DBRU_LINUX.X64_210412
28-MAY-21 03.10.35.132987 PM RU_APPLY SERVER 19.0.0.0.0 Patch applied on 19.3.0.0.0: Release_Upd
ate - 190410122720
28-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 - 210413004009
28-MAY-21 06.32.17.658968 PM jvmpsu.sql SERVER 19.11.0.0.210420OJVMRU 0 RAN jvmpsu.sql
28-MAY-21 06.32.17.682096 PM APPLY SERVER 19.11.0.0.210420OJVMRU 0 OJVM RU post-install
复制
文章转载自yuanzj,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。