Centos7.6 Oracle RAC 12.2.0.1升级补丁

前言

首先安装Centos7.6安装Oracle RAC 12.2.0.1,本文在此基础上对Oracle RAC 12.2.0.1进行补丁升级

1、上传软件包

📢 注意:传至/soft目录

p6880880_122010_Linux-x86-64.zip
p32928749_122010_Linux-x86-64.zip

2、解压补丁包

📢 注意:db1和db2都执行

mv /u01/app/12.2.0/grid/OPatch /u01/app/12.2.0/grid/OPatch.bak
unzip -q /soft/p6880880_122010_Linux-x86-64.zip -d /u01/app/12.2.0/grid/
chmod -R 755 /u01/app/12.2.0/grid/OPatch
chown -R grid:oinstall /u01/app/12.2.0/grid/OPatch

/u01/app/12.2.0/grid/ | grep OP
drwxr-xr-x 15 grid oinstall  4096 Jul 30 22:36 OPatch
drwxr-xr-x 12 grid oinstall  4096 Jan 27  2017 OPatch.bak
mv /u01/app/oracle/product/12.2.0/db/OPatch /u01/app/oracle/product/12.2.0/db/OPatch .bak
unzip -q /soft/p6880880_122010_Linux-x86-64.zip -d /u01/app/oracle/product/12.2.0/db/
chmod -R 755 /u01/app/oracle/product/12.2.0/db/OPatch 
chown -R oracle:oinstall /u01/app/oracle/product/12.2.0/db/OPatch 

ll /u01/app/oracle/product/12.2.0/db | grep OP
drwxr-x--- 15 oracle oinstall  4096 Jul 30 22:36 OPatch
drwxr-xr-x 12 oracle oinstall  4096 Jan  9 04:42 OPatch.bak

📢 注意:db1和db2都执行

su - grid -c "unzip -q /soft/p32928749_122010_Linux-x86-64.zip -d /soft/"
chmod -R 755 /soft/32928749/

ll /soft |grep 32
drwxr-xr-x  8 grid oinstall        159 Jul 17 15:43 32928749
-rwxr-xr-x  1 grid oinstall 2387594772 Jan  6 01:10 p32928749_122010_Linux-x86-64.zip

3、兼容性检查

OPatch兼容性检查

Validation of Oracle Inventory

Before beginning patch application, check the consistency of inventory information for GI home and each database home to be patched. Run the following command as respective Oracle home owner to check the consistency. 
$ <ORACLE_HOME>/OPatch/opatch lsinventory -detail -oh <ORACLE_HOME>

📢 注意:db1和db2都执行

/u01/app/12.2.0/grid/OPatch/opatch lsinventory -detail -oh /u01/app/12.2.0/grid/
Oracle Interim Patch Installer version 12.2.0.1.27
Copyright (c) 2022, Oracle Corporation.  All rights reserved.


Oracle Home       : /u01/app/12.2.0/grid
Central Inventory : /u01/app/oraInventory
   from           : /u01/app/12.2.0/grid//oraInst.loc
OPatch version    : 12.2.0.1.27
OUI version       : 12.2.0.1.4
Log file location : /u01/app/12.2.0/grid/cfgtoollogs/opatch/opatch2022-01-09_07-01-27AM_1.log

Lsinventory Output file location : /u01/app/12.2.0/grid/cfgtoollogs/opatch/lsinv/lsinventory2022-01-09_07-01-27AM.txt
--------------------------------------------------------------------------------
Local Machine Information::
Hostname: db1
ARU platform id: 226
ARU platform description:: Linux x86-64

Installed Top-level Products (1): 

Oracle Grid Infrastructure 12c                                       12.2.0.1.0
There are 1 products installed in this Oracle Home.


Installed Products (99): 

