RAC+ASM
Linux:redhat5.8_X86_64
DB version:10.2.0.5.0
CRS version:10.2.0.5.2
节点1:rac01
Instance:ball1
$ORACLE_HOME:/u01/app/oracle/product/10.2.0/db_1
$ORA_CRS_HOME:/u01/app/oracle/product/10.2.0/crs_1
节点2:rac02
Instance:ball2
$ORACLE_HOME:/u01/app/oracle/product/10.2.0/db_1
$ORA_CRS_HOME:/u01/app/oracle/product/10.2.0/crs_1
升级目标:DATABASE 10.2.0.5.0→10.2.0.5.9
升级所用的PSU: 14275629
1. OPatch工具版本检查,其版本应在10.2.0.5.0以上
[oracle@rac01~]$ opatch version
Invoking OPatch10.2.0.5.1
OPatch Version:10.2.0.5.1
如果OPatch工具版本不符合README中的要求,下载最新版本OPatch,解压后,直接用解压后得到OPatch目录替换$ORACLE_HOME和$CRS_HOME下的OPatch目录,并注意替换后目录的权限修改
2. 环境变量的设置,确保make,ar,ld和nm可以执行。
这些命令都在/usr/ccs/bin下,export PATH=$PATH:/usr/ccs/bin
3. 解压PSU升级包
[oracle@rac01 psu5.9]$ unzipp14275629_10205_Linux-x86-64--DB--10.2.0.5.9.zip
4. 需安装的PSU与以前安装过的PATCH的冲突检测
[[email protected]]$ opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir ./14275629
5. 关闭DATABASE,ASM,LISTENER,EM,CRS不需要关掉
[oracle@rac01 ~]$srvctl stop listener -n rac01
[oracle@rac01 ~]$srvctl stop listener -n rac02
[oracle@rac01 ~]$ srvctl stop database –d BALL
[oracle@rac01 ~]$ srvctl stop asm-n rac01
[oracle@rac01 ~]$srvctl stop asm -n rac02
[oracle@rac01 ~]$emctl stop dbconsole
[oracle@rac02 ~]$ emctl stop dbconsole
6. 应用PSU
[[email protected]]$ cd 14275629/
[oracle@rac0114275629]$ opatch apply
在我的测试时,Opatch工具应用过程中发生了一个报错
[报错]:
Runningprerequisite checks...
Prerequisitecheck "CheckActiveFilesAndExecutables" failed.
Thedetails are:
Followingexecutables are active :
/u01/app/oracle/product/10.2.0/db_1/bin/oracle
ApplySessionfailed during prerequisite checks: Prerequisite check"CheckActiveFilesAndExecutables" failed.
Systemintact, OPatch will not attempt to restore the system
OPatchfailed with error code 74
根据提示说明,有进程在使用/u01/app/oracle/product/10.2.0/db_1/bin/oracle目下的文件,我们升级的PSU会安装在/u01/app/oracle/product/10.2.0/db_1下,应确保该目下的文件没有被使用。
[解决方法]:
[oracle@rac0114275629]$ fuser -k /u01/app/oracle/product/10.2.0/db_1/bin/oracle
找到使用该目下的进程,并通过-k参数删掉该进程
7. 启动数据库,并执行编译数据库中无效对象的脚本
[oracle@rac01 ~]$srvctl start listener -n rac01
[oracle@rac01 ~]$srvctl start listener -n rac02
[oracle@rac01 ~]$srvctl start asm -n rac01
[oracle@rac01 ~]$srvctl start asm -n rac02
[oracle@rac01 ~]$srvctl start database -d B
[oracle@rac01 ~]$ cd $ORACLE_HOME/rdbms/admin
[oracle@rac01 admin]$ sqlplus / as sysdba
SQL> @catbundle.sql psu apply
SQL> @utlrp.sql
8. PSU升级结束,确认无效对象的数量。即使有无效对象,其数量不应多余升级前无效对象的数量
SQL> selectcount(*) from dba_objects where status='INVALID';
COUNT(*)
-------------------
0
9. 确认升级后DB的版本
[oracle@rac01 ~]$opatch lsinventory -bugs_fixed | egrep -i 'PSU|DATABASE PATCH SET UPDATE'
Oracle_RAC10.2.0.1到10.2.0.5.9的详细升级过程(一):http://blog.csdn.net/ballontt/article/details/12612797
Oracle_RAC10.2.0.1到10.2.0.5.9的详细升级过程(二):http://blog.csdn.net/ballontt/article/details/12613403