19c新環境安裝補丁(三)_推薦

綠茶有點甜發表於2020-08-12

 本次安裝Oracle RAC 19.3 版本 Linux red-hat 7.8  DB安裝補丁  RUR 20200717、

 

本次安裝Oracle補丁的方法類似於11G RAC打補丁的方法。  【可以更近一步優化,在DBCA建庫之前 對GI, ORACLE 軟體安裝psu補丁,後續不在需要對DB再次執行指令碼】

一、GI 安裝補丁

操作之前,用最新的OPATCH 工具替換現有的OPATCH版本
對GI安裝補丁,需要CRS軟體啟動狀態,才可以進行補丁實施

節點1操作
# /u01/app/19.0.0/grid/OPatch/opatchauto apply /u01/soft/31326451 -oh /u01/app/19.0.0/grid
檢查確認
/u01/app/19.0.0/grid/OPatch]$ ./opatch lsinventory
節點2操作
# /u01/app/19.0.0/grid/OPatch/opatchauto apply /u01/soft/31326451 -oh /u01/app/19.0.0/grid

 二、Oracle軟體安裝node1(走了歪路)

1) 許可權修改
$ ls -lrt /u01/app/oraInventory/ContentsXML/oui-patch.xml -rw-r----- 1 grid oinstall 174 Aug 12 15:38 /u01/app/oraInventory/ContentsXML/oui-patch.xml

$ chmod 777 /u01/app/oraInventory/ContentsXML/oui-patch.xml

 

 2)直接打補丁,報錯後回滾

節點1操作

#/u01/app/oracle/product/19.0.0/db_1/OPatch/opatchauto apply /u01/soft/31326451 -oh /u01/app/oracle/product/19.0.0/db_1

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.

查詢日誌

[Aug 12, 2020 4:04:19 PM] [INFO] Prerequisite check "CheckActiveFilesAndExecutables" failed.
The details are:

Following active executables are not used by opatch process :

Following active executables are used by opatch process :
/u01/app/oracle/product/19.0.0/db_1/lib/libclntsh.so.19.1
/u01/app/oracle/product/19.0.0/db_1/lib/libsqlplus.so
[Aug 12, 2020 4:04:19 PM] [INFO] UtilSession failed: Prerequisite check "CheckActiveFilesAndExecutables" failed.
[Aug 12, 2020 4:04:19 PM] [SEVERE] OUI-67073:UtilSession failed: Prerequisite check "CheckActiveFilesAndExecutables" failed.

 

#/u01/app/oracle/product/19.0.0/db_1/OPatch/opatchauto rollback /u01/soft/31326451 -oh /u01/app/oracle/product/19.0.0/db_1

 3)停CRS 及TFA

# /u01/app/19.0.0/grid/bin/crsctl stop crs

$ /u01/app/19.0.0/grid/bin/tfactl status

.----------------------------------------------------------------------------------------------.
| Host | Status of TFA | PID | Port | Version | Build ID | Inventory Status |
+--------+---------------+-------+------+------------+----------------------+------------------+
| w1 | RUNNING | 30174 | 5000 | 20.1.3.0.0 | 201300202004291616 | COMPLETE |
| w2 | RUNNING | 55888 | 5000 | 20.1.3.0.0 | 201300202004291616 | COMPLETE |
'--------+---------------+-------+------+------------+----------------------+------------------'

# /u01/app/19.0.0/grid/bin/tfactl stop
Stopping TFA from the Command Line
Stopped OSWatcher
Nothing to do !
Killing TFA running with pid 30174
. . .
Successfully stopped TFA..

  4)根據報錯指定的檔案,通過fuser 找到對應的程式,kill

# fuser /u01/app/oracle/product/19.0.0/db_1/lib/libclntsh.so.19.1
/u01/app/oracle/product/19.0.0/db_1/lib/libclntsh.so.19.1: 9912m
# ps -ef|grep 9912 |grep -v grep
oracle 9912 5796 0 14:57 pts/3 00:00:00 sqlplus as sysdba
# fuser /u01/app/oracle/product/19.0.0/db_1/lib/libsqlplus.so
/u01/app/oracle/product/19.0.0/db_1/lib/libsqlplus.so: 9912m
# kill -9 9912

  5)補丁安裝

#/u01/app/oracle/product/19.0.0/db_1/OPatch/opatchauto apply /u01/soft/31326451 -oh /u01/app/oracle/product/19.0.0/db_1

  6)啟動TFA 及 CRS 

# /u01/app/19.0.0/grid/bin/tfactl start

# /u01/app/19.0.0/grid/bin/crsctl start crs

 

 三、Oracle軟體安裝node2(推薦)

1) 許可權修改
$ ls -lrt /u01/app/oraInventory/ContentsXML/oui-patch.xml -rw-r----- 1 grid oinstall 174 Aug 12 15:38 /u01/app/oraInventory/ContentsXML/oui-patch.xml

$ chmod 777 /u01/app/oraInventory/ContentsXML/oui-patch.xml

2)檢查SQLPLUS程式 【local=no程式都需要kill,如果是生產環境,提前停監聽資源】
# ps -ef|grep sqlplus |grep -v grep oracle 38075 37677 0 16:27 pts/1 00:00:00 sqlplus as sysdba # kill -9 38075

3)補丁安裝

#/u01/app/oracle/product/19.0.0/db_1/OPatch/opatchauto apply /u01/soft/31326451 -oh /u01/app/oracle/product/19.0.0/db_1

 

四、DB補丁安裝[新安裝的環境,可以DBCA之前打GI,ORACLE pus即可,無需執行指令碼】

1.For each separate database running on the same shared Oraclehome being patched, run the datapatchutility as described in Table1-3.
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
2.Check the following log files in $ORACLE_BASE/cfgtoollogs/sqlpatch/30446054/<unique patchID> for errors
3.Any databases that have invalid objects after the executionof datapatch should have utlrp.sql run to revalidate thoseobjects.
For example:
cd $ORACLE_HOME/rdbms/admin
sqlplus /nolog
SQL> CONNECT / AS SYSDBA
SQL> @utlrp.sql

4.check

SQL> set line 200 pages 1000
col NAMESPACE for a18
col COMMENTS for a30
col ACTION_TIME for a40
col ACTION for a20
col VERSION for a10
col BUNDLE_SERIES for a20
select * from DBA_REGISTRY_HISTORY;

SQL> select * from DBA_REGISTRY_HISTORY;

ACTION_TIME ACTION NAMESPACE VERSION ID COMMENTS BUNDLE_SERIES
---------------------------------------- -------------------- ------------------ ---------- ---
BOOTSTRAP DATAPATCH 19 RDBMS_19.6.0.0.0DBRUR_LINUX.X64_200614
12-AUG-20 02.37.10.870555 PM

RU_APPLY SERVER 19.0.0.0.0 Patch applied on 19.3.0.0.0: Release_Update -190410122720

 

12-AUG-20 04.40.07.125440 PM

RU_APPLY SERVER 19.0.0.0.0 Patch applied from 19.3.0.0.0 to 19.6.2.0.0:
Release_Update_Revision - 200614162643

 

 

 

 

相關文章