10g RAC:More details on ASM DiskGroup
今天,在创建ASM磁盘组的时候遇到了一个问题:
从图中可以看到,当前的磁盘组“+DATA01”的状态必然是不正常的。
该磁盘组所依赖的底层块设备之前被使用过,但是没有被清空,故而留有旧的记录。
“+DATA01”,对应的底层块设备是:/dev/sda3,后被rawdevices包装为:/dev/raw/raw3。
如下所示:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
[root@xymis1 ~]# service rawdevices status /dev/raw/raw1: bound to major 8, minor 1 /dev/raw/raw2: bound to major 8, minor 2 /dev/raw/raw3: bound to major 8, minor 3 [root@xymis1 ~]# [root@xymis1 ~]# fdisk /dev/sda -l Disk /dev/sda: 1198.4 GB, 1198446870528 bytes 255 heads, 63 sectors/track, 145702 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sda1 1 123 987966 83 Linux /dev/sda2 124 246 987997+ 83 Linux /dev/sda3 247 145702 1168375320 83 Linux [root@xymis1 ~]# [root@xymis1 ~]# strings /dev/sda3 | head -n 10 ORCLDISK DATA01_0000 DATA01 DATA01_0000 0 8 ( @ 0 H 8 P @ X H [root@xymis1 ~]# [root@xymis1 ~]# strings /dev/raw/raw3 | head -n 10 ORCLDISK DATA01_0000 DATA01 DATA01_0000 0 8 ( @ 0 H 8 P @ X H [root@xymis1 ~]# |
首先,将其上旧的记录清除:
1 2 3 4 5 |
[root@xymis1 ~]# dd if=/dev/zero of=/dev/raw/raw3 bs=1M count=512 512+0 records in 512+0 records out 536870912 bytes (537 MB) copied, 0.979384 seconds, 548 MB/s [root@xymis1 ~]# |
确认已经没有记录:
1 2 3 4 5 6 7 |
[root@xymis1 ~]# strings /dev/sda3 | head -n 10 [root@xymis1 ~]# strings /dev/raw/raw3 | head -n 10 [root@xymis1 ~]# |
如上操作完成后,再通过“oracle”操作系统用户启动“dbca”的ASM管理,创建新的ASM磁盘组:
创建完成后,再次查看块设备的信息:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
[root@xymis1 ~]# strings /dev/sda3 | head -n 10 ORCLDISK DATA01_0000 DATA01 DATA01_0000 0 8 ( @ 0 H 8 P @ X H [root@xymis1 ~]# [root@xymis1 ~]# strings /dev/raw/raw3 | head -n 10 ORCLDISK DATA01_0000 DATA01 DATA01_0000 0 8 ( @ 0 H 8 P @ X H [root@xymis1 ~]# |
这样,ASM DiskGroup就创建完成了:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
[root@xymis1 ~]# su - oracle [oracle@xymis1 ~]$ env | grep SID ORACLE_SID=dblogic1 [oracle@xymis1 ~]$ ps -ef | grep pmon oracle 2798 2660 0 20:59 pts/1 00:00:00 grep pmon oracle 26893 1 0 20:39 ? 00:00:00 asm_pmon_+ASM1 [oracle@xymis1 ~]$ [oracle@xymis1 ~]$ export ORACLE_SID=+ASM1 [oracle@xymis1 ~]$ [oracle@xymis1 ~]$ asmcmd ASMCMD> lsdg State Type Rebal Unbal Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Name MOUNTED EXTERN N N 512 4096 1048576 1140991 1140888 0 1140888 0 DATA01/ ASMCMD> ASMCMD> exit [oracle@xymis1 ~]$ [oracle@xymis1 ~]$ |
——————————————————————————————
Done。
今天的事情差不多完了,… 可以下班了。
在上文中用的“strings”的探查的方法,估计很多前辈都用到过了,其实没有什么大不了的。
该努力的地方还有很多。
路漫漫,… etc