Assistant Common Files                                               12.2.0.1.0
Automatic Storage Management Assistant                               12.2.0.1.0
BLASLAPACK Component                                                 12.2.0.1.0
Buildtools Common Files                                              12.2.0.1.0
Cluster Ready Services Files                                         12.2.0.1.0
Cluster Verification Utility Common Files                            12.2.0.1.0
Cluster Verification Utility Files                                   12.2.0.1.0
Database Configuration and Upgrade Assistants                        12.2.0.1.0
Database Migration Assistant for Unicode                             12.2.0.1.0
Database SQL Scripts                                                 12.2.0.1.0
Database Workspace Manager                                           12.2.0.1.0
DB TOOLS Listener                                                    12.2.0.1.0
Deinstallation Tool                                                  12.2.0.1.0
Expat libraries                                                       2.0.1.0.3
Hadoopcore Component                                                 12.2.0.1.0
HAS Common Files                                                     12.2.0.1.0
HAS Files for DB                                                     12.2.0.1.0
Installation Common Files                                            12.2.0.1.0
Installation Plugin Files                                            12.2.0.1.0
Installer SDK Component                                              12.2.0.1.4
Java Development Kit                                                 1.8.0.91.0
LDAP Required Support Files                                          12.2.0.1.0
OLAP SQL Scripts                                                     12.2.0.1.0
Oracle Advanced Security                                             12.2.0.1.0
Oracle Bali Share                                                    11.1.1.6.0
Oracle Clusterware RDBMS Files                                       12.2.0.1.0
Oracle Configuration Manager Deconfiguration                         10.3.1.0.0
Oracle Core Required Support Files                                   12.2.0.1.0
Oracle Core Required Support Files for Core DB                       12.2.0.1.0
Oracle Database 12c                                                  12.2.0.1.0
Oracle Database 12c Multimedia Files                                 12.2.0.1.0
Oracle Database Deconfiguration                                      12.2.0.1.0
Oracle Database Utilities                                            12.2.0.1.0
Oracle DBCA Deconfiguration                                          12.2.0.1.0
Oracle Extended Windowing Toolkit                                    11.1.1.6.0
Oracle Globalization Support                                         12.2.0.1.0
Oracle Globalization Support                                         12.2.0.1.0
Oracle Globalization Support For Core                                12.2.0.1.0
Oracle Grid Infrastructure 12c                                       12.2.0.1.0
Oracle Grid Infrastructure Bundled Agents                            12.2.0.1.0
Oracle Grid Management Database                                      12.2.0.1.0
Oracle Help for Java                                                 11.1.1.7.0
Oracle Help Share Library                                            11.1.1.7.0
Oracle Ice Browser                                                   11.1.1.7.0
Oracle Internet Directory Client                                     12.2.0.1.0
Oracle Java Client                                                   12.2.0.1.0
Oracle JDBC/OCI Instant Client                                       12.2.0.1.0
Oracle JDBC/THIN Interfaces                                          12.2.0.1.0
Oracle JFC Extended Windowing Toolkit                                11.1.1.6.0
Oracle JVM                                                           12.2.0.1.0
Oracle JVM For Core                                                  12.2.0.1.0
Oracle LDAP administration                                           12.2.0.1.0
Oracle Locale Builder                                                12.2.0.1.0
Oracle Multimedia                                                    12.2.0.1.0
Oracle Multimedia Client Option                                      12.2.0.1.0
Oracle Multimedia Java Advanced Imaging                              12.2.0.1.0
Oracle Multimedia Locator                                            12.2.0.1.0
Oracle Multimedia Locator Java Required Support Files                12.2.0.1.0
Oracle Multimedia Locator RDBMS Files                                12.2.0.1.0
Oracle Net                                                           12.2.0.1.0
Oracle Net Listener                                                  12.2.0.1.0
Oracle Net Required Support Files                                    12.2.0.1.0
Oracle Netca Client                                                  12.2.0.1.0
Oracle Notification Service                                          12.2.0.1.0
Oracle Notification Service for Instant Client                       12.2.0.1.0
Oracle One-Off Patch Installer                                       12.2.0.1.6
Oracle Quality of Service Management (Server)                        12.2.0.1.0
Oracle RAC Deconfiguration                                           12.2.0.1.0
Oracle RAC Required Support Files-HAS                                12.2.0.1.0
Oracle Recovery Manager                                              12.2.0.1.0
Oracle Security Developer Tools                                      12.2.0.1.0
Oracle Text Required Support Files                                   12.2.0.1.0
Oracle Universal Connection Pool                                     12.2.0.1.0
Oracle Universal Installer                                           12.2.0.1.4
Oracle USM Deconfiguration                                           12.2.0.1.0
Oracle Wallet Manager                                                12.2.0.1.0
oracle.swd.commonlogging                                             13.3.0.0.0
oracle.swd.opatchautodb                                              12.2.0.1.5
oracle.swd.oui.core.min                                              12.2.0.1.4
Parser Generator Required Support Files                              12.2.0.1.0
Perl Interpreter                                                     5.22.0.0.0
Perl Modules                                                         5.22.0.0.0
PL/SQL                                                               12.2.0.1.0
PL/SQL Embedded Gateway                                              12.2.0.1.0
Platform Required Support Files                                      12.2.0.1.0
Precompiler Required Support Files                                   12.2.0.1.0
RDBMS Required Support Files                                         12.2.0.1.0
RDBMS Required Support Files for Instant Client                      12.2.0.1.0
Required Support Files                                               12.2.0.1.0
Secure Socket Layer                                                  12.2.0.1.0
SQL*Plus                                                             12.2.0.1.0
SQL*Plus Files for Instant Client                                    12.2.0.1.0
SQL*Plus Required Support Files                                      12.2.0.1.0
SSL Required Support Files for InstantClient                         12.2.0.1.0
Tomcat Container                                                     12.2.0.1.0
Tracle File Analyzer                                                 12.2.0.1.0
Universal Storage Manager Files                                      12.2.0.1.0
XDK Required Support Files                                           12.2.0.1.0
XML Parser for Java                                                  12.2.0.1.0
There are 99 products installed in this Oracle Home.


