Mô tả:-
Trong bài viết này tôi sẽ hướng dẫn Step by step Apply Rolling PSU Patch lên 19.3 cả homes Grid và Oracle trong Oracle Database 19c RAC
Thông tin Patch:-
Patch 30087906 – Database Release Update Revision 19.3.2.0.191015
Bước 1: Chi tiết môi trường
export ORACLE_HOME=/u01/app/19c/grid
export PATH=/u01/app/19c/grid/bin:$PATH
[oracle@rac1 ~]$ srvctl config database -verbose
oradbwr /u01/app/oracle/product/19c/dbhome_1 19.0.0.0.0
[oracle@rac1 ~]$ crsctl query crs softwareversion -all
Oracle Clusterware version on node [rac1] is [19.0.0.0.0]
Oracle Clusterware version on node [rac2] is [19.0.0.0.0]
[oracle@rac1 ~]$ cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.7 (Maipo)
[oracle@rac1 ~]$ uname -sr
Linux 4.1.12-124.34.1.el7uek.x86_64
Bước 2: Yêu cầu
OPatch từ phiên bản 12.2.0.1.17 trở lên mới có thể apply được patch này. Oracle khuyến nghị sử dụng OPatch mới nhất cho 19c.
[oracle@rac1 ~]$ $ORACLE_HOME/OPatch/opatch version
OPatch Version: 12.2.0.1.17
OPatch succeeded.
Chú ý:- Không cần nâng cấp OPatch.
Bước 3: Kiểm tra Oracle Inventory
. .grid.env
$ORACLE_HOME/OPatch/opatch lsinventory -detail -oh $GRID_HOME
SQL> select PATCH_ID,ACTION,STATUS from dba_registry_sqlpatch;
PATCH_ID ACTION STATUS
———- ————— ————————-
29517242 APPLY SUCCESS
Bước 4: Download và Unzip Patch
Download the Patch 30087906 – Database Release Update Revision 19.3.2.0.191015 từ Oracle support và copy lên server.
[root@rac1 u01]# unzip p30135696_190000_Linux-x86-64.zip
[root@rac1 u01]# chmod 775 p30135696_190000_Linux-x86-64.zip
Bước 5: Chạy OPatch để check Conflict
$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /u01/30135696/30087906
$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /u01/30135696/29585399
$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /u01/30135696/29517247
$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /u01/30135696/
$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /u01/30135696/29401763
Ví dụ mẫu:-
[oracle@rac1 ~]$ $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /u01/30135696/29401763
Oracle Interim Patch Installer version 12.2.0.1.17
Copyright (c) 2019, Oracle Corporation. All rights reserved.
PREREQ session
Oracle Home : /u01/app/19c/grid
Central Inventory : /u01/app/oraInventory
from : /u01/app/19c/grid/oraInst.loc
OPatch version : 12.2.0.1.17
OUI version : 12.2.0.7.0
Log file location : /u01/app/19c/grid/cfgtoollogs/opatch/opatch2019-12-27_23-58-19PM_1.log
Invoking prereq “checkconflictagainstohwithdetail”
Prereq “checkConflictAgainstOHWithDetail” passed.
Bước 6: Chạy OPatch để check dung lượng trống cần thiết cả homes Grid và Oracle
Check nếu đủ dung lượng trong ORACLE_HOME để sẵn sàng patch
NODE 1
Bước 7: Sử dụng opatchauto applying
Tiện ích Opatch sẽ tự động patch cho Oracle Grid Infrastructure (GI) home và Oracle RAC database homes. Nó sẽ lấy các cấu hình đã tồn tại và tự động patch cần thiết của Oracle RAC database home và GI home.
Chú ý:- Câu lệnh bên dưới sẽ apply patch cả homes Grid và Oracle trên node 1.
[root@rac1 ~]# export PATH=$PATH:/u01/app/19c/grid/OPatch
[root@rac1 ~]# opatchauto apply /u01/30135696 (trong đó /u01/30135696 là đường dẫn chứa thư mục patch)
OPatchauto session is initiated at Sat Dec 28 00:04:53 2019
System initialization log file is /u01/app/19c/grid/cfgtoollogs/opatchautodb/systemconfig2019-12-28_12-05-10AM.log.
Session log file is /u01/app/19c/grid/cfgtoollogs/opatchauto/opatchauto2019-12-28_12-12-57AM.log
The id for this session is BQ6L
Executing OPatch prereq operations to verify patch applicability on home /u01/app/19c/grid
Executing OPatch prereq operations to verify patch applicability on home /u01/app/oracle/product/19c/dbhome_1
Patch applicability verified successfully on home /u01/app/19c/grid
Patch applicability verified successfully on home /u01/app/oracle/product/19c/dbhome_1
Verifying SQL patch applicability on home /u01/app/oracle/product/19c/dbhome_1
SQL patch applicability verified successfully on home /u01/app/oracle/product/19c/dbhome_1
Preparing to bring down database service on home /u01/app/oracle/product/19c/dbhome_1
Successfully prepared home /u01/app/oracle/product/19c/dbhome_1 to bring down database service
Bringing down CRS service on home /u01/app/19c/grid
CRS service brought down successfully on home /u01/app/19c/grid
Performing prepatch operation on home /u01/app/oracle/product/19c/dbhome_1
Perpatch operation completed successfully on home /u01/app/oracle/product/19c/dbhome_1
Start applying binary patch on home /u01/app/oracle/product/19c/dbhome_1
Binary patch applied successfully on home /u01/app/oracle/product/19c/dbhome_1
Performing postpatch operation on home /u01/app/oracle/product/19c/dbhome_1
Postpatch operation completed successfully on home /u01/app/oracle/product/19c/dbhome_1
Start applying binary patch on home /u01/app/19c/grid
Binary patch applied successfully on home /u01/app/19c/grid
Starting CRS service on home /u01/app/19c/grid
CRS service started successfully on home /u01/app/19c/grid
Preparing home /u01/app/oracle/product/19c/dbhome_1 after database service restarted
No step execution required………
Trying to apply SQL patch on home /u01/app/oracle/product/19c/dbhome_1
SQL patch applied successfully on home /u01/app/oracle/product/19c/dbhome_1
OPatchAuto successful.
——————————–Summary——————————–
Patching is completed successfully. Please find the summary as follows:
Host:rac1
RAC Home:/u01/app/oracle/product/19c/dbhome_1
Version:19.0.0.0.0
Summary:
==Following patches were SKIPPED:
Patch: /u01/30135696/29517247
Reason: This patch is not applicable to this specified target type – “rac_database”
Patch: /u01/30135696/29401763
Reason: This patch is not applicable to this specified target type – “rac_database”
Patch: /u01/30135696/29585399
Reason: This patch is already been applied, so not going to apply again.
==Following patches were SUCCESSFULLY applied:
Patch: /u01/30135696/30087906
Log: /u01/app/oracle/product/19c/dbhome_1/cfgtoollogs/opatchauto/core/opatch/opatch2019-12-28_00-22-26AM_1.log
Host:rac1
CRS Home:/u01/app/19c/grid
Version:19.0.0.0.0
Summary:
==Following patches were SKIPPED:
Patch: /u01/30135696/29585399
Reason: This patch is already been applied, so not going to apply again.
Patch: /u01/30135696/29517247
Reason: This patch is already been applied, so not going to apply again.
Patch: /u01/30135696/29401763
Reason: This patch is already been applied, so not going to apply again.
==Following patches were SUCCESSFULLY applied:
Patch: /u01/30135696/30087906
Log: /u01/app/19c/grid/cfgtoollogs/opatchauto/core/opatch/opatch2019-12-28_00-29-08AM_1.log
OPatchauto session completed at Sat Dec 28 00:48:56 2019
Time taken to complete the session 44 minutes, 3 seconds
Kiểm tra log
tail -f /u01/app/19c/grid/cfgtoollogs/opatchautodb/systemconfig2019-12-28_12-05-10AM.log
Bước 8: Copy thư mục patch từ node 1 sang node 2
[root@rac1 u01]# scp -rp 30135696 root@rac2:/u01
[root@rac2 u01]# chown -R oracle:oinstall 30135696/
[root@rac2 u01]# chown 775 30135696
NODE 2
Bước 9: Bật apply trên node 2
[root@rac2 30135696]# export PATH=$PATH:/u01/app/19c/grid/OPatch
[root@rac2 30135696]# opatchauto apply /u01/30135696
OPatchauto session is initiated at Sat Dec 28 01:33:26 2019
System initialization log file is /u01/app/19c/grid/cfgtoollogs/opatchautodb/systemconfig2019-12-28_01-33-35AM.log.
Session log file is /u01/app/19c/grid/cfgtoollogs/opatchauto/opatchauto2019-12-28_01-42-11AM.log
The id for this session is PXNA
Executing OPatch prereq operations to verify patch applicability on home /u01/app/19c/grid
Executing OPatch prereq operations to verify patch applicability on home /u01/app/oracle/product/19c/dbhome_1
Patch applicability verified successfully on home /u01/app/19c/grid
Patch applicability verified successfully on home /u01/app/oracle/product/19c/dbhome_1
Verifying SQL patch applicability on home /u01/app/oracle/product/19c/dbhome_1
SQL patch applicability verified successfully on home /u01/app/oracle/product/19c/dbhome_1
Preparing to bring down database service on home /u01/app/oracle/product/19c/dbhome_1
Successfully prepared home /u01/app/oracle/product/19c/dbhome_1 to bring down database service
Bringing down CRS service on home /u01/app/19c/grid
CRS service brought down successfully on home /u01/app/19c/grid
Performing prepatch operation on home /u01/app/oracle/product/19c/dbhome_1
Perpatch operation completed successfully on home /u01/app/oracle/product/19c/dbhome_1
Start applying binary patch on home /u01/app/oracle/product/19c/dbhome_1
Binary patch applied successfully on home /u01/app/oracle/product/19c/dbhome_1
Performing postpatch operation on home /u01/app/oracle/product/19c/dbhome_1
Postpatch operation completed successfully on home /u01/app/oracle/product/19c/dbhome_1
Start applying binary patch on home /u01/app/19c/grid
Binary patch applied successfully on home /u01/app/19c/grid
Starting CRS service on home /u01/app/19c/grid
CRS service started successfully on home /u01/app/19c/grid
Preparing home /u01/app/oracle/product/19c/dbhome_1 after database service restarted
No step execution required………
Trying to apply SQL patch on home /u01/app/oracle/product/19c/dbhome_1
SQL patch applied successfully on home /u01/app/oracle/product/19c/dbhome_1
OPatchAuto successful.
——————————–Summary——————————–
Patching is completed successfully. Please find the summary as follows:
Host:rac2
RAC Home:/u01/app/oracle/product/19c/dbhome_1
Version:19.0.0.0.0
Summary:
==Following patches were SKIPPED:
Patch: /u01/30135696/29517247
Reason: This patch is not applicable to this specified target type – “rac_database”
Patch: /u01/30135696/29401763
Reason: This patch is not applicable to this specified target type – “rac_database”
Patch: /u01/30135696/29585399
Reason: This patch is already been applied, so not going to apply again.
==Following patches were SUCCESSFULLY applied:
Patch: /u01/30135696/30087906
Log: /u01/app/oracle/product/19c/dbhome_1/cfgtoollogs/opatchauto/core/opatch/opatch2019-12-28_01-51-10AM_1.log
Host:rac2
CRS Home:/u01/app/19c/grid
Version:19.0.0.0.0
Summary:
==Following patches were SKIPPED:
Patch: /u01/30135696/29585399
Reason: This patch is already been applied, so not going to apply again.
Patch: /u01/30135696/29517247
Reason: This patch is already been applied, so not going to apply again.
Patch: /u01/30135696/29401763
Reason: This patch is already been applied, so not going to apply again.
==Following patches were SUCCESSFULLY applied:
Patch: /u01/30135696/30087906
Log: /u01/app/19c/grid/cfgtoollogs/opatchauto/core/opatch/opatch2019-12-28_01-59-10AM_1.log
OPatchauto session completed at Sat Dec 28 02:29:38 2019
Time taken to complete the session 56 minutes, 13 seconds
Bước 10: Patch Post-Installation
[oracle@rac1 ~]$ . .db.env
[oracle@rac1 ~]$ sqlplus / as sysdba
SQL*Plus: Release 19.0.0.0.0 – Production on Sat Dec 28 02:41:16 2019
Version 19.3.2.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 – Production
Version 19.3.2.0.0
SQL> SELECT description,ACTION,STATUS,TARGET_BUILD_TIMESTAMP from dba_registry_sqlpatch;
DESCRIPTION ACTION STATUS TARGET_BUILD_TIMESTAMP
————— ————— ——— ————————-
Database Release Update : 19.3.0.0.190416 (29517242)
APPLY SUCCESS
10-APR-19 12.27.20.000000 PM
Database Release Update Revision : 19.3.2.0.191015 (30087906)
APPLY SUCCESS
29-AUG-19 07.21.37.000000 PM
Từ mức Server check:
[oracle@rac1 ~]$ $ORACLE_HOME/OPatch/opatch lsinventory -oh $ORACLE_HOME | grep 30087906
Patch 30087906 : applied on Sat Dec 28 00:25:06 IST 2019
Patch description: “Database Release Update Revision : 19.3.2.0.191015 (30087906)”
[oracle@rac1 ~]$ crsctl query crs releasepatch
Oracle Clusterware release patch level is [1141955458] and the complete list of patches [29401763 29517242 29517247 29585399 30087906 ] have been applied on the local node. The release patch string is [19.3.2.0.0].
[oracle@rac2 ~]$ crsctl query crs releasepatch
Oracle Clusterware release patch level is [1141955458] and the complete list of patches [29401763 29517242 29517247 29585399 30087906 ] have been applied on the local node. The release patch string is [19.3.2.0.0].
Bước11: Bất kỳ database có invalid objects sau khi thực hiệndatapatch nên dùng utlrp.sql để chạy valid lại những object đó
cd $ORACLE_HOME/rdbms/admin
sqlplus /nolog
SQL> CONNECT / AS SYSDBA
SQL> @utlrp.sql
Hy vọng hữu ích cho bạn.
* KHOÁ HỌC ORACLE DATABASE A-Z ENTERPRISE trực tiếp từ tôi giúp bạn bước đầu trở thành những chuyên gia DBA, đủ kinh nghiệm đi thi chứng chỉ OA/OCP, đặc biệt là rất nhiều kinh nghiệm, bí kíp thực chiến trên các hệ thống Core tại VN chỉ sau 1 khoá học.
* CÁCH ĐĂNG KÝ: Gõ (.) hoặc để lại số điện thoại hoặc inbox https://m.me/tranvanbinh.vn hoặc Hotline/Zalo 090.29.12.888
* Chi tiết tham khảo:
https://bit.ly/oaz_w
=============================
KẾT NỐI VỚI CHUYÊN GIA TRẦN VĂN BÌNH:
📧 Mail: binhoracle@gmail.com
☎️ Mobile: 0902912888
⚡️ Skype: tranbinh48ca
👨 Facebook: https://www.facebook.com/BinhOracleMaster
👨 Inbox Messenger: https://m.me/101036604657441 (profile)
👨 Fanpage: https://www.facebook.com/tranvanbinh.vn
👨 Inbox Fanpage: https://m.me/tranvanbinh.vn
👨👩 Group FB: https://www.facebook.com/groups/DBAVietNam
👨 Website: https://www.tranvanbinh.vn
👨 Blogger: https://tranvanbinhmaster.blogspot.com
🎬 Youtube: http://bit.ly/ytb_binhoraclemaster
👨 Tiktok: https://www.tiktok.com/@binhoraclemaster?lang=vi
👨 Linkin: https://www.linkedin.com/in/binhoracle
👨 Twitter: https://twitter.com/binhoracle
👨 Địa chỉ: Tòa nhà Sun Square - 21 Lê Đức Thọ - Phường Mỹ Đình 1 - Quận Nam Từ Liêm - TP.Hà Nội
=============================
học oracle database, Tự học Oracle, Tài liệu Oracle 12c tiếng Việt, Hướng dẫn sử dụng Oracle Database, Oracle SQL cơ bản, Oracle SQL là gì, Khóa học Oracle Hà Nội, Học chứng chỉ Oracle ở đầu, Khóa học Oracle online,khóa học pl/sql, học dba, học dba ở việt nam, khóa học dba, khóa học dba sql, tài liệu học dba oracle, Khóa học Oracle online, học oracle sql, học oracle ở đâu tphcm, học oracle bắt đầu từ đâu, học oracle ở hà nội, oracle database tutorial, oracle database 12c, oracle database là gì, oracle database 11g, oracle download, oracle database 19c, oracle dba tutorial, oracle tunning, sql tunning , oracle 12c, oracle multitenant, Container Databases (CDB), Pluggable Databases (PDB), oracle cloud, oracle security, oracle fga, audit_trail, oracle dataguard, oracle goldengate, mview, oracle exadata, oracle weblogic, middleware, hoc solaris, hoc linux, hoc aix, unix, oracle oca, oracle ocp, oracle ocm