Oracle RAC 19.3打19.5.1 RU補丁

你好我是李白發表於2020-03-10

Oracle RAC 19.3打19.5.1 RU補丁

說明:步驟來源於README整理。

1.升級opatch工具,解壓補丁包
[grid@pub19-node1 software]$ unzip -o p6880880_190000_Linux-x86-64.zip -d /u01/app/19.0.0/grid/
[grid@pub19-node1 software]$ unzip p30464035_190000_Linux-x86-64.zip
[oracle@pub19-node1 software]$ unzip -o p6880880_190000_Linux-x86-64.zip -d /u01/app/oracle/product/19.0.0/dbhome_1/
2.衝突檢測
grid使用者:
$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /software/30464035/30446054
$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /software/30464035/30554387
$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /software/30464035/30689680
$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /software/30464035/30655595
oracle使用者:
$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /software/30464035/30446054
$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /software/30464035/30554387
3.系統空間檢測
Grid Infrastructure Home,grid使用者:
建立/tmp/patch_list_gihome.txt檔案,內容如下:
cat /tmp/patch_list_gihome.txt
/software/30464035/30446054
/software/30464035/30554387
/software/30464035/30689680
/software/30464035/30655595
執行檢測:
$ORACLE_HOME/OPatch/opatch prereq CheckSystemSpace -phBaseFile /tmp/patch_list_gihome.tx
Oracle Database Home,oracle使用者:
建立/tmp/patch_list_dbhome.txt檔案,內容如下:
cat /tmp/patch_list_dbhome.txt
/software/30464035/30446054
/software/30464035/30554387
執行檢測:
$ORACLE_HOME/OPatch/opatch prereq CheckSystemSpace -phBaseFile /tmp/patch_list_dbhome.txt
4.升級補丁
Oracle RAC,GI Home與Database Home節點間不共享,ACFS沒有配置,如果配置ACFS,參考README檔案步驟操作。
root使用者,在任意節點執行:
[root@pub19-node1 software]# /u01/app/19.0.0/grid/OPatch/opatchauto apply /software/30464035

5.其實這步成功之後,經檢查只打了節點1的GI,需要繼續給節點2打GI,然後節點1 DB,節點2 DB順序打。

6.繼續給節點1 DB打補丁

root使用者:
節點1:
# /u01/app/19.0.0/grid/OPatch/opatchauto apply -oh /u01/app/19.0.0/grid /software/30464035/
# /u01/app/oracle/product/19.0.0/dbhome_1/OPatch/opatchauto apply /software/30464035/ -oh 
/u01/app/19.0.0/grid,/u01/app/oracle/product/19.0.0/dbhome_1
 
節點2:
# /u01/app/19.0.0/grid/OPatch/opatchauto apply -oh /u01/app/19.0.0/grid /software/30464035/
 
# ls -l /u01/app/oraInventory/ContentsXML/oui-patch.xml    # 一定要檢查此檔案此時許可權,否則報下面錯誤,
導致補丁corrupt,且無法回退跟再次正向應用,修改許可權,打補丁。
# /u01/app/oracle/product/19.0.0/dbhome_1/OPatch/opatchauto apply /software/30464035/ -oh 
/u01/app/19.0.0/grid,/u01/app/oracle/product/19.0.0/dbhome_1
 
