12C打psu

yingyifeng306發表於2021-02-20

說明:

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

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

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

 

一、解壓opatch工具

1.1Grid使用者雙節點執行:

$ cd /media

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

 

1.2Oracle使用者雙節點執行:

$ cd /media

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

 

檢視opatch當前版本

[oracle@ajjrac1 media] opatch version

OPatch Version: 12.2.0.1.12

 

OPatch succeeded.

 

二、解壓補丁包

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

$ cd /media

$ unzip p27100009_122010_Linux-x86-64.zip

 

 

三、安裝過程

檢查readme檔案:

Patch Number                      Description                                                   Applicable   Homes

27105253                     DB RU   12.2.0.1.180116              Only DB   Home for non-Oracle RAC setup. Both DB Homes and Grid Home for Oracle RAC   setup.

27335416                     OCW RU   12.2.0.1.180116                                Both DB Homes and Grid Home

27128906                     ACFS RU   12.2.0.1.171115                                    Only Grid   Home

26839277                     DBWLM RU   12.2.0.1.170913                                     Only Grid Home

27144050                 TOMCAT RU   12.2.0.1.170723.0830                                 Only Grid   Home

 

具體過程如下:

注意:和11g不同,12.2打補丁需要一個節點一個節點來,不能同時進行!!!!

 

1.oracle使用者執行(要記住這個status.lst檔案的目錄)

1節點:

$ /oracle/app/product/12.2.0/db_1/bin/srvctl stop home -o /oracle/app/product/12.2.0/db_1 -s /media/status.lst -n ajjrac1

2節點:

$ /oracle/app/product/12.2.0/db_1/bin/srvctl stop home -o /oracle/app/product/12.2.0/db_1 -s /media/status.lst -n ajjrac2

 

2. root使用者執行

# /oracle/grid/crs/install/rootcrs.sh  -prepatch

 

 

3. grid使用者執行

$ <GI_HOME>/OPatch/opatch apply -oh <GI_HOME> -local <UNZIPPED_PATCH_LOCATION>/%BUGNO%/%OCW TRACKING BUG%

$ <GI_HOME>/OPatch/opatch apply -oh <GI_HOME> -local <UNZIPPED_PATCH_LOCATION>/%BUGNO%/%ACFS TRACKING BUG%

$ <GI_HOME>/OPatch/opatch apply -oh <GI_HOME> -local <UNZIPPED_PATCH_LOCATION>/%BUGNO%/%DBWLM TRACKING BUG%

$ <GI_HOME>/OPatch/opatch apply -oh <GI_HOME> -local <UNZIPPED_PATCH_LOCATION>/%BUGNO%/%DB RU TRACKING BUG%

$ <GI_HOME>/OPatch/opatch apply -oh <GI_HOME> -local <UNZIPPED_PATCH_LOCATION>/%BUGNO%/%TOMCAT RU TRACKING BUG%

 

 

此處是:

$ /oracle/grid/OPatch/opatch apply -oh /oracle/grid -local /media/27100009/27335416

$ /oracle/grid/OPatch/opatch apply -oh /oracle/grid -local /media/27100009/27128906

$ /oracle/grid/OPatch/opatch apply -oh /oracle/grid -local /media/27100009/26839277

$ /oracle/grid/OPatch/opatch apply -oh /oracle/grid -local /media/27100009/27105253

$ /oracle/grid/OPatch/opatch apply -oh /oracle/grid -local /media/27100009/27144050

 

4. oracle使用者執行

<UNZIPPED_PATCH_LOCATION>/%BUGNO%/%OCW TRACKING BUG%/custom/scripts/prepatch.sh -dbhome <ORACLE_HOME>

此處是:

$ /media/27100009/27335416/custom/scripts/prepatch.sh -dbhome /oracle/app/product/12.2.0/db_1

 

5. oracle使用者執行

$ <ORACLE_HOME>/OPatch/opatch apply -oh <ORACLE_HOME> -local <UNZIPPED_PATCH_LOCATION>/%BUGNO%/%OCW TRACKING BUG%

$ <ORACLE_HOME>/OPatch/opatch apply -oh <ORACLE_HOME> -local <UNZIPPED_PATCH_LOCATION>/%BUGNO%/%DB RU TRACKING BUG%

 

此處是:

$ /oracle/app/product/12.2.0/db_1/OPatch/opatch apply -oh /oracle/app/product/12.2.0/db_1 -local /media/27100009/27335416

$ /oracle/app/product/12.2.0/db_1/OPatch/opatch apply -oh /oracle/app/product/12.2.0/db_1 -local /media/27100009/27105253

 

6. oracle使用者執行

$ <UNZIPPED_PATCH_LOCATION>/%BUGNO%/%OCW TRACKING BUG%/custom/scripts/postpatch.sh -dbhome <ORACLE_HOME>

 

此處是:

$ /media/27100009/27335416/custom/scripts/postpatch.sh -dbhome /oracle/app/product/12.2.0/db_1

 

7.root使用者執行

# /oracle/grid/rdbms/install/rootadd_rdbms.sh

# /oracle/grid/crs/install/rootcrs.sh -postpatch

 

8. oracle使用者執行,/oracle/soft/status.lst是在第一步指定的檔案

1節點:

$ /oracle/app/product/12.2.0/db_1/bin/srvctl start home -o /oracle/app/product/12.2.0/db_1 -s /media/status.lst -n ajjrac1

2節點:

$ /oracle/app/product/12.2.0/db_1/bin/srvctl start home -o /oracle/app/product/12.2.0/db_1 -s /media/status.lst -n ajjrac2

 

注:一個節點做完再打另一個節點

 

如果是在沒庫的情況下打PSU的,那麼到這裡就基本結束了,到第10步驗證一下就好了;但是如果是在有庫的前提下打PSU,那麼還要進行地9步,

在叢集的其中一個節點上執行下面的語句,最後再驗證:

 

9.資料庫應用PSU

啟動資料庫後(如果是cdb資料庫,開啟所有pdb:alter pluggable database all open;):

$ cd $ORACLE_HOME/OPatch

./datapatch -verbose

 

 

10.驗證psu:

Gird使用者雙節點

$opatch lsinventory

 

oracle使用者雙節點

$opatch lsinventory

 


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

相關文章