WINDOWS下的程序员出身,偶尔也写一些linux平台下小程序, 后转行数据库行业,专注于ORACLE和DB2的运维和优化。 同时也是ios移动开发者。欢迎志同道合的朋友一起研究技术。 数据库技术交流群:58308065,23618606
全部博文(599)
分类: Oracle
2009-12-12 13:19:05
如果使用裸设备建立RAC环境,各个节点的OCR设置对应的物理设备名称可能是不一致的。
对于ASM磁盘组而言,三个节点上裸设备的物理名称不一致没有问题。比如在这个RAC环境中:
bash-2.03$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.3.0 - Production on 星期四 11月 26 17:22:16 2009
Copyright (c) 1982, 2006, Oracle. All Rights Reserved.
连接到:
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options
SQL> set pages 100 lines 120
SQL> select inst_id, instance_name, host_name
2 from gv$instance;
INST_ID INSTANCE_NAME HOST_NAME
---------- ---------------- ----------------------------------------------------------------
1 testrac1 racnode1
3 testrac3 racnode3
2 testrac2 racnode2
SQL> exit从 Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options 断开
其中ASM1实例对应的磁盘信息为:
bash-2.03$ hostname
racnode1
bash-2.03$ export ORACLE_SID=+ASM1
bash-2.03$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.3.0 - Production on 星期四 11月 26 17:24:03 2009
Copyright (c) 1982, 2006, Oracle. All Rights Reserved.
连接到:
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options
SQL> set pages 100 lines 120
SQL> col name format a10
SQL> col path format a40
SQL> select group_number, name, state, total_mb
2 from v$asm_diskgroup;
GROUP_NUMBER NAME STATE TOTAL_MB
------------ ------------------------------ ---------------------- ----------
1 DISK MOUNTED 385186
SQL> select disk_number, name, path, total_mb
2 from v$asm_disk
3 where group_number = 1
4 order by 1;
DISK_NUMBER NAME PATH TOTAL_MB
----------- ---------- ---------------------------------------- ----------
0 DISK_0000 /dev/rdsk/c2t1d0s1 128
1 DISK_0001 /dev/rdsk/c2t1d0s6 24318
2 DISK_0002 /dev/rdsk/c2t1d1s1 4096
3 DISK_0003 /dev/rdsk/c2t1d1s3 4096
4 DISK_0004 /dev/rdsk/c2t1d1s4 4096
5 DISK_0005 /dev/rdsk/c2t1d1s5 4096
6 DISK_0006 /dev/rdsk/c2t1d1s6 4092
7 DISK_0007 /dev/rdsk/c2t1d2s4 1024
8 DISK_0008 /dev/rdsk/c2t1d2s5 1024
9 DISK_0009 /dev/rdsk/c2t1d2s6 1023
10 DISK_0010 /dev/rdsk/c2t1d3s1 1024
11 DISK_0011 /dev/rdsk/c2t1d3s3 1024
12 DISK_0012 /dev/rdsk/c2t1d3s4 1024
13 DISK_0013 /dev/rdsk/c2t1d3s5 1024
14 DISK_0014 /dev/rdsk/c2t1d3s6 989
15 DISK_0015 /dev/rdsk/c2t1d4s1 1024
16 DISK_0016 /dev/rdsk/c2t1d4s3 1024
17 DISK_0017 /dev/rdsk/c2t1d4s4 1024
18 DISK_0018 /dev/rdsk/c2t1d4s5 1024
19 DISK_0019 /dev/rdsk/c2t1d4s6 1023
20 DISK_0020 /dev/rdsk/c2t1d5s1 100
21 DISK_0021 /dev/rdsk/c2t1d5s3 100
22 DISK_0022 /dev/rdsk/c2t1d5s4 100
23 DISK_0023 /dev/rdsk/c2t1d5s5 100
24 DISK_0024 /dev/rdsk/c2t1d5s6 100
25 DISK_0025 /dev/rdsk/c2t1d5s7 99
26 DISK_0026 /dev/rdsk/c2t1d6s1 100
27 DISK_0027 /dev/rdsk/c2t1d6s3 100
28 DISK_0028 /dev/rdsk/c2t1d6s4 100
29 DISK_0029 /dev/rdsk/c2t1d6s5 100
30 DISK_0030 /dev/rdsk/c2t1d6s6 100
31 DISK_0031 /dev/rdsk/c2t1d6s7 99
32 DISK_0032 /dev/rdsk/c2t1d7s1 100
33 DISK_0033 /dev/rdsk/c2t1d7s3 100
34 DISK_0034 /dev/rdsk/c2t1d7s4 100
35 DISK_0035 /dev/rdsk/c2t1d7s5 100
36 DISK_0036 /dev/rdsk/c2t1d7s6 100
37 DISK_0037 /dev/rdsk/c2t1d7s7 99
38 DISK_0038 /dev/rdsk/c2t1d8s6 50940
39 DISK_0039 /dev/rdsk/c2t1d13s6 274252
已选择40行。
而ASM2实例对应的磁盘信息为:
bash-2.03$ hostname
racnode2
bash-2.03$ export ORACLE_SID=+ASM2
bash-2.03$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.3.0 - Production on 星期四 11月 26 17:18:59 2009
Copyright (c) 1982, 2006, Oracle. All Rights Reserved.
连接到:
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options
SQL> set pages 100 lines 120
SQL> col name format a10
SQL> col path format a40
SQL> select group_number, name, state, total_mb
2 from v$asm_diskgroup;
GROUP_NUMBER NAME STATE TOTAL_MB
------------ ---------- ---------------------- ----------
1 DISK MOUNTED 385186
SQL> select disk_number, name, path, total_mb
2 from v$asm_disk
3 where group_number = 1
4 order by 1;
DISK_NUMBER NAME PATH TOTAL_MB
----------- ---------- ---------------------------------------- ----------
0 DISK_0000 /dev/rdsk/c2t500601603022E66Ad0s1 128
1 DISK_0001 /dev/rdsk/c2t500601603022E66Ad0s6 24318
2 DISK_0002 /dev/rdsk/c2t500601603022E66Ad1s1 4096
3 DISK_0003 /dev/rdsk/c2t500601603022E66Ad1s3 4096
4 DISK_0004 /dev/rdsk/c2t500601603022E66Ad1s4 4096
5 DISK_0005 /dev/rdsk/c2t500601603022E66Ad1s5 4096
6 DISK_0006 /dev/rdsk/c2t500601603022E66Ad1s6 4092
7 DISK_0007 /dev/rdsk/c2t500601603022E66Ad2s4 1024
8 DISK_0008 /dev/rdsk/c2t500601603022E66Ad2s5 1024
9 DISK_0009 /dev/rdsk/c2t500601603022E66Ad2s6 1023
10 DISK_0010 /dev/rdsk/c2t500601603022E66Ad3s1 1024
11 DISK_0011 /dev/rdsk/c2t500601603022E66Ad3s3 1024
12 DISK_0012 /dev/rdsk/c2t500601603022E66Ad3s4 1024
13 DISK_0013 /dev/rdsk/c2t500601603022E66Ad3s5 1024
14 DISK_0014 /dev/rdsk/c2t500601603022E66Ad3s6 989
15 DISK_0015 /dev/rdsk/c2t500601603022E66Ad4s1 1024
16 DISK_0016 /dev/rdsk/c2t500601603022E66Ad4s3 1024
17 DISK_0017 /dev/rdsk/c2t500601603022E66Ad4s4 1024
18 DISK_0018 /dev/rdsk/c2t500601603022E66Ad4s5 1024
19 DISK_0019 /dev/rdsk/c2t500601603022E66Ad4s6 1023
20 DISK_0020 /dev/rdsk/c2t500601603022E66Ad5s1 100
21 DISK_0021 /dev/rdsk/c2t500601603022E66Ad5s3 100
22 DISK_0022 /dev/rdsk/c2t500601603022E66Ad5s4 100
23 DISK_0023 /dev/rdsk/c2t500601603022E66Ad5s5 100
24 DISK_0024 /dev/rdsk/c2t500601603022E66Ad5s6 100
25 DISK_0025 /dev/rdsk/c2t500601603022E66Ad5s7 99
26 DISK_0026 /dev/rdsk/c2t500601603022E66Ad6s1 100
27 DISK_0027 /dev/rdsk/c2t500601603022E66Ad6s3 100
28 DISK_0028 /dev/rdsk/c2t500601603022E66Ad6s4 100
29 DISK_0029 /dev/rdsk/c2t500601603022E66Ad6s5 100
30 DISK_0030 /dev/rdsk/c2t500601603022E66Ad6s6 100
31 DISK_0031 /dev/rdsk/c2t500601603022E66Ad6s7 99
32 DISK_0032 /dev/rdsk/c2t500601603022E66Ad7s1 100
33 DISK_0033 /dev/rdsk/c2t500601603022E66Ad7s3 100
34 DISK_0034 /dev/rdsk/c2t500601603022E66Ad7s4 100
35 DISK_0035 /dev/rdsk/c2t500601603022E66Ad7s5 100
36 DISK_0036 /dev/rdsk/c2t500601603022E66Ad7s6 100
37 DISK_0037 /dev/rdsk/c2t500601603022E66Ad7s7 99
38 DISK_0038 /dev/rdsk/c2t500601603022E66Ad8s6 50940
39 DISK_0039 /dev/rdsk/c2t500601603022E66Ad13s6 274252
已选择40行。
ASM3磁盘组对应的裸设备也是不同的:
bash-3.00$ hostname
racnode3
bash-3.00$ export ORACLE_SID=+ASM3
bash-3.00$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.3.0 - Production on 星期四 11月 26 18:03:01 2009
Copyright (c) 1982, 2006, Oracle. All Rights Reserved.
连接到:
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options
SQL> set pages 100 lines 120
SQL> col name format a10
SQL> col path format a40
SQL> select group_number, name, state, total_mb
2 from v$asm_diskgroup;
GROUP_NUMBER NAME STATE TOTAL_MB
------------ ---------- ---------------------- ----------
1 DISK MOUNTED 385186
SQL> select disk_number, name, path, total_mb
2 from v$asm_disk
3 where group_number = 1
4 order by 1;
DISK_NUMBER NAME PATH TOTAL_MB
----------- ---------- ---------------------------------------- ----------
0 DISK_0000 /dev/rdsk/c1t500601603022E66Ad0s1 128
1 DISK_0001 /dev/rdsk/c1t500601603022E66Ad0s6 24318
2 DISK_0002 /dev/rdsk/c1t500601603022E66Ad1s1 4096
3 DISK_0003 /dev/rdsk/c1t500601603022E66Ad1s3 4096
4 DISK_0004 /dev/rdsk/c1t500601603022E66Ad1s4 4096
5 DISK_0005 /dev/rdsk/c1t500601603022E66Ad1s5 4096
6 DISK_0006 /dev/rdsk/c1t500601603022E66Ad1s6 4092
7 DISK_0007 /dev/rdsk/c1t500601603022E66Ad2s4 1024
8 DISK_0008 /dev/rdsk/c1t500601603022E66Ad2s5 1024
9 DISK_0009 /dev/rdsk/c1t500601603022E66Ad2s6 1023
10 DISK_0010 /dev/rdsk/c1t500601603022E66Ad3s1 1024
11 DISK_0011 /dev/rdsk/c1t500601603022E66Ad3s3 1024
12 DISK_0012 /dev/rdsk/c1t500601603022E66Ad3s4 1024
13 DISK_0013 /dev/rdsk/c1t500601603022E66Ad3s5 1024
14 DISK_0014 /dev/rdsk/c1t500601603022E66Ad3s6 989
15 DISK_0015 /dev/rdsk/c1t500601603022E66Ad4s1 1024
16 DISK_0016 /dev/rdsk/c1t500601603022E66Ad4s3 1024
17 DISK_0017 /dev/rdsk/c1t500601603022E66Ad4s4 1024
18 DISK_0018 /dev/rdsk/c1t500601603022E66Ad4s5 1024
19 DISK_0019 /dev/rdsk/c1t500601603022E66Ad4s6 1023
20 DISK_0020 /dev/rdsk/c1t500601603022E66Ad5s1 100
21 DISK_0021 /dev/rdsk/c1t500601603022E66Ad5s3 100
22 DISK_0022 /dev/rdsk/c1t500601603022E66Ad5s4 100
23 DISK_0023 /dev/rdsk/c1t500601603022E66Ad5s5 100
24 DISK_0024 /dev/rdsk/c1t500601603022E66Ad5s6 100
25 DISK_0025 /dev/rdsk/c1t500601603022E66Ad5s7 99
26 DISK_0026 /dev/rdsk/c1t500601603022E66Ad6s1 100
27 DISK_0027 /dev/rdsk/c1t500601603022E66Ad6s3 100
28 DISK_0028 /dev/rdsk/c1t500601603022E66Ad6s4 100
29 DISK_0029 /dev/rdsk/c1t500601603022E66Ad6s5 100
30 DISK_0030 /dev/rdsk/c1t500601603022E66Ad6s6 100
31 DISK_0031 /dev/rdsk/c1t500601603022E66Ad6s7 99
32 DISK_0032 /dev/rdsk/c1t500601603022E66Ad7s1 100
33 DISK_0033 /dev/rdsk/c1t500601603022E66Ad7s3 100
34 DISK_0034 /dev/rdsk/c1t500601603022E66Ad7s4 100
35 DISK_0035 /dev/rdsk/c1t500601603022E66Ad7s5 100
36 DISK_0036 /dev/rdsk/c1t500601603022E66Ad7s6 100
37 DISK_0037 /dev/rdsk/c1t500601603022E66Ad7s7 99
38 DISK_0038 /dev/rdsk/c1t500601603022E66Ad8s6 50940
39 DISK_0039 /dev/rdsk/c1t500601603022E66Ad13s6 274252
已选择40行。
显然实例ASM1中DISK磁盘组中的磁盘/dev/rdsk/c2t1d0s1,对应的就是实例ASM2中DISK磁盘组中的磁盘/dev/rdsk/c2t500601603022E66Ad0s1,也就是实例ASM3中DISK磁盘组中的/dev/rdsk/c1t500601603022E66Ad0s1磁盘。虽然在三个服务器上三者的名称都不相同,但是它们对应的是同一个裸设备。
虽然ASM有能力识别同一个磁盘在不同服务器上的不同的名称,但是对于OCR和VOT盘来说,两个节点上的名称不同是会报错的。在安装时指定的安装节点上的名称,Oracle并不会检查两个节点上的名称是否不一致,也不会报错。但是安装结束后,在非安装节点上执行$ORA_CLS_HOME/root.sh脚本时,Oracle会根据安装节点上的磁盘名称寻找裸设备,如果找不到对应的设备,或者发现两个节点对应的裸设备不一致就会报错。
最简单的办法是通过操作系统上的链接来解决这个问题。
比如当前的三个节点的RAC环境,由于不同服务器使用的网卡不同,导致挂载的裸设备的名称也是不相同的,为了解决这个问题,通过在各个节点上建立相同的链接名称/dev/rac/ocr和/dev/rac/vot,在不同的节点上指向相同的裸设备,而在CLUSTER的安装过程中,统一指向这个相同的链接的名称。
在节点1上:
bash-2.03$ hostname
racnode1
bash-2.03$ ls -l /dev/rac
total 4
lrwxrwxrwx 1 root other 18 Nov 26 16:52 ocr -> /dev/rdsk/c2t1d2s1
lrwxrwxrwx 1 root other 18 Nov 26 16:52 vot -> /dev/rdsk/c2t1d2s3
在节点2上:
bash-2.03$ hostname
racnode2
bash-2.03$ ls -l /dev/rac
total 4
lrwxrwxrwx 1 root other 33 Mar 14 2007 ocr -> /dev/rdsk/c2t500601603022E66Ad2s1
lrwxrwxrwx 1 root other 33 Mar 14 2007 vot -> /dev/rdsk/c2t500601603022E66Ad2s3
在节点3上:
bash-3.00$ hostname
racnode3
bash-3.00$ ls -l /dev/rac
total 4
lrwxrwxrwx 1 root root 33 Jul 1 16:44 ocr -> /dev/rdsk/c1t500601603022E66Ad2s1
lrwxrwxrwx 1 root root 33 Jul 1 16:44 vot -> /dev/rdsk/c1t500601603022E66Ad2s3
通过这种设置后,CLUSTER就可以顺利的安装了。