Caution:
[Mar 11, 2020 8:56:05 PM] [WARNING] OUI-67124:ApplySession failed in system modification phase... '
ApplySession::apply failed: java.io.IOException: oracle.sysman.oui.patch.PatchException: 
java.io.FileNotFoundException: /u01/app/oraInventory/ContentsXML/oui-patch.xml (Permission denied)'
解決:
/* 按照日誌輸出,賦權
# chmod 664 /u01/app/oraInventory/ContentsXML/oui-patch.xml
/* 執行restore.sh,最後還是失敗,其實可以用resume方法,繼續打,或者採取笨辦法採取手工複製軟體,加回滾的辦法
# /u01/app/oracle/product/19.0.0/dbhome_1/OPatch/opatchauto resume /software/30464035/ -oh 
/u01/app/oracle/product/19.0.0/dbhome_1
/* 按照失敗提示,哪些檔案不存在,將對應補丁解壓資料夾中複製到ORACLE_HOME指定目錄中,繼續回滾,直到成功回滾。
再次給節點2 oracle軟體打補丁:
# /u01/app/oracle/product/19.0.0/dbhome_1/OPatch/opatchauto apply /software/30464035/ -oh 
/u01/app/19.0.0/grid,/u01/app/oracle/product/19.0.0/dbhome_1
 
驗證補丁:
$ /u01/app/19.0.0/grid/OPatch/opatch lsinv
$ /u01/app/oracle/product/19.0.0/dbhome_1/OPatch/opatch lsinv
# su – grid
$ kfod op=patches
$ kfod op=patchlvl


5.如果配置DG,DG先打補丁

For Data Guard Standby-First patching, see My Oracle Support Document 1265700.1. 
For Standby-First patching for Oracle Database RU 12.2 and higher, the following points need to be 
considered:
The Database RU subpatch 30446054 must be applied to the Data Guard standby using Opatch.
Datapatch must not be invoked on the Data Guard standby environment to apply post patch SQL 
actions for the Database RU. 
If datapatch is run on a standby, it will error while trying to call the SYS.DBMS_QOPATCH interface. 
For more details about this error, see My Oracle Support Document 1599479.1.
Datapatch must be invoked on the primary database after all the databases, that is primary and Data Guard, 
are patched and patch deployment of the Database RU is complete for the setup
7.datapatch/utlrp.sql
The datapatch utility will then run the necessary apply scripts to load the modified SQL files into the database.
An entry will be added to the dba_registry_sqlpatch view reflecting the patch application.
In the dba_registry_sqlpatch view, verify the Status for the APPLY is "SUCCESS".
Single/Multitenant (CDB/PDB) DB
sqlplus /nolog
SQL> Connect / as sysdba
SQL> startup
SQL> alter pluggable database all open;
SQL> quit
cd $ORACLE_HOME/OPatch
./datapatch -verbose
檢查是否有錯誤:
Check the following log files in $ORACLE_BASE/cfgtoollogs/sqlpatch/30446054/<unique patch ID> for errors:
Any databases that have invalid objects after the execution of datapatch should have utlrp.sql run to revalidate those objects.
For example:
cd $ORACLE_HOME/rdbms/admin
sqlplus /nolog
SQL> CONNECT / AS SYSDBA
SQL> @utlrp.sql
8.Upgrade Oracle Recovery Manager Catalog
$ rman catalog username/password@alias
RMAN> UPGRADE CATALOG;
RMAN> UPGRADE CATALOG;
RMAN> EXIT;
9.回退補丁
Oracle RAC,GI Home與Database Home節點間不共享,ACFS沒有配置,如果配置ACFS,參考README檔案步驟操作。
root使用者:
# <GI_HOME>/OPatch/opatchauto rollback <UNZIPPED_PATCH_LOCATION>/3046403
If the message, "A system reboot is recommended before using ACFS" is shown, then a reboot must be issued before continuing. Failure to do so will result in running with an unpatched ACFS\ADVM\OKS driver.
10.回滾補丁之後,再次執行datapatch
The datapatch utility will then run the necessary apply scripts to load the modified SQL files into the database.
An entry will be added to the dba_registry_sqlpatch view reflecting the patch application.
In the dba_registry_sqlpatch view, verify the Status for the APPLY is "SUCCESS".
Single/Multitenant (CDB/PDB) DB
sqlplus /nolog
SQL> Connect / as sysdba
SQL> startup
SQL> alter pluggable database all open;
SQL> quit
cd $ORACLE_HOME/OPatch
./datapatch -verbos
檢查是否有錯誤:
Check the following log files in $ORACLE_HOME/sqlpatch/30446054/ for errors: 30446054_rollback_<database SID>_<CDB name>_<timestamp>.log
where database SID is the database SID, CDB name is the name of the multitenant container database, and timestamp is of the form YYYYMMMDD_HH_MM_SS.
編譯無效物件:
cd $ORACLE_HOME/rdbms/admin
sqlplus /nolog
SQL> CONNECT / AS SYSDBA
SQL> @utlrp.sq
11.Upgrade Oracle Recovery Manager Catalog
If you are using the Oracle Recovery Manager, the catalog needs to be upgraded. Enter the following command to upgrade it. The UPGRADE CATALOG command must be entered twice to confirm the upgrade.
$ rman catalog username/password@alias
RMAN> UPGRADE CATALOG;
RMAN> UPGRADE CATALOG;
RMAN> EXIT;

說明:

最後沒有按照README完成滾動升級,總是報錯,有活動的檔案,最後一個節點一個節點挨個打了所有補丁。

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/31439444/viewspace-2679427/,如需轉載,請註明出處,否則將追究法律責任。

相關文章