oracle 升级时遇到关于asm的问题
软件环境:系统:rhel-server-5.4-x86_64
数据库:oracle10201
asm环境:
oracleasm-2.6.18-164.el5-2.0.5-1.el5.x86_64.rpm
oracleasmlib-2.0.4-1.el5.x86_64.rpm
oracleasm-support-2.1.7-1.el5.x86_64.rpm
本来是想安装好数据库就建库,在进行升级实验。没想到进行了数据软件升级后,进行数据字典升级时,问题出现了,asm实例起不了:
$ export ORACLE_SID=+ASM
$ sqlplus / as sysdba
SQL*Plus:> Copyright (c) 1982, 2005, Oracle.All rights reserved.
Connected to an> SQL> startup
ASM instance started
Total System Global Area130023424 bytes
Fixed>
Variable> ASM Cache 25165824 bytes
ORA-15032: not all> ORA-15063: ASM discovered an insufficient number of disks for diskgroup "PENG"
到系统上查看,列出已有的Oracle ASMLib disks:
# /etc/init.d/oracleasm listdisks
没有输出。
但是查看Oracle ASMlib所包含的磁盘时,却有相关信息:
# /etc/init.d/oracleasm querydisk /dev/VolGroup00/LogVol02
Device "/dev/VolGroup00/LogVol02" is marked an ASM disk with the label "VOL1"
# /etc/init.d/oracleasm querydisk /dev/VolGroup00/LogVol03
Device "/dev/VolGroup00/LogVol03" is marked an ASM disk with the label "VOL2"
试着进行Oracle ASMlib磁盘扫描:
# /etc/init.d/oracleasm scandisks
Scanning the system for Oracle ASMLib disks:
# /etc/init.d/oracleasm listdisks
扫描显示ok,但是再次查看仍然没有结果。
继续查找原因:
# mount
/dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/sda1 on /boot type ext3 (rw)
tmpfs on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
none on /proc/fs/vmblock/mountPoint type vmblock (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
oracleasmfs on /dev/oracleasm type oracleasmfs (rw)
发现asm磁盘挂载/dev/oracleasm下。
# ls
disksiid
# ls disks/
# ls iid/
0000000000000001
果然disks下没有文件,正常是有相应的设备文件的。
查看报错日志发现:
# tail -19 /var/log/oracleasm
Reloading disk partitions: done
Cleaning any stale ASM disks...
Scanning system for ASM disks...
oracleasm-read-label: Unable to open device "/dev/dm-0": No such file or directory
oracleasm-read-label: Unable to open device "/dev/dm-0": No such file or directory
oracleasm-read-label: Unable to open device "/dev/dm-0": No such file or directory
oracleasm-read-label: Unable to open device "/dev/dm-0": No such file or directory
oracleasm-read-label: Unable to open device "/dev/dm-1": No such file or directory
oracleasm-read-label: Unable to open device "/dev/dm-1": No such file or directory
oracleasm-read-label: Unable to open device "/dev/dm-1": No such file or directory
oracleasm-read-label: Unable to open device "/dev/dm-1": No such file or directory
oracleasm-read-label: Unable to open device "/dev/dm-2": No such file or directory
oracleasm-read-label: Unable to open device "/dev/dm-2": No such file or directory
oracleasm-read-label: Unable to open device "/dev/dm-2": No such file or directory
oracleasm-read-label: Unable to open device "/dev/dm-2": No such file or directory
oracleasm-read-label: Unable to open device "/dev/dm-3": No such file or directory
oracleasm-read-label: Unable to open device "/dev/dm-3": No such file or directory
oracleasm-read-label: Unable to open device "/dev/dm-3": No such file or directory
oracleasm-read-label: Unable to open device "/dev/dm-3": No such file or directory
# ls /dev/dm-*
ls: /dev/dm-*: 没有那个文件或目录
果然,没有结果的原因是因为在扫描系统的asm磁盘是不能读取/dev/dm-0,/dev/dm-1,/dev/dm-2,/dev/dm-3设备
没有,可不可以自己通过udev定义规则来生成一个呢?而一些设备信息会放在/sys/block/目录下,进入该目录下发现,所缺的设备都已经存在:
# cd /sys/block/
# ls
dm-0dm-2fd0md0 ram1 ram11ram13ram15ram3ram5ram7ram9
dm-1dm-3hdcram0ram10ram12ram14ram2 ram4ram6ram8sda
此时才明白,原来在第一次创建asm磁盘时,这些设备文件都已经创建,只是没在系统中进行注册,所以再次启动asm时,系统不能正常的识别的这些设备而已。
既然这样,就手动将这些设备收编了吧。
# udevinfo -a -p /sys/block/dm-0
Udevinfo starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.
looking at device '/block/dm-0':
KERNEL=="dm-0"
SUBSYSTEM=="block"
SYSFS{stat}==" 21819 0 9224021690960 13024 0 1041921251320 0 1689722942280"
SYSFS{size}=="20971520"
SYSFS{removable}=="0"
SYSFS{range}=="1"
SYSFS{dev}=="253:0"
依次将dm-1,dm-2,dm-3的信息打印出来,并写入/etc/udev/rule.d/90-dm.rules
文件中。
# cat 90-dm.rules
KERNEL=="dm-0",SUBSYSTEM=="block",SYSFS{size}=="20971520", SYSFS{dev}=="253:0"
KERNEL=="dm-1",SUBSYSTEM=="block",SYSFS{size}=="4128768",SYSFS{dev}=="253:1"
KERNEL=="dm-2",SUBSYSTEM=="block",SYSFS{size}=="16842752",SYSFS{dev}=="253:2"
KERNEL=="dm-3",SUBSYSTEM=="block",SYSFS{size}=="16842752",SYSFS{dev}=="253:3"
# start_udev
启动 udev: [确定]
将规则文件中得信息和相应的设备进行匹配。
# ls /dev/dm-*
/dev/dm-0/dev/dm-1/dev/dm-2/dev/dm-3
查看设备文件已经生成。
# /etc/init.d/oracleasm scandisks
Scanning the system for Oracle ASMLib disks:
再次进行设备扫描。然后列出设备。
# /etc/init.d/oracleasm listdisks
VOL1
VOL2
# tail -7 /var/log/oracleasm
Reloading disk partitions: done
Cleaning any stale ASM disks...
Scanning system for ASM disks...
Disk "VOL1" does not exist or is not instantiated
Instantiating disk "VOL1"
Disk "VOL2" does not exist or is not instantiated
Instantiating disk "VOL2"
查看日志,一切正常。
# ls /dev/oracleasm/disks/
VOL1VOL2
/dev/oracleasm/disks下的设备文件显示正常。
再次启动asm实例:
$ export ORACLE_SID=+ASM
$ sqlplus / as sysdba
SQL*Plus:> Copyright (c) 1982, 2005, Oracle.All rights reserved.
Connected to an> SQL> startup
ASM instance started
Total System Global Area130023424 bytes
Fixed>
Variable> ASM Cache 25165824 bytes
ASM diskgroups mounted
问题解决,可以进行继续升级了。
页:
[1]