19c rac自動打補丁步驟

sjw1933發表於2022-10-25

$ORACLE_HOME為oracle軟體安裝目錄(/oracle/app/product/12.2.0/db_1)

$GRID_HOME為grid安裝目錄(/oracle/grid/crs_1)

<UNZIPPED_PATCH_LOCATION>為psu安裝包解壓路徑,本次實驗改目錄為/soft

一、解壓opatch工具

1.1 root使用者修改屬組

# chown grid:oinstall p6880880_122010_Linux-x86-64.zip

1.2 Grid使用者雙節點執行:

$ unzip p6880880_122010_Linux-x86-64.zip -d $ORACLE_HOME

1.3 root使用者修改屬組

# chown oracle:oinstall p6880880_122010_Linux-x86-64.zip

1.4 Oracle使用者雙節點執行:

$ unzip p6880880_122010_Linux-x86-64.zip -d $ORACLE_HOME

檢視opatch當前版本

[oracle@s1-11g OPatch]$ opatch version

OPatch Version: 12.2.0.1.25

OPatch succeeded.

二、解壓補丁包

在雙節點執行(grid或oracle使用者都可以)

$ cd /soft

$ unzip p31750108_190000_Linux-x86-64.zip

三、安裝過程

檢查readme檔案:

31750108

Patch Number Description Applicable Homes

31771877 Database Release Update 19.9.0.0.201020 Only DB Home for non-Oracle RAC setup. Both DB Homes and Grid Home for Oracle RAC setup.

31772784 OCW Release Update 19.9.0.0.201020   Both DB Homes and Grid Home

31773437 ACFS Release Update 19.9.0.0.201020     Only Grid Home

31780966 Tomcat Release Update 19.0.0.0.0 Only Grid Home

ORACLE_HOME=/oracle/app/product/12.2.0/db_1

GRID_HOME=/oracle/grid/crs_1

status file location=/soft/status.lst

node name=rac1,rac2

打補丁前準備:

1.備份安裝檔案

tar cvf /ora_backup/oracle.tar oracle

tar cvf /ora_backup/grid.tar grid

2.備份資料檔案

rmant target /

backup database format '/ora_backup/full_%U.bak' plus archivelog;

3.關閉資料庫

srvctl stop database -d orcl -o immediate

自動打補丁過程:

預檢查

雙節點執行

/oracle/grid/crs_1/OPatch/opatchauto apply /soft/31750108 -analyze

1. 關閉2節點叢集

/oracle/grid/crs_1/bin/crsctl stop has

2. 1節點執行打grid補丁

/oracle/grid/crs_1/OPatch/opatchauto apply /soft/31750108 -oh /oracle/grid/crs_1 -nonrolling

3. 1節點關叢集 2節點開叢集

/oracle/grid/crs_1/bin/crsctl stop has

/oracle/grid/crs_1/bin/crsctl start has

4. 2節點打grid補丁

chmod 660 /oracle/oraInventory/ContentsXML/oui-patch.xml

/oracle/grid/crs_1/OPatch/opatchauto apply /soft/31750108 -oh /oracle/grid/crs_1 -nonrolling

5. 1節點打db補丁

/oracle/app/product/12.2.0/db_1/OPatch/opatchauto apply /soft/31750108 -oh /oracle/app/product/12.2.0/db_1

6. 2節點打db補丁

/oracle/app/product/12.2.0/db_1/OPatch/opatchauto apply /soft/31750108 -oh /oracle/app/product/12.2.0/db_1

7.載入sql

srvctl start database -d orcl

cd $ORACLE_HOME/OPatch

./datapatch -verbose

回滾:

同時回滾

/oracle/grid/crs_1/OPatch/opatchauto rollback /soft/31750108

單獨回滾

grid:

/oracle/grid/crs_1/OPatch/opatchauto rollback /oracle/grid/crs_1

db:

/oracle/app/product/12.2.0/db_1/OPatch/opatchauto rollback -oh /oracle/app/product/12.2.0/db_1


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

相關文章