12c gird 补丁安装,RU 补丁安装。
数据库版本:12.2.0.1.0
RU:p26133434_122010_Linux-x86-64.zip
1,
OPatch 版本检查,确认符合要求。
OPatch utility version 12.2.0.1.7 or later
For each Oracle RAC database home and the GI home that are being patched, run the following commands as the home owner to extract the OPatch utility.
$ unzip -d
$ /OPatch/opatch version
#grid soft
[oracle@prod04 ~]$ /u01/app/grid/OPatch/opatch version
OPatch Version: 12.2.0.1.14
#db soft
[oracle@prod04 ~]$ /u01/app/oracle/product/12.2.0/dbhome_1/OPatch/opatch version
OPatch Version: 12.2.0.1.14
2,解压补丁
Unzip the patch as
grid home owner
except for installations that do not have any grid homes. For installations where this patch will be applied to the Database home only, the patch needs to be unzipped as the database home owner.
$ unzip p26133434_122010_.zip
[grid@prod04 soft]$ unzip p26133434_122010_Linux-x86-64.zip
3,补丁安装(
由于本次安装是单节集群,由于bug所以添加
nonrolling参数
)
#
[root@prod04 ~]# export ORACLE_HOME=/u01/app/grid
[root@prod04 ~]# export PATH=$PATH:$ORACLE_HOME/bin:$ORACLE_HOME/OPatch
[root@prod04 ~]# opatchauto apply /soft/26133434
-nonrolling
OPatchauto session is initiated at Wed Aug 8 09:15:57 2018
System initialization log file is /u01/app/grid_home/cfgtoollogs/opatchautodb/systemconfig2018-08-08_09-16-02AM.log.
Session log file is /u01/app/grid_home/cfgtoollogs/opatchauto/opatchauto2018-08-08_09-16-12AM.log
The id for this session is LNLZ
Executing OPatch prereq operations to verify patch applicability on home /u01/app/grid_home
Executing OPatch prereq operations to verify patch applicability on home /u01/app/oracle/product/12.2.0/dbhome_1
Patch applicability verified successfully on home /u01/app/oracle/product/12.2.0/dbhome_1
Patch applicability verified successfully on home /u01/app/grid_home
Verifying SQL patch applicability on home /u01/app/oracle/product/12.2.0/dbhome_1
SQL patch applicability verified successfully on home /u01/app/oracle/product/12.2.0/dbhome_1
Preparing to bring down database service on home /u01/app/oracle/product/12.2.0/dbhome_1
Successfully prepared home /u01/app/oracle/product/12.2.0/dbhome_1 to bring down database service
Bringing down database service on home /u01/app/oracle/product/12.2.0/dbhome_1
Following database(s) and/or service(s) are stopped and will be restarted later during the session: cdb
Database service successfully brought down on home /u01/app/oracle/product/12.2.0/dbhome_1
Bringing down CRS service on home /u01/app/grid_home
Prepatch operation log file location: /u01/app/grid/crsdata/prod04/crsconfig/crspatch_prod04_2018-08-08_09-17-47AM.log
CRS service brought down successfully on home /u01/app/grid_home
Performing prepatch operation on home /u01/app/oracle/product/12.2.0/dbhome_1
Perpatch operation completed successfully on home /u01/app/oracle/product/12.2.0/dbhome_1
Start applying binary patch on home /u01/app/oracle/product/12.2.0/dbhome_1
Binary patch applied successfully on home /u01/app/oracle/product/12.2.0/dbhome_1
Performing postpatch operation on home /u01/app/oracle/product/12.2.0/dbhome_1
Postpatch operation completed successfully on home /u01/app/oracle/product/12.2.0/dbhome_1
Start applying binary patch on home /u01/app/grid_home
Binary patch applied successfully on home /u01/app/grid_home
Starting CRS service on home /u01/app/grid_home
Postpatch operation log file location: /u01/app/grid/crsdata/prod04/crsconfig/crspatch_prod04_2018-08-08_09-25-26AM.log
Failed to start CRS service on home /u01/app/grid_home
Execution of [GIStartupAction] patch action failed, check log for more details. Failures:
Patch Target : prod04->/u01/app/grid_home Type[crs]
Details: [
---------------------------Patching Failed---------------------------------
Command execution failed during patching in home: /u01/app/grid_home, host: prod04.
Command failed: /u01/app/grid_home/perl/bin/perl -I/u01/app/grid_home/perl/lib -I/u01/app/grid_home/OPatch/auto/dbtmp/bootstrap_prod04/patchwork/crs/install /u01/app/grid_home/OPatch/auto/dbtmp/bootstrap_prod04/patchwork/crs/install/rootcrs.pl -postpatch -nonrolling
Command failure output:
Using configuration parameter file: /u01/app/grid_home/OPatch/auto/dbtmp/bootstrap_prod04/patchwork/crs/install/crsconfig_params
The log of current session can be found at:
/u01/app/grid/crsdata/prod04/crsconfig/crspatch_prod04_2018-08-08_09-25-26AM.log
2018/08/08 09:25:38 CLSRSC-4015: Performing install or upgrade action for Oracle Trace File Analyzer (TFA) Collector.
2018/08/08 09:25:58 CLSRSC-4003: Successfully patched Oracle Trace File Analyzer (TFA) Collector.
2018/08/08 09:26:02 CLSRSC-329: Replacing Clusterware entries in file 'oracle-ohasd.service'
2018/08/08 09:26:19 CLSRSC-180: An error occurred while executing the command '/u01/app/grid_home/bin/asmcmd afd_scan'
After fixing the cause of failure Run opatchauto resume
]
OPATCHAUTO-68061: The orchestration engine failed.
OPATCHAUTO-68061: The orchestration engine failed with return code 1
OPATCHAUTO-68061: Check the log for more details.
OPatchAuto failed.
OPatchauto session completed at Wed Aug 8 09:26:21 2018
Time taken to complete the session 10 minutes, 24 seconds
opatchauto failed with error code 42
4,安装补丁过程中有报错
#CRS-6706: Oracle Clusterware Release patch level ('nnn') does not match Software patch level ('mmm') (文档 ID 1639285.1)
手动启动集群软件错误信息:
root@prod04 ~]# crsctl start has
CRS-6706: Oracle Clusterware Release patch level ('2873336150') does not match Software patch level ('0'). Oracle Clusterware cannot be started.
CRS-4000: Command Start failed, or completed with errors.
解决方式:
[root@prod04 ~]# /u01/app/grid
grid/ grid_base/
[root@prod04 ~]# /u01/app/grid/bin/clscfg -localpatch
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
[root@prod04 ~]# /u01/app/grid/crs/install/rootcrs.sh -lock
Using configuration parameter file: /u01/app/grid/crs/install/crsconfig_params
The log of current session can be found at:
/u01/app/grid_base/crsdata/prod04/crsconfig/crslock_prod04_2018-08-08_10-50-26AM.log
2018/08/08 10:50:31 CLSRSC-329: Replacing Clusterware entries in file 'oracle-ohasd.service'
[root@prod04 ~]# crsctl start has
CRS-4123: Oracle High Availability Services has been started.
[root@prod04 ~]#
5,检查集群软件状态和补丁情况
[grid@prod04 ~]$ crsctl check cluster
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online
[grid@prod04 ~]$ crsctl check crs
CRS-4638: Oracle High Availability Services is online
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online
[grid@prod04 ~]$ crsctl check has
CRS-4638: Oracle High Availability Services is online
[grid@prod04 ~]$ /u01/app/grid/OPatch/opatch lspatches
26123830;DATABASE RELEASE UPDATE: 12.2.0.1.170718 (26123830)
26002778;OCW Patch Set Update : 12.2.0.1.170718 (26002778)
25586399;ACFS Patch Set Update : 12.2.0.1.170718 (25586399)
[oracle@prod04 ~]$ /u01/app/oracle/product/12.2.0/dbhome_1/OPatch/opatch lspatches
26123830;DATABASE RELEASE UPDATE: 12.2.0.1.170718 (26123830)
26002778;OCW Patch Set Update : 12.2.0.1.170718 (26002778)
6,应用补丁到数据库,
Loading Modified SQL Files into the Database(
Single/Multitenant (CDB/PDB) DB
)
[oracle@prod04 ~]$ sqlplus / as sysdba
SQL*Plus: Release 12.2.0.1.0 Production on Wed Aug 8 11:13:32 2018
Copyright (c) 1982, 2016, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup
ORACLE instance started.
Total System Global Area 2466250752 bytes
Fixed Size
8795760 bytes
Variable Size
805308816 bytes
Database Buffers
1644167168 bytes
Redo Buffers
7979008 bytes
Database mounted.
Database opened.
SQL> show pdbs;
CON_ID CON_NAME
OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED
READ ONLY NO
3 PDB01
MOUNTED
SQL> alter pluggable database all open
2 ;
Pluggable database altered.
SQL> show pdbs;
CON_ID CON_NAME
OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED
READ ONLY NO
3 PDB01
READ WRITE NO
SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
[oracle@prod04 ~]$ /u01/app/oracle/product/12.2.0/dbhome_1/OPatch/datapatch -verbose
SQL Patching tool version 12.2.0.1.0 Production on Wed Aug 8 11:15:00 2018
Copyright (c) 2012, 2017, Oracle. All rights reserved.
Log file for this invocation: /u01/app/oracle/cfgtoollogs/sqlpatch/sqlpatch_19692_2018_08_08_11_15_00/sqlpatch_invocation.log
Connecting to database...OK
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 SQL patches:
Bundle series DBRU:
ID 170718 in the binary registry and not installed in any PDB
Adding patches to installation queue and performing prereq checks...
Installation queue:
For the following PDBs: CDB$ROOT PDB$SEED PDB01
Nothing to roll back
The following patches will be applied:
26123830 (DATABASE RELEASE UPDATE 12.2.0.1.170718)
Installing patches...
Patch installation complete. Total patches installed: 3
Validating logfiles...
Patch 26123830 apply (pdb CDB$ROOT): SUCCESS
logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/26123830/21405588/26123830_apply_CDB_CDBROOT_2018Aug08_11_15_40.log (no errors)
Patch 26123830 apply (pdb PDB$SEED): SUCCESS
logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/26123830/21405588/26123830_apply_CDB_PDBSEED_2018Aug08_11_16_43.log (no errors)
Patch 26123830 apply (pdb PDB01): SUCCESS
logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/26123830/21405588/26123830_apply_CDB_PDB01_2018Aug08_11_16_43.log (no errors)
SQL Patching tool complete on Wed Aug 8 11:17:39 2018
7,补丁查询
select patch_id,action,status,BUNDLE_SERIES from dba_registry_sqlpatch;