到metalink上下载p8202632_10205_LINUX.zip补丁,上传到服务器。下面进行升级:
1.停止RAC
[oracle@b87 ~]$ srvctl stop database -d racdb
[oracle@b87 ~]$ srvctl stop asm -n b87
[oracle@b87 ~]$ srvctl stop asm -n b88
[oracle@b87 ~]$ srvctl stop listener -n b87
[oracle@b87 ~]$ srvctl stop listener -n b88
[oracle@b87 ~]$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....SM1.asm application OFFLINE OFFLINE
ora....87.lsnr application OFFLINE OFFLINE
ora.b87.gsd application ONLINE ONLINE b87
ora.b87.ons application ONLINE ONLINE b87
ora.b87.vip application ONLINE ONLINE b87
ora....SM2.asm application OFFLINE OFFLINE
ora....88.lsnr application OFFLINE OFFLINE
ora.b88.gsd application ONLINE ONLINE b88
ora.b88.ons application ONLINE ONLINE b88
ora.b88.vip application ONLINE ONLINE b88
ora.racdb.db application OFFLINE OFFLINE
ora....b1.inst application OFFLINE OFFLINE
ora....b2.inst application OFFLINE OFFLINE
2.解压包
unzip p8202632_10205_LINUX.zip
[root@b87 opt]# cd Disk1/
[root@b87 Disk1]# ls
install patch_note.htm response runInstaller stage
3.开始升级clusterware
[oracle@b87 Disk1]$ ./runInstaller
Starting Oracle Universal Installer...
Checking installer requirements...
Checking operating system version: must be redhat-3,SuSE-9, SuSE-10, redhat-4, redhat-5, redhat-6, UnitedLinux-1.0, asianux-1,asianux-2, asianux-3, enterprise-4, enterprise-5 or SuSE-11
Passed
All installer requirements met.
Preparing to launch Oracle Universal Installer from/tmp/OraInstall2012-12-25_02-26-20PM. Please wait ...[oracle@b87 Disk1]$ OracleUniversal Installer, Version 10.2.0.5.0 Production
Copyright (C) 1999, 2010, Oracle. All rights reserved.
欢迎界面,选择NEXT
这里注意,现在我们是升级CLUSTERWARE集群软件,选择相应的目录(CRS_HOME)
看清楚,不要选择(ORACLE_HOME),选好后NEXT.
保持默认,next
检测环境,通过后,next,我在这一步报内核参数不对,按照提示修改相关参数即可,最后别忘记sysctl –p.
安装之前的概要,选择安装。
安装进行中,持续30分钟左右。
安装结束,提示在所有节点运行脚本:
先在第一个节点上运行:
[root@b87 ~]# /opt/u01/oracle/product/crs/bin/crsctlstop crs
Stopping resources.
Successfully stopped CRS resources
Stopping CSSD.
Shutting down CSS daemon.
Shutdown request successfully issued.
[root@b87 ~]#/opt/u01/oracle/product/crs/install/root102.sh
Creating pre-patch directory for saving pre-patchclusterware files
Completed patching clusterware files to/opt/u01/oracle/product/crs
Relinking some shared libraries.
Relinking of patched files is complete.
WARNING: directory '/opt/u01/oracle/product' is notowned by root
WARNING: directory '/opt/u01/oracle' is not owned byroot
WARNING: directory '/opt/u01' is not owned by root
Preparing to recopy patched init and RC scripts.
Recopying init and RC scripts.
Startup will be queued to init within 30 seconds.
Starting up the CRS daemons.
Waiting for the patched CRS daemons to start.
This may take a while on some systems.
.
10205 patch successfully applied.
clscfg: EXISTING configuration version 3 detected.
clscfg: version 3 is 10G Release 2.
Successfully deleted 1 values from OCR.
Successfully deleted 1 keys from OCR.
Successfully accumulated necessary OCR keys.
Using ports: CSS=49895 CRS=49896 EVMC=49898 andEVMR=49897.
node <nodenumber>: <nodename> <privateinterconnect name> <hostname>
node 1: b87 b87-priv b87
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
clscfg -upgrade completed successfully
Creating'/opt/u01/oracle/product/crs/install/paramfile.crs' with data used for CRSconfiguration
Setting CRS configuration values in/opt/u01/oracle/product/crs/install/paramfile.crs
在第二个节点上运行:
[root@b88 ~]# /opt/u01/oracle/product/crs/bin/crsctlstop crs
Stopping resources.
Successfully stopped CRS resources
Stopping CSSD.
Shutting down CSS daemon.
Shutdown request successfully issued.
[root@b88 ~]#/opt/u01/oracle/product/crs/install/root102.sh
Creating pre-patch directory for saving pre-patchclusterware files
Completed patching clusterware files to/opt/u01/oracle/product/crs
Relinking some shared libraries.
Relinking of patched files is complete.
WARNING: directory '/opt/u01/oracle/product' is notowned by root
WARNING: directory '/opt/u01/oracle' is not owned byroot
WARNING: directory '/opt/u01' is not owned by root
Preparing to recopy patched init and RC scripts.
Recopying init and RC scripts.
Startup will be queued to init within 30 seconds.
Starting up the CRS daemons.
Waiting for the patched CRS daemons to start.
This may takea while on some systems.
.
10205 patch successfully applied.
clscfg: EXISTING configuration version 3 detected.
clscfg: version 3 is 10G Release 2.
Successfully deleted 1 values from OCR.
Successfully deleted 1 keys from OCR.
Successfully accumulated necessary OCR keys.
Using ports: CSS=49895 CRS=49896 EVMC=49898 andEVMR=49897.
node <nodenumber>: <nodename> <privateinterconnect name> <hostname>
node 2: b88 b88-priv b88
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
clscfg -upgrade completed successfully
Creating'/opt/u01/oracle/product/crs/install/paramfile.crs' with data used for CRSconfiguration
Setting CRS configuration values in /opt/u01/oracle/product/crs/install/paramfile.crs
到此clusterware升级完成,crs已经重启,下面我们开始升级数据库软件。
4.升级database software
在升级clusterware的时候,升级结束的时候会启动CRS服务。但是在升级数据库的时候要关闭这些服务,命令如下(以下关闭命令也是正常关闭RAC的方法):
[oracle@b88 ~]$ srvctl stop database -d racdb
[oracle@b88 ~]$ srvctl stop service -d racdb
[oracle@b88 ~]$ srvctl stop asm -n b87
[oracle@b88 ~]$ srvctl stop asm -n b88
[oracle@b88 ~]$ srvctl stop listener -n b87
[oracle@b88 ~]$ srvctl stop listener -n b88
开始升级数据库软件,还是运行补丁包下的runInstaller
[oracle@b87 Disk1]$ ./runInstaller
Starting Oracle Universal Installer...
Checking installer requirements...
Checking operating system version: must be redhat-3,SuSE-9, SuSE-10, redhat-4, redhat-5, redhat-6, UnitedLinux-1.0, asianux-1,asianux-2, asianux-3, enterprise-4, enterprise-5 or SuSE-11
Passed
All installer requirements met.
Preparing to launch Oracle Universal Installer from/tmp/OraInstall2012-12-25_03-19-06PM. Please wait ...[oracle@b87 Disk1]$ OracleUniversal Installer, Version 10.2.0.5.0 Production
Copyright (C) 1999, 2010, Oracle. All rights reserved.
首先出来欢迎界面,next。
像升级CLUSTERWARE一样,这一步注意选择oracle_home,next。
默认是让你加入metalink,我这里不选,next。
保持默认即可,next。
检测环境,next。
安装前的概要文件,选择install.
升级过程中,持续30分钟左右。
安装完成,提示在所有节点用root执行脚本。
在节点1上执行:
[root@b87 ~]# /opt/u01/oracle/product/10.2.0.1/root.sh
Running Oracle 10g root.sh script...
The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /opt/u01/oracle/product/10.2.0.1
Enter the full pathname of the local bin directory:[/usr/local/bin]:
The file "dbhome" already exists in/usr/local/bin. Overwrite it? (y/n)
[n]: y
Copyingdbhome to /usr/local/bin ...
The file "oraenv" already exists in/usr/local/bin. Overwrite it? (y/n)
[n]: y
Copyingoraenv to /usr/local/bin ...
The file "coraenv" already exists in/usr/local/bin. Overwrite it? (y/n)
[n]: y
Copyingcoraenv to /usr/local/bin ...
Entries will be added to the /etc/oratab file asneeded by
Database Configuration Assistant when a database iscreated
Finished running generic part of root.sh script.
Now product-specific root actions will be performed.
在节点2上执行
[root@b88 ~]# /opt/u01/oracle/product/10.2.0.1/root.sh
Running Oracle 10g root.sh script...
The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /opt/u01/oracle/product/10.2.0.1
Enter the full pathname of the local bin directory:[/usr/local/bin]:
The file "dbhome" already exists in/usr/local/bin. Overwrite it? (y/n)
[n]: y
Copyingdbhome to /usr/local/bin ...
The file "oraenv" already exists in/usr/local/bin. Overwrite it? (y/n)
[n]: y
Copyingoraenv to /usr/local/bin ...
The file "coraenv" already exists in/usr/local/bin. Overwrite it? (y/n)
[n]: y
Copyingcoraenv to /usr/local/bin ...
Entries will be added to the /etc/oratab file asneeded by
Database Configuration Assistant when a database iscreated
Finished running generic part of root.sh script.
Now product-specific root actions will be performed.
到此,数据库软件的升级完成。下面开始升级数据库(这里数据库是指库文件)。
5.升级database
先启动相关应用(启动ASM,监听即可,实例可以不启动。如果使用脚本升级,实例需要启动到nomount,我们这里介绍使用DBUA进行升级,DBUA会帮助我们启动实例,我们不需要干预)。
启动ASM和监听
[oracle@b88 ~]$ srvctl start asm -n b87
[oracle@b88 ~]$ srvctl start asm -n b88
[oracle@b88 ~]$ srvctl start listener -n b87
[oracle@b88 ~]$ srvctl start listener -n b88
[oracle@b88 ~]$ crs_stat -t -v
Name Type R/RA F/FT Target State Host
----------------------------------------------------------------------
ora....SM1.asm application 0/5 0/0 ONLINE ONLINE b87
ora....87.lsnr application 0/5 0/0 ONLINE ONLINE b87
ora.b87.gsd application 0/5 0/0 ONLINE ONLINE b87
ora.b87.ons application 0/3 0/0 ONLINE ONLINE b87
ora.b87.vip application 0/0 0/0 ONLINE ONLINE b87
ora....SM2.asm application 0/5 0/0 ONLINE ONLINE b88
ora....88.lsnr application 0/5 0/0 ONLINE ONLINE b88
ora.b88.gsd application 0/5 0/0 ONLINE ONLINE b88
ora.b88.ons application 0/3 0/0 ONLINE ONLINE b88
ora.b88.vip application 0/0 0/0 ONLINE ONLINE b88
ora.racdb.db application 0/1 0/1 OFFLINE OFFLINE
ora....b1.inst application 0/5 0/0 OFFLINE OFFLINE
ora....b2.inst application 0/5 0/0 OFFLINE OFFLINE
在一个节点上运行dbua即可:
[oracle@b87 Disk1]$ dbua
欢迎界面,next。
选择Upgrade a database,next.
输入sys和密码,next。
这里是选择是否编译无效对象,以及选择用多少个CPU来进行并行编译无效对象。从而加快编译速度,我们服务器是虚拟化只配了2个CPU,这里我们选2,下面是询问是否在编译时关闭归档,因为在编译的时候数据库会产生很多日志,这时候如果是归档,会影响速度,我们选择关闭归档(等数据库升级完成后,归档会自动开启)。
指定闪回区,next。
安装前的概要,finish.
升级过程中,持续1个小时左右。
到此数据库的升级完成,下面我们进行验证。
验证:
[oracle@b87 ~]$ sqlplus /nolog
SQL*Plus: Release 10.2.0.5.0 - Production on Tue Dec25 18:23:07 2012
Copyright (c) 1982, 2010, Oracle. All Rights Reserved.
SQL> conn / as sysdba
Connected.
SQL> set line 150 pages 1000
SQL> select * from gv$instance;
INST_IDINSTANCE_NUMBER INSTANCE_NAME HOST_NAME VERSION STARTUP_TIME
---------- --------------- ------------------------------------------------------------------------------------------------- ------------
STATUS PAR THREAD# ARCHIVE LOG_SWITCH_WAIT LOGINS SHU DATABASE_STATUS INSTANCE_ROLE ACTIVE_ST BLO
------------ --- ---------- ------- ------------------------- --- ----------------- ------------------ --------- ---
1 1 racdb1 b87 10.2.0.5.0 25-DEC-12
OPEN YES 1 STARTED ALLOWED NO ACTIVE PRIMARY_INSTANCE NORMAL NO
2 2 racdb2 b88 10.2.0.5.0 25-DEC-12
OPEN YES 2 STARTED ALLOWED NO ACTIVE PRIMARY_INSTANCE NORMAL NO
SQL> colstatus for a10
SQL> col version for a15
SQL> col comp_name for a35
SQL> select comp_name,version,status fromdba_registry;
COMP_NAME VERSION STATUS
----------------------------------- -------------------------
Oracle Enterprise Manager 10.2.0.5.0 VALID
Spatial 10.2.0.5.0 VALID
Oracle interMedia 10.2.0.5.0 VALID
OLAP Catalog 10.2.0.5.0 VALID
Oracle XML Database 10.2.0.5.0 VALID
Oracle Text 10.2.0.5.0 VALID
Oracle Expression Filter 10.2.0.5.0 VALID
Oracle Rule Manager 10.2.0.5.0 VALID
Oracle Workspace Manager 10.2.0.5.0 VALID
Oracle Data Mining 10.2.0.5.0 VALID
Oracle Database Catalog Views 10.2.0.5.0 VALID
Oracle Database Packages and Types 10.2.0.5.0 VALID
JServer JAVA Virtual Machine 10.2.0.5.0 VALID
Oracle XDK 10.2.0.5.0 VALID
Oracle Database Java Packages 10.2.0.5.0 VALID
OLAP Analytic Workspace 10.2.0.5.0 VALID
Oracle OLAP API 10.2.0.5.0 VALID
Oracle Real Application Clusters 10.2.0.5.0 VALID
SQL> select * fromv$version;
BANNER
----------------------------------------------------------------
Oracle Database 10gEnterprise Edition Release 10.2.0.5.0 - Prod
PL/SQL Release 10.2.0.5.0 -Production
CORE 10.2.0.5.0 Production
TNS for Linux: Version10.2.0.5.0 - Production
NLSRTL Version 10.2.0.5.0 -Production