There are no Interim patches installed in this Oracle Home.


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

OPatch succeeded.

4、升级db1

Oracle RAC, where the GI home and the database homes are not shared and Oracle ACFS file system is not configured.

As root user, execute the following command on each node of the cluster:

# <GI_HOME>/OPatch/opatchauto apply <UNZIPPED_PATCH_LOCATION>/32928749
[root@db1 soft]# /u01/app/12.2.0/grid/OPatch/opatchauto apply /soft/32928749

OPatchauto session is initiated at Sun Jan  9 07:25:22 2022

System initialization log file is /u01/app/12.2.0/grid/cfgtoollogs/opatchautodb/systemconfig2022-01-09_07-25-24AM.log.

Session log file is /u01/app/12.2.0/grid/cfgtoollogs/opatchauto/opatchauto2022-01-09_07-25-56AM.log
The id for this session is LNE4

Executing OPatch prereq operations to verify patch applicability on home /u01/app/oracle/product/12.2.0/db

Executing OPatch prereq operations to verify patch applicability on home /u01/app/12.2.0/grid
Patch applicability verified successfully on home /u01/app/12.2.0/grid

Patch applicability verified successfully on home /u01/app/oracle/product/12.2.0/db


Executing patch validation checks on home /u01/app/12.2.0/grid
Patch validation checks successfully completed on home /u01/app/12.2.0/grid


Executing patch validation checks on home /u01/app/oracle/product/12.2.0/db
Patch validation checks successfully completed on home /u01/app/oracle/product/12.2.0/db


Verifying SQL patch applicability on home /u01/app/oracle/product/12.2.0/db
SQL patch applicability verified successfully on home /u01/app/oracle/product/12.2.0/db


Preparing to bring down database service on home /u01/app/oracle/product/12.2.0/db
Successfully prepared home /u01/app/oracle/product/12.2.0/db to bring down database service


Performing prepatch operations on CRS - bringing down CRS service on home /u01/app/12.2.0/grid
Prepatch operation log file location: /u01/app/grid/crsdata/db1/crsconfig/crspatch_db1_2022-01-09_07-27-03AM.log
CRS service brought down successfully on home /u01/app/12.2.0/grid


Performing prepatch operation on home /u01/app/oracle/product/12.2.0/db
Perpatch operation completed successfully on home /u01/app/oracle/product/12.2.0/db


Start applying binary patch on home /u01/app/oracle/product/12.2.0/db
Binary patch applied successfully on home /u01/app/oracle/product/12.2.0/db


