PSU和Bundle Patch安装概要

PSU是linux下的说法
Bundle Patch是windows下的说法
dataguard 备机的话只需要下面1、4和5中opatch apply这一个步骤
1.前期准备
1.1 查看某个补丁是否安装的方法(下面命令不行就升级opatch)

$ORACLE_HOME/OPatch/opatch lsinventory

1.2. 下载补丁包

查看当前opatch版本。Oracle 11.2.0.1.0 自带的opatch版本是11.1.0.6.6。补丁包的README.html中有描述该补丁或PSU需要的最低版本opatch,如果当前opatch版本过低($ORACLE_HOME/OPatch/opatch version命令可以查看),则需要升级。

1.3 opatch版本升级

下载 Patch 6880880文件(如p6880880_112000_Linux-x86-64表示64位版本linux下的),mv原来的 O R A C L E H O M E / O P a t c h 目 录 , 解 压 P a t c h 6880880 文 件 自 动 生 成 ORACLE_HOME/OPatch目录,解压Patch 6880880文件自动生成 ORACLEHOME/OPatchPatch6880880ORACLE_HOME/OPatch目录即可。

1.4 验证opatch是否升级成功

$ORACLE_HOME/OPatch/opatch version

1.5. 关闭DB和监听

1.6. 进入补丁包的目录
命令如下

mv OPatch OPatch.old; 
unzip p6880880_112000_Linux-x86-64.zip
$ORACLE_HOME/OPatch/opatch version

2.整库备份
rman和expdp 自己酌情选择
3.备份失效对象

sqlplus>@utlrp.sql
sqlplus>create table invalid_20170101 as select * from dba_objects where status<>'VALID'

4.关闭监听和数据库(如果有standby库,把standby库也关闭,打完补丁启动成功后再去打standby库)

sqlplus>shutdown immediate

5.打补丁

$ORACLE_HOME/OPatch/opatch apply                
cd $ORACLE_HOME/rdbms/admin
sqlplus / as sysdba
sqlplus>startup migrate
sqlplus>@$ORACLE_HOME/rdbms/admin/catbundle.sql psu apply
sqlplus>@$ORACLE_HOME/rdbms/admin/utlrp.sql

官方文档提供的windows的步骤

Perform a clean shutdown of all (databases, Oracle listeners, Oracle agents, and so on.) that run from the Oracle Home where you install this patch.
Stop all Oracle services, Recovery catalog, ODBC applications, and other applications that use Oracle Client. This may include Web servers that load the Oracle client in the mid-tier environment
net stop msdtc
set PATH=%ORACLE_HOME%\perl\bin;%PATH%
Shut down all instances and listeners associated with the Oracle home that you are updating
unzip p24922870_112040_.zip
cd 24922870
opatch apply
cd %ORACLE_HOME%\rdbms\admin
sqlplus /nolog
SQL> CONNECT / AS SYSDBA
SQL> STARTUP
SQL> @catbundle.sql PSU apply
SQL> QUIT

官方文档提供的linux的步骤

If you are using a Data Guard Physical Standby database, you must install this patch on both the primary database and the physical standby database
If this is not a Oracle RAC environment, shut down all instances and listeners associated with the Oracle home that you are updating
unzip p24006111_112040_.zip
cd 24006111
opatch apply
cd $ORACLE_HOME/rdbms/admin
sqlplus /nolog
SQL> CONNECT / AS SYSDBA
SQL> STARTUP
SQL> @catbundle.sql psu apply
SQL> QUIT

6.启动监听和检查

$ORACLE_HOME/OPatch/opatch version
$ORACLE_HOME/OPatch/opatch lsinventory```
打补丁过程不报错
打完补丁后再查看失效对象,看是否和之前备份的表中记录一致
  1. 重新编译CPU相关视图 (可忽略此步骤)

该步骤在一个数据库上永远只需要执行一次,是为了完成在2008年1月份第一次发布CPU补丁时的后续工作,如果在安装以前的PSU或者CPU时执行过这个步骤那么就可以无需再次执行,另外,即使不执行该步骤,数据库也是正常运行的,只不过意味着2008年1月份的 CPU补丁没有正常结束安装。

cd $ORACLE_HOME/cpu/view_recompile

sqlplus / as sysdba

SQL>@recompile_precheck_jan2008cpu.sql

SQL>SHUTDOWN IMMEDIATE

SQL>STARTUP UPGRADE

SQL>@view_recompile_jan2008cpu.sql

SQL>SHUTDOWN;

SQL>STARTUP;

SQL>exit

8.编译无效对象

SQL>@$ORACLE_HOME/rdbms/admin/utlrp.sql

9.查看admin/*/bdump下面是否有类似文件centdb_mmon_9603.trc一直在写,如果有的话再重启下DB。

10.卸载补丁

opatch rollback -id 补丁号如9264253

如果打某个补丁1618213,但是没有找到单个的补丁包,找到了多个PSU,如在MOS上找到两个这样的包Database 11.2.0.1 PSU Patch 18139690、Database 11.2.0.1.2 PSU Patch 18031668,我们只打后一个就可以了,因为PSU是从小到大相互包含的累计补丁包

11.其他:
(a) In a non-RAC environment:

Shut down all services that are running from this ORACLE_HOME.

Confirm the return status from each shutdown command to verify

the shutdown is successful and there are no errors.

(b) In a RAC environment:

For each node in the RAC system, shut down the services for

the specific machine that are running from the ORACLE_HOME.

OPatch will be used on each node in the RAC system one at

a time. If this patch is not rolling RAC installable treat

it as a non-RAC environment and shut down all services.

As an example, in the case of a two node RAC system:

 1. Stop instances running on node 1.

 2. Run 'opatch apply /8574851' on node 1.

 3. When the apply finishes, opatch asks for confirmation

    before going on to apply the patch to node 2.

 4. Start instances on node 1.

 5. Stop instances running on node 2.

 6. Ask opatch to continue to applying the patch to node 2.

 7. Start instances on node 2.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值