1 创建目录
mkdir -p /u01/app/11.2.0/grid
chown –R oracle:oinstall /u01/app/11.2.0/grid
2 Backup the database:
使用rman全备数据库
3 Backup the OCR file Backup the voting disk:
[root@rac2 ~]# su - oracle
[oracle@rac2 ~]$ /oracle/product/10.2.0/crs/bin/crsctl query css votedisk
-bash: /oracle/product/10.2.0/crs/bin/crsctl: No such file or directory
[oracle@rac2 ~]$ /u01/app/oracle/product/10.2.0/crs/bin/crsctl query css votedisk
-bash: /u01/app/oracle/product/10.2.0/crs/bin/crsctl: No such file or directory
[oracle@rac2 ~]$ /u01/app/oracle/product/10.2.0/db_1/bin/crsctl query css votedisk
0. 0 /dev/raw/raw2
located 1 votedisk(s).
[oracle@rac2 ~]$ /u01/app/oracle/product/10.2.0/db_1/bin/ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 2
Total space (kbytes) : 200560
Used space (kbytes) : 4604
Available space (kbytes) : 195956
ID : 363260635
Device/File Name : /dev/raw/raw1
Device/File integrity check succeeded
Device/File not configured
Cluster registry integrity check succeeded
[oracle@rac2 ~]$ /u01/app/oracle/product/10.2.0/db_1/bin/ocrconfig -showbackup
rac2 2013/09/26 00:43:52 /u01/app/oracle/product/10.2.0/db_1/cdata/crs
rac2 2013/09/25 20:43:51 /u01/app/oracle/product/10.2.0/db_1/cdata/crs
rac2 2013/09/25 16:43:49 /u01/app/oracle/product/10.2.0/db_1/cdata/crs
rac1 2013/09/24 07:56:02 /u01/app/oracle/product/10.2.0/db_1/cdata/crs
rac1 2013/09/12 06:08:33 /u01/app/oracle/product/10.2.0/db_1/cdata/crs
Backup the OCR file
$CRS_HOME/bin/ocrconfig -export $CRS_HOME/cdata/crs/ocrbak.dmp
Backup the voting disk:
dd if=/dev/raw/raw2 f=$CRS_HOME/cdata/crs/ votingdiskbak
4 增加scan ip
[root@rac1 ~]# more /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6
192.168.10.11 rac1 rac1.oracle.com
192.168.10.12 rac2 rac2.oracle.com
192.168.10.21 rac1-vip
192.168.10.22 rac2-vip
10.0.0.11 rac1-priv
10.0.0.12 rac2-priv
192.168.10.25 scanip
5 停止10G RAC
[oracle@rac1 ~]$ crs_stop -all
Attempting to stop `ora.orcl.mycrv1.orcl1.srv` on member `rac1`
Attempting to stop `ora.rac1.gsd` on member `rac1`
Attempting to stop `ora.rac1.ons` on member `rac1`
Attempting to stop `ora.orcl.mycrv1.cs` on member `rac2`
Attempting to stop `ora.orcl.mycrv1.orcl2.srv` on member `rac2`
Stop of `ora.orcl.mycrv1.orcl1.srv` on member `rac1` succeeded.
Attempting to stop `ora.rac2.ons` on member `rac2`
Attempting to stop `ora.rac2.gsd` on member `rac2`
Stop of `ora.orcl.mycrv1.orcl2.srv` on member `rac2` succeeded.
Attempting to stop `ora.orcl.db` on member `rac1`
Stop of `ora.orcl.mycrv1.cs` on member `rac2` succeeded.
Stop of `ora.rac2.gsd` on member `rac2` succeeded.
Stop of `ora.rac2.ons` on member `rac2` succeeded.
Stop of `ora.rac1.gsd` on member `rac1` succeeded.
Stop of `ora.rac1.ons` on member `rac1` succeeded.
Stop of `ora.orcl.db` on member `rac1` succeeded.
`ora.orcl.orcl1.inst` is already OFFLINE.
`ora.orcl.orcl2.inst` is already OFFLINE.
Attempting to stop `ora.rac1.ASM1.asm` on member `rac1`
Attempting to stop `ora.rac1.LISTENER_RAC1.lsnr` on member `rac1`
Attempting to stop `ora.rac2.LISTENER_RAC2.lsnr` on member `rac2`
Attempting to stop `ora.rac2.ASM2.asm` on member `rac2`
Stop of `ora.rac1.LISTENER_RAC1.lsnr` on member `rac1` succeeded.
Attempting to stop `ora.rac1.vip` on member `rac1`
Stop of `ora.rac1.vip` on member `rac1` succeeded.
Stop of `ora.rac2.LISTENER_RAC2.lsnr` on member `rac2` succeeded.
Attempting to stop `ora.rac2.vip` on member `rac2`
Stop of `ora.rac1.ASM1.asm` on member `rac1` succeeded.
Stop of `ora.rac2.vip` on member `rac2` succeeded.
Stop of `ora.rac2.ASM2.asm` on member `rac2` succeeded.
CRS-0216: Could not stop resource 'ora.orcl.orcl1.inst'.
CRS-0216: Could not stop resource 'ora.orcl.orcl2.inst'.
[oracle@rac1 ~]$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora.orcl.db application OFFLINE OFFLINE
ora....crv1.cs application OFFLINE OFFLINE
ora....cl1.srv application OFFLINE OFFLINE
ora....cl2.srv application OFFLINE OFFLINE
ora....l1.inst application OFFLINE OFFLINE
ora....l2.inst application OFFLINE OFFLINE
ora....SM1.asm application OFFLINE OFFLINE
ora....C1.lsnr application OFFLINE OFFLINE
ora.rac1.gsd application OFFLINE OFFLINE
ora.rac1.ons application OFFLINE OFFLINE
ora.rac1.vip application OFFLINE OFFLINE
ora....SM2.asm application OFFLINE OFFLINE
ora....C2.lsnr application OFFLINE OFFLINE
ora.rac2.gsd application OFFLINE OFFLINE
ora.rac2.ons application OFFLINE OFFLINE
ora.rac2.vip application OFFLINE OFFLINE
6 Upgrade CRS + ASM
PRVF-10037 : Failed to retrieve storage type for xx on node xx [ID 1233505.1] 是一个bug 可以忽略
执行rootupgrade.sh脚本
[root@rac1 ~]# /u01/app/11.2.0/grid/rootupgrade.sh
Performing root user operation for Oracle 11g
The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /u01/app/11.2.0/grid
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
Copying dbhome to /usr/local/bin ...
The file "oraenv" already exists in /usr/local/bin. Overwrite it? (y/n)
[n]: y
Copying oraenv to /usr/local/bin ...
The file "coraenv" already exists in /usr/local/bin. Overwrite it? (y/n)
[n]: y
Copying coraenv to /usr/local/bin ...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Using configuration parameter file: /u01/app/11.2.0/grid/crs/install/crsconfig_params
Creating trace directory
User ignored Prerequisites during installation
OLR initialization - successful
root wallet
root wallet cert
root cert export
peer wallet
profile reader wallet
pa wallet
peer wallet keys
pa wallet keys
peer cert request
pa cert request
peer cert
pa cert
peer root cert TP
profile reader root cert TP
pa root cert TP
peer pa cert TP
pa peer cert TP
profile reader pa cert TP
profile reader peer cert TP
peer user cert
pa user cert
Replacing Clusterware entries in inittab
clscfg: EXISTING configuration version 3 detected.
clscfg: version 3 is 10G Release 2.
Successfully accumulated necessary OCR keys.
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
Preparing packages for installation...
cvuqdisk-1.0.9-1
Configure Oracle Grid Infrastructure for a Cluster ... succeeded
节点2
[root@rac2 ~]# /u01/app/11.2.0/grid/rootupgrade.sh
Performing root user operation for Oracle 11g
The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /u01/app/11.2.0/grid
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]:
The file "oraenv" already exists in /usr/local/bin. Overwrite it? (y/n)
[n]:
The file "coraenv" already exists in /usr/local/bin. Overwrite it? (y/n)
[n]:
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Using configuration parameter file: /u01/app/11.2.0/grid/crs/install/crsconfig_params
Creating trace directory
User ignored Prerequisites during installation
OLR initialization - successful
Replacing Clusterware entries in inittab
clscfg: EXISTING configuration version 5 detected.
clscfg: version 5 is 11g Release 2.
Successfully accumulated necessary OCR keys.
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
Start upgrade invoked..
Started to upgrade the Oracle Clusterware. This operation may take a few minutes.
Started to upgrade the OCR.
Started to upgrade the CSS.
Started to upgrade the CRS.
The CRS was successfully upgraded.
Oracle Clusterware operating version was successfully set to 11.2.0.3.0
Preparing packages for installation...
cvuqdisk-1.0.9-1
Configure Oracle Grid Infrastructure for a Cluster ... succeeded
7 设置环境变量
[oracle@rac1 ~]$ more .bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH
export ORACLE_SID=orcl1
export ORACLE_BASE=/u01/app/oracle
export DB_HOME=/u01/app/oracle/product/10.2.0/db_2
export ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_2
export GRID_HOME=/u01/app/11.2.0/grid
export BASE_PATH=/usr/sbin:$PATH
export PATH=$ORACLE_HOME/bin:$PATH
umask 022
[oracle@rac1 ~]$ more grid_env
ORACLE_SID=+ASM1; export ORACLE_SID
ORACLE_HOME=$GRID_HOME; export ORACLE_HOME
PATH=$ORACLE_HOME/bin:$BASE_PATH; export PATH
[oracle@rac1 ~]$ more db_env
RACLE_SID=orcl1; export ORACLE_SID
ORACLE_HOME=$DB_HOME; export ORACLE_HOME
PATH=$ORACLE_HOME/bin:$BASE_PATH; export PATH
8 安装后效验
[oracle@rac1 ~]$ source grid_env
[oracle@rac1 ~]$ crsctl query crs softwareversion
Oracle Clusterware version on node [rac1] is [11.2.0.3.0]
[oracle@rac1 ~]$ crsctl check crs
CRS-4638: Oracle High Availability Services is online
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online
[oracle@rac1 ~]$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora.DATA.dg ora....up.type ONLINE ONLINE rac1
ora.FLA.dg ora....up.type ONLINE ONLINE rac1
ora....ER.lsnr ora....er.type ONLINE ONLINE rac1
ora....N1.lsnr ora....er.type ONLINE ONLINE rac1
ora.asm ora.asm.type ONLINE ONLINE rac1
ora.cvu ora.cvu.type ONLINE ONLINE rac1
ora.gsd ora.gsd.type OFFLINE OFFLINE
ora....network ora....rk.type ONLINE ONLINE rac1
ora.oc4j ora.oc4j.type ONLINE ONLINE rac2
ora.ons ora.ons.type ONLINE ONLINE rac1
ora.orcl.db application ONLINE ONLINE rac2
ora....crv1.cs application ONLINE ONLINE rac1
ora....cl1.srv application ONLINE ONLINE rac1
ora....cl2.srv application ONLINE ONLINE rac2
ora....l1.inst application ONLINE ONLINE rac1
ora....l2.inst application ONLINE ONLINE rac2
ora....SM1.asm application ONLINE ONLINE rac1
ora....C1.lsnr application ONLINE ONLINE rac1
ora.rac1.gsd application OFFLINE OFFLINE
ora.rac1.ons application ONLINE ONLINE rac1
ora.rac1.vip ora....t1.type ONLINE ONLINE rac1
ora....SM2.asm application ONLINE ONLINE rac2
ora....C2.lsnr application ONLINE ONLINE rac2
ora.rac2.gsd application OFFLINE OFFLINE
ora.rac2.ons application ONLINE ONLINE rac2
ora.rac2.vip ora....t1.type ONLINE ONLINE rac2
ora....ry.acfs ora....fs.type ONLINE ONLINE rac1
ora.scan1.vip ora....ip.type ONLINE ONLINE rac1
[oracle@rac1 ~]$ ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 3
Total space (kbytes) : 196544
Used space (kbytes) : 7004
Available space (kbytes) : 189540
ID : 363260635
Device/File Name : /dev/raw/raw1
Device/File integrity check succeeded
Device/File not configured
Device/File not configured
Device/File not configured
Device/File not configured
Cluster registry integrity check succeeded
Logical corruption check bypassed due to non-privileged user
[oracle@rac1 ~]$ crsctl query css votedisk
## STATE File Universal Id File Name Disk group
-- ----- ----------------- --------- ---------
1. ONLINE 913ae56bb5ffef84ff0aef68532af2a2 (/dev/raw/raw2) []
Located 1 voting disk(s).
http://xiangce.baidu.com/picture/detail/e7098f7e902b5660708abaffc22903bdcfdda578
9 upgrade DATABASE
使用DBUA升级数据库
about:blank
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/15747463/viewspace-773488/ ,如需转载,请注明出处,否则将追究法律责任。