Performing postpatch operation on home /u01/app/oracle/product/12.2.0/db
Postpatch operation completed successfully on home /u01/app/oracle/product/12.2.0/db


Start applying binary patch on home /u01/app/12.2.0/grid
Binary patch applied successfully on home /u01/app/12.2.0/grid


Performing postpatch operations on CRS - starting CRS service on home /u01/app/12.2.0/grid
Postpatch operation log file location: /u01/app/grid/crsdata/db1/crsconfig/crspatch_db1_2022-01-09_07-41-49AM.log
CRS service started successfully on home /u01/app/12.2.0/grid


Preparing home /u01/app/oracle/product/12.2.0/db after database service restarted
No step execution required.........
 

Trying to apply SQL patch on home /u01/app/oracle/product/12.2.0/db
SQL patch applied successfully on home /u01/app/oracle/product/12.2.0/db

OPatchAuto successful.

--------------------------------Summary--------------------------------

Patching is completed successfully. Please find the summary as follows:

Host:db1
RAC Home:/u01/app/oracle/product/12.2.0/db
Version:12.2.0.1.0
Summary:

==Following patches were SKIPPED:

Patch: /soft/32928749/33116894
Reason: This patch is not applicable to this specified target type - "rac_database"

Patch: /soft/32928749/26839277
Reason: This patch is not applicable to this specified target type - "rac_database"

Patch: /soft/32928749/32918082
Reason: This patch is not applicable to this specified target type - "rac_database"


==Following patches were SUCCESSFULLY applied:

Patch: /soft/32928749/31802727
Log: /u01/app/oracle/product/12.2.0/db/cfgtoollogs/opatchauto/core/opatch/opatch2022-01-09_07-30-31AM_1.log

Patch: /soft/32928749/32916808
Log: /u01/app/oracle/product/12.2.0/db/cfgtoollogs/opatchauto/core/opatch/opatch2022-01-09_07-30-31AM_1.log


Host:db1
CRS Home:/u01/app/12.2.0/grid
Version:12.2.0.1.0
Summary:

==Following patches were SUCCESSFULLY applied:

Patch: /soft/32928749/26839277
Log: /u01/app/12.2.0/grid/cfgtoollogs/opatchauto/core/opatch/opatch2022-01-09_07-35-54AM_1.log

Patch: /soft/32928749/31802727
Log: /u01/app/12.2.0/grid/cfgtoollogs/opatchauto/core/opatch/opatch2022-01-09_07-35-54AM_1.log

Patch: /soft/32928749/32916808
Log: /u01/app/12.2.0/grid/cfgtoollogs/opatchauto/core/opatch/opatch2022-01-09_07-35-54AM_1.log

Patch: /soft/32928749/32918082
Log: /u01/app/12.2.0/grid/cfgtoollogs/opatchauto/core/opatch/opatch2022-01-09_07-35-54AM_1.log

Patch: /soft/32928749/33116894
Log: /u01/app/12.2.0/grid/cfgtoollogs/opatchauto/core/opatch/opatch2022-01-09_07-35-54AM_1.log



OPatchauto session completed at Sun Jan  9 07:56:27 2022
Time taken to complete the session 31 minutes, 5 seconds

📢 注意:查看软件升级结果

[grid@db1 ~]$ $ORACLE_HOME/OPatch/opatch lspatches
33116894;ACFS JUL 2021 RELEASE UPDATE 12.2.0.1.210720 (33116894)
32918082;TOMCAT RELEASE UPDATE 12.2.0.1.0(ID:RELEASE) (32918082)
32916808;Database Jul 2021 Release Update : 12.2.0.1.210720 (32916808)
31802727;OCW OCT 2020 RELEASE UPDATE 12.2.0.1.201020 (31802727)
26839277;DBWLM RELEASE UPDATE 12.2.0.1.0(ID:170913) (26839277)

OPatch succeeded.
[oracle@db1 ~]$ $ORACLE_HOME/OPatch/opatch lspatches
32916808;Database Jul 2021 Release Update : 12.2.0.1.210720 (32916808)
31802727;OCW OCT 2020 RELEASE UPDATE 12.2.0.1.201020 (31802727)

