一:手动卸载PSU
Execute the following on each node of the cluster in non-shared CRS and DB home environment to rollback the patch.##.在每个节点上执行如下步骤.
1. Stop the CRS managed resources running from DB homes.##.停止CRS管理的资源.
【oracle用户】
1) case1
If this is a GI Home environment, as the database home owner execute:
$ <ORACLE_HOME>/bin/srvctl stop home -o <ORACLE_HOME> -s <status file location> -n <node name>
2) case2
If this is an Oracle Restart Home environment, as the database home owner execute:
$ <ORACLE_HOME>/bin/srvctl stop home -o <ORACLE_HOME> -s <status file location>
2. Run the pre root script. ##.运行pre root脚本.
【root用户】
1) case1
If this is a GI Home, as the root user execute:
# <GI_HOME>/crs/install/rootcrs.pl -unlock
2) case2
If this is an Oracle Restart Home, as the root user execute:
<GI_HOME>/crs/install/roothas.pl -unlock
Note:
You need to make sure that the Oracle ACFS file systems are unmounted (see My Oracle Support document1494652.1How to Mount or Unmount ACFS File System While Applying GI Patches?) and all other Oracle processes are shut down before you proceed
3.Roll back the CRS patch.As the GI home owner execute:##.卸载CRS补丁.
【grid用户】
AIX打补丁之前先用root用户执行slibclean命令
$ <GI_HOME>/OPatch/opatch rollback -local -id <GI_components_number> -oh <GI_HOME>
$ <GI_HOME>/OPatch/opatch rollback -local -id <DB_PSU_number> -oh <GI_HOME>
4.Run the pre script for DB component of the patch.As the database home owner execute: ##.运行DB组件的 pre script.
【oracle用户】
$<UNZIPPED_PATCH_LOCATION>/<GI_components_number>/custom/server/<GI_components_number>/custom/scripts/prepatch.sh -dbhome <ORACLE_HOME>
5.Roll back the DB patch from the database home.As the database home owner execute: ##.卸载DB patch.
【oracle用户】
AIX打补丁之前先用root用户执行slibclean命令
$ <ORACLE_HOME>/OPatch/opatch rollback -local -id <GI_components_number> -oh <ORACLE_HOME>
$ <ORACLE_HOME>/OPatch/opatch rollback -local -id <DB_PSU_number> -oh <ORACLE_HOME>
6.Run the post script for DB component of the patch.As the database home owner execute: ##.运行DB组件的 post script.
【oracle用户】
$<UNZIPPED_PATCH_LOCATION>/<GI_components_number>/custom/server/<GI_components_number>/custom/scripts/postpatch.sh -dbhome <ORACLE_HOME>
7.Run the post script.As the root user execute: ##.运行post script.
【root用户】
1)
# <GI_HOME>/rdbms/install/rootadd_rdbms.sh
2)
case1
If this is a GI Home, as the root user execute:
# <GI_HOME>/crs/install/rootcrs.pl -patch
case2
If this is an Oracle Restart Home, as the root user execute:
# <GI_HOME>/crs/install/roothas.pl -patch
8.如果出现消息"A system reboot is recommended before using ACFS”,那么需要重启主机.
9.Start the CRS managed resources that were earlier running from DB homes. ##.启动CRS管理的资源.
【oracle用户】
1) case1
If this is a GI Home environment, as the database home owner execute:
$ <ORACLE_HOME>/bin/srvctl start home -o <ORACLE_HOME> -s <status file location> -n <node name>
2)case2
If this is an Oracle Restart Home environment, as the database home owner execute:
$ <ORACLE_HOME>/bin/srvctl start home -o <ORACLE_HOME> -s <status file location>
10.查看卸载后补丁情况
1)所有节点grid和oracle用户下执行 opatch lsinventory
2)数据字典信息查询
QL> col ACTION_TIME format a30;
SQL> col NAMESPACE format a15;
SQL> col VERSION format a15;
SQL> select * from dba_registry_history;
##查看是否有Rolling Back记录
二:自动卸载PSU方法
The patch rollback instructions will differ based on the configuration of the Grid infrastructure and the Oracle RAC database homes. Roll Back instructions for Oracle RAC Database Homes and GI are listed below.##卸载操作根据grid_home和oracle_home配置不同而不同,下面我们所只列出使用比较普遍的配置的卸载方式
即"GI Home and Database Homes that are not shared and ACFS file system is not configured."
1. As root user, execute the following command on each node of the cluster.
【root用户】
# opatch auto <UNZIPPED_PATCH_LOCATION> -rollback -ocmrf <ocm response file>
##. 如果出现消息"A system reboot is recommended before using ACFS”,那么需要重启主机.
2. Start all database instances running from the Oracle home.
3. For each database instance running out of the ORACLE_HOME
, connect to the database using SQL*Plus asSYSDBA
and run the rollback script as follows:
cd $ORACLE_HOME/rdbms/admin
sqlplus /nolog
SQL> CONNECT / AS SYSDBA
SQL> STARTUP
SQL> @catbundle_PSU_<database SID PREFIX>_ROLLBACK.sql
SQL> QUIT
In an Oracle RAC environment, the name of the rollback script will have the format catbundle_PSU_<database SID PREFIX>_ROLLBACK.sql.
4.检查日志
Check the log file for any errors. The log file is found in $ORACLE_BASE/cfgtoollogs/catbundle
and is namedcatbundle_PSU_
<database SID>
_ROLLBACK_
<TIMESTAMP>
.log
whereTIMESTAMP is of the form YYYYMMMDD_HH_MM_SS. If there are errors, see Section 3, "Known Issues".
5.Ensure that you verify the Oracle Inventory and compare the output with the one you ran inSection 2.1.3, "Validation of Oracle Inventory" and re-apply any patches that were rolled back as part of this patch apply. To verify the inventory, run the following command:
$ opatch lsinventory
##All other instances can be started and accessed as usual while you are executing the deinstallation steps.
##其他情况的自动卸载方法,请见readme