【PSU】怎麼給RAC打PSU補丁

恩強Boy發表於2020-08-12

一、  規劃

GI 版本 : 11.2.0.4

DB 版本 : 11.2.0.4

GI PSU: p28429134_112040_Linux-x86-64.zip

DB PSU: p28204707_112040_Linux-x86-64.zip

Opatch: p6880880_112000_Linux-x86-64.zip

二、  思路清晰

step1: 更新 Opatch

step2: GI PSU

step3: 給資料庫軟體打 PSU

step4: database PSU

三、  補丁安裝準備

1.  OPatch 工具

在給GI DB 打補丁前,一定要閱讀補丁壓縮包裡面的 README.html 。首先,裡面記錄著 OPatch 要求。這裡需要 OPatch 版本 11.2.0.3.6 及以上。然後檢視 GRID_HOME ORACLE_HOME OPatch 當前版本。如果版本不滿足,請立即更新 Opatch 工具。

兩個節點均要更新opatch

1)  檢視OPatch 版本(兩節點執行)

grid 使用者)

$ cd $ORACLE_HOME/OPatch

$ ./opatch version

OPatch Version: 11.2.0.3.4

oracle 使用者)

$ cd $ORACLE_HOME/OPatch

$ ./opatch version

OPatch Version: 11.2.0.3.4

2)  更新Opatch (兩節點執行)

對於GRID_HOME OPatch 工具,執行以下命令進行 OPatch 工具替換

root 使用者)

# cd /u01/app/11.2.0/grid

# mv OPatch OPatch_20200811

#  unzip p6880880_112000_Linux-x86-64.zip  -d /u01/app/11.2.0/grid/

# chown -R grid:oinstall /u01/app/11.2.0/grid/ OPatch

對於ORACLE_HOME OPatch ,執行以下命令進行 OPatch 工具替換

#  cd /u01/app/oracle/product/11.2.0/db_1

#  mv OPatch OPatch_20200811

#  unzip p6880880_112000_Linux-x86-64.zip  -d /u01/app/oracle/product/11.2.0/db_1/

# chown -R oracle:oinstall /u01/app/oracle/product/11.2.0/db_1/OPatch

3)  檢視更新後的opatch

$ cd $ORACLE_HOME/OPatch

$ ./opatch version

OPatch Version: 11.2.0.3. 18

2.  檢視當前環境的PSU (兩節點執行)

grid 使用者)

$ $ORACLE_HOME/OPatch/opatch lsinv

oracle 使用者)

$ $ORACLE_HOME/OPatch/opatch lsinv

3.  更新OCM 檔案(兩節點執行)

OCM Oracle Configuration Manager )是一個註冊檔案,在更新 GI PSU 時會用到。

# cd /u01/app/11.2.0/grid/OPatch/ocm/bin

# ./emocmrsp

The OCM configuration response file (ocm.rsp) was successfully created.

會生成一個ocm.rsp 檔案在當前目錄

四、  操作過程

1.  GRID PSU (兩節點執行)

1)  解壓zip 軟體包

#  unzip p28429134_112040_Linux-x86-64.zip

# chown -R grid:oinstall 28429134/

2)  更新GI PSU

# /u01/app/11.2.0/grid/OPatch/opatch auto /home/grid/28429134 -oh /u01/app/11.2.0/grid -ocmrf /u01/app/11.2.0/grid/OPatch/ocm/bin/ocm.rsp

Executing /u01/app/11.2.0/grid/perl/bin/perl /u01/app/11.2.0/grid/OPatch/crs/patch11203.pl -patchdir /home/grid -patchn 28429134 -ocmrf /u01/app/11.2.0/grid/OPatch/ocm/bin/ocm.rsp -paramfile /u01/app/11.2.0/grid/crs/install/crsconfig_params

This is the main log file: /u01/app/11.2.0/grid/cfgtoollogs/opatchauto2020-08-11_10-43-19.log

This file will show your detected configuration and all the steps that opatchauto attempted to do on your system:

/u01/app/11.2.0/grid/cfgtoollogs/opatchauto2020-08-11_10-43-19.report.log

2020-08-11 10:43:19: Starting Clusterware Patch Setup

Using configuration parameter file: /u01/app/11.2.0/grid/crs/install/crsconfig_params

Stopping RAC /u01/app/oracle/product/11.2.0/db_1 ...

Stopped RAC /u01/app/oracle/product/11.2.0/db_1 successfully

patch /home/grid/28429134/27735020/custom/server/27735020  apply successful for home  /u01/app/oracle/product/11.2.0/db_1

patch /home/grid/28429134/28204707  apply successful for home  /u01/app/oracle/product/11.2.0/db_1

Stopping CRS...

Stopped CRS successfully

patch /home/grid/28429134/27735020  apply successful for home  /u01/app/11.2.0/grid

patch /home/grid/28429134/28204707  apply successful for home  /u01/app/11.2.0/grid

patch /home/grid/28429134/28204939  apply successful for home  /u01/app/11.2.0/grid

Starting CRS...

Installing Trace File Analyzer

ACFS driver install actions failed

CRS-4123: Oracle High Availability Services has been started.

Starting RAC /u01/app/oracle/product/11.2.0/db_1 ...

Started RAC /u01/app/oracle/product/11.2.0/db_1 successfully

opatch auto succeeded.

2.  給資料庫軟體打PSU (兩節點執行)

1)  解壓 psu

# unzip p28204707_112040_Linux-x86-64.zip

# chown -R oracle:oinstall 2820470 7

2)  檢查patch 衝突

$ cd 28204707

$ $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -ph ./

3)  停庫、停監聽、停EM

grid 使用者)

$ srvctl stop listener

$ srvctl stop database -d ORCL

如果安裝了EM ,需要停止 EM agent

oracle 使用者)

$ $ORACLE_HOME/bin/emctl stop dbconsole

4)  資料庫軟體應用PSU

$ cd 28204707/

$ $ORACLE_HOME /OPatch/opatch apply

3.  database PSU (單節點執行)

cd $ORACLE_HOME/rdbms/admin
sqlplus /nolog
SQL> CONNECT / AS SYSDBA
SQL> STARTUP
SQL> @catbundle.sql psu apply
SQL> QUIT

開啟第二個節點instance

$ srvctl start database -d ORCL

4.  檢查

以下內容,grid oracle 使用者兩節點檢查

$ cd $ORACLE_HOME /OPatch

$ ./opatch lsinv

以下內容,oracle 使用者單節點執行

$ sqlplus / as sysdba

SQL> select COMP_ID,COMP_NAME,VERSION,STATUS from DBA_REGISTRY;

SQL> select ACTION_TIME, ACTION, COMMENTS from DBA_REGISTRY_HISTORY;

SQL> select owner,object_name,object_type,status from dba_objects where status<>'VALID';

SQL> select count(*) from dba_objects where status<>'VALID';

 

 

 

---- end ----


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

相關文章