OPatch succeeded.

5、升级db2

[root@db2 soft]# /u01/app/12.2.0/grid/OPatch/opatchauto apply /soft/32928749

OPatchauto session is initiated at Sun Jan  9 08:02:27 2022

System initialization log file is /u01/app/12.2.0/grid/cfgtoollogs/opatchautodb/systemconfig2022-01-09_08-02-30AM.log.

Session log file is /u01/app/12.2.0/grid/cfgtoollogs/opatchauto/opatchauto2022-01-09_08-02-50AM.log
The id for this session is SMH8

Executing OPatch prereq operations to verify patch applicability on home /u01/app/oracle/product/12.2.0/db

Executing OPatch prereq operations to verify patch applicability on home /u01/app/12.2.0/grid
Patch applicability verified successfully on home /u01/app/oracle/product/12.2.0/db

Patch applicability verified successfully on home /u01/app/12.2.0/grid


Executing patch validation checks on home /u01/app/12.2.0/grid
Patch validation checks successfully completed on home /u01/app/12.2.0/grid


Executing patch validation checks on home /u01/app/oracle/product/12.2.0/db
Patch validation checks successfully completed on home /u01/app/oracle/product/12.2.0/db


Verifying SQL patch applicability on home /u01/app/oracle/product/12.2.0/db
SQL patch applicability verified successfully on home /u01/app/oracle/product/12.2.0/db


Preparing to bring down database service on home /u01/app/oracle/product/12.2.0/db
Successfully prepared home /u01/app/oracle/product/12.2.0/db to bring down database service


Performing prepatch operations on CRS - bringing down CRS service on home /u01/app/12.2.0/grid
Prepatch operation log file location: /u01/app/grid/crsdata/db2/crsconfig/crspatch_db2_2022-01-09_08-03-56AM.log
CRS service brought down successfully on home /u01/app/12.2.0/grid


Performing prepatch operation on home /u01/app/oracle/product/12.2.0/db
Perpatch operation completed successfully on home /u01/app/oracle/product/12.2.0/db


Start applying binary patch on home /u01/app/oracle/product/12.2.0/db
Binary patch applied successfully on home /u01/app/oracle/product/12.2.0/db


Performing postpatch operation on home /u01/app/oracle/product/12.2.0/db
Postpatch operation completed successfully on home /u01/app/oracle/product/12.2.0/db


Start applying binary patch on home /u01/app/12.2.0/grid
Binary patch applied successfully on home /u01/app/12.2.0/grid


Performing postpatch operations on CRS - starting CRS service on home /u01/app/12.2.0/grid
Postpatch operation log file location: /u01/app/grid/crsdata/db2/crsconfig/crspatch_db2_2022-01-09_08-14-48AM.log
CRS service started successfully on home /u01/app/12.2.0/grid


Preparing home /u01/app/oracle/product/12.2.0/db after database service restarted
No step execution required.........
 

Trying to apply SQL patch on home /u01/app/oracle/product/12.2.0/db
SQL patch applied successfully on home /u01/app/oracle/product/12.2.0/db

OPatchAuto successful.

--------------------------------Summary--------------------------------

Patching is completed successfully. Please find the summary as follows:

Host:db2
RAC Home:/u01/app/oracle/product/12.2.0/db
Version:12.2.0.1.0
Summary:

==Following patches were SKIPPED:

Patch: /soft/32928749/33116894
Reason: This patch is not applicable to this specified target type - "rac_database"

Patch: /soft/32928749/26839277
Reason: This patch is not applicable to this specified target type - "rac_database"

Patch: /soft/32928749/32918082
Reason: This patch is not applicable to this specified target type - "rac_database"


==Following patches were SUCCESSFULLY applied:

Patch: /soft/32928749/31802727
Log: /u01/app/oracle/product/12.2.0/db/cfgtoollogs/opatchauto/core/opatch/opatch2022-01-09_08-05-12AM_1.log

Patch: /soft/32928749/32916808
Log: /u01/app/oracle/product/12.2.0/db/cfgtoollogs/opatchauto/core/opatch/opatch2022-01-09_08-05-12AM_1.log


Host:db2
CRS Home:/u01/app/12.2.0/grid
Version:12.2.0.1.0
Summary:

==Following patches were SUCCESSFULLY applied:

Patch: /soft/32928749/26839277
Log: /u01/app/12.2.0/grid/cfgtoollogs/opatchauto/core/opatch/opatch2022-01-09_08-08-59AM_1.log

Patch: /soft/32928749/31802727
Log: /u01/app/12.2.0/grid/cfgtoollogs/opatchauto/core/opatch/opatch2022-01-09_08-08-59AM_1.log

Patch: /soft/32928749/32916808
Log: /u01/app/12.2.0/grid/cfgtoollogs/opatchauto/core/opatch/opatch2022-01-09_08-08-59AM_1.log

Patch: /soft/32928749/32918082
Log: /u01/app/12.2.0/grid/cfgtoollogs/opatchauto/core/opatch/opatch2022-01-09_08-08-59AM_1.log

Patch: /soft/32928749/33116894
Log: /u01/app/12.2.0/grid/cfgtoollogs/opatchauto/core/opatch/opatch2022-01-09_08-08-59AM_1.log



OPatchauto session completed at Sun Jan  9 08:24:14 2022
Time taken to complete the session 21 minutes, 47 seconds

📢 注意:查看软件升级结果

[grid@db2 ~]$ $ORACLE_HOME/OPatch/opatch lspatches
33116894;ACFS JUL 2021 RELEASE UPDATE 12.2.0.1.210720 (33116894)
32918082;TOMCAT RELEASE UPDATE 12.2.0.1.0(ID:RELEASE) (32918082)
32916808;Database Jul 2021 Release Update : 12.2.0.1.210720 (32916808)
31802727;OCW OCT 2020 RELEASE UPDATE 12.2.0.1.201020 (31802727)
26839277;DBWLM RELEASE UPDATE 12.2.0.1.0(ID:170913) (26839277)

OPatch succeeded.
[oracle@db2 ~]$ $ORACLE_HOME/OPatch/opatch lspatches
32916808;Database Jul 2021 Release Update : 12.2.0.1.210720 (32916808)
31802727;OCW OCT 2020 RELEASE UPDATE 12.2.0.1.201020 (31802727)

OPatch succeeded.

6、更改权限

📢 注意:db1和db2上Patch: /soft/32928749/32916808时候,日志文件产生error告警信息如下:

Patch: /soft/32928749/32916808
Log: /u01/app/oracle/product/12.2.0/db/cfgtoollogs/opatchauto/core/opatch/opatch2022-01-09_08-05-12AM_1.log
/u01/app/oracle/product/12.2.0/db/bin/extjobO
[Jan 9, 2022 8:08:47 AM] [WARNING]  OUI-67215:
                                    OPatch found the word "error" in the stderr of the make command.
                                    Please look at this stderr. You can re-run this make command.
                                    Stderr output:
                                    chmod: changing permissions of/u01/app/oracle/product/12.2.0/db/bin/extjobO’: Operation not permitted
                                    make: [iextjob] Error 1 (ignored)

📢 注意:db1和db2修改extjobO的权限

/u01/app/oracle/product/12.2.0/db/bin/extjobO
ll /u01/app/oracle/product/12.2.0/db/bin/extjobO
-rwsr-x--- 1 root oinstall 2241464 Jan  9 04:47 /u01/app/oracle/product/12.2.0/db/bin/extjobO
chown oracle:oinstall /u01/app/oracle/product/12.2.0/db/bin/extjobO
 ll /u01/app/oracle/product/12.2.0/db/bin/extjobO
-rwxr-x--- 1 oracle oinstall 2241464 Jan  9 04:47 /u01/app/oracle/product/12.2.0/db/bin/extjobO

7、查看集群状态

crsctl stat res -t
--------------------------------------------------------------------------------
Name           Target  State        Server                   State details       
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.ASMNET1LSNR_ASM.lsnr
               ONLINE  ONLINE       db1                      STABLE
               ONLINE  ONLINE       db2                      STABLE
ora.DATA.dg
               ONLINE  ONLINE       db1                      STABLE
               ONLINE  ONLINE       db2                      STABLE
ora.LISTENER.lsnr
               ONLINE  ONLINE       db1                      STABLE
               ONLINE  ONLINE       db2                      STABLE
ora.OCR.dg
               ONLINE  ONLINE       db1                      STABLE
               ONLINE  ONLINE       db2                      STABLE
ora.chad
               ONLINE  ONLINE       db1                      STABLE
               ONLINE  ONLINE       db2                      STABLE
ora.net1.network
               ONLINE  ONLINE       db1                      STABLE
               ONLINE  ONLINE       db2                      STABLE
ora.ons
               ONLINE  ONLINE       db1                      STABLE
               ONLINE  ONLINE       db2                      STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
      1        ONLINE  ONLINE       db1                      STABLE
ora.MGMTLSNR
      1        ONLINE  ONLINE       db1                      169.254.34.153 111.1
                                                             11.111.111,STABLE
ora.asm
      1        ONLINE  ONLINE       db1                      Started,STABLE
      2        ONLINE  ONLINE       db2                      Started,STABLE
      3        OFFLINE OFFLINE                               STABLE
ora.cvu
      1        ONLINE  ONLINE       db1                      STABLE
ora.db1.vip
      1        ONLINE  ONLINE       db1                      STABLE
ora.db2.vip
      1        ONLINE  ONLINE       db2                      STABLE
ora.mgmtdb
      1        ONLINE  ONLINE       db1                      Open,STABLE
ora.orcl.db
      1        ONLINE  ONLINE       db1                      Open,HOME=/u01/app/o
                                                             racle/product/12.2.0
                                                             /db,STABLE
      2        ONLINE  ONLINE       db2                      Open,HOME=/u01/app/o
                                                             racle/product/12.2.0
                                                             /db,STABLE
ora.qosmserver
      1        ONLINE  ONLINE       db1                      STABLE
ora.scan1.vip
      1        ONLINE  ONLINE       db1                      STABLE
--------------------------------------------------------------------------------

8、Run the datapatch Utility

If this is Oracle RAC, run datapatch on only one instance.
[oracle@db1 ~]$ $ORACLE_HOME/OPatch/datapatch -verbose
SQL Patching tool version 12.2.0.1.0 Production on Sun Jan  9 08:53:03 2022
Copyright (c) 2012, 2021, Oracle.  All rights reserved.

Log file for this invocation: /u01/app/oracle/cfgtoollogs/sqlpatch/sqlpatch_24460_2022_01_09_08_53_03/sqlpatch_invocation.log

Connecting to database...OK
Bootstrapping registry and package to current versions...done
Determining current state...done

Current state of SQL patches:
Bundle series DBRU:
  ID 210720 in the binary registry and ID 210720 in the SQL registry

Adding patches to installation queue and performing prereq checks...
Installation queue:
  Nothing to roll back
  Nothing to apply

SQL Patching tool complete on Sun Jan  9 08:53:38 2022
[oracle@db1 ~]$ sqlplus / as sysdba

SQL*Plus: Release 12.2.0.1.0 Production on Sun Jan 9 08:57:58 2022

Copyright (c) 1982, 2016, Oracle.  All rights reserved.


Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

SQL> select PATCH_ID from dba_registry_sqlpatch;

  PATCH_ID
----------
  32916808

9、重新编译


SQL> @?/rdbms/admin/utlrp.sql

TIMESTAMP
--------------------------------------------------------------------------------
COMP_TIMESTAMP UTLRP_BGN              2022-01-09 08:58:39

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              2022-01-09 08:58:44

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> set line 180   
SQL> col ACTION_TIME for a15    
SQL> col ACTION for a12    
SQL> col NAMESPACE for a12    
SQL> col VERSION for a10    
SQL> col BUNDLE_SERIES for a5    
SQL> col COMMENTS for a45   
SQL> select * from dba_registry_history;   

ACTION_TIME     ACTION       NAMESPACE    VERSION            ID COMMENTS
--------------- ------------ ------------ ---------- ---------- ---------------------------------------------
                BOOTSTRAP    DATAPATCH    12.2.0.1              RDBMS_12.2.0.1.0DBJUL2021RU_LINUX.X64_210712
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值