asm无法加载磁盘



--数据库启动后发现找到磁盘
SQL> select group_number,disk_number,mount_status,header_status,name,path from v$asm_disk;   


no rows selected


--查看磁盘
[root@rudy init.d]# oracleasm scandisks
Reloading disk partitions: done
Cleaning any stale ASM disks...
Scanning system for ASM disks...
Instantiating disk "ASM_VOL1"
Unable to instantiate disk "ASM_VOL1"
Instantiating disk "ASM_VOL2"
Unable to instantiate disk "ASM_VOL2"


--尝试重新启动oracleasm
[root@rudy init.d]#  /etc/init.d/oracleasm restart 
Initializing the Oracle ASMLib driver:                     [FAILED]




--查看oracleasm日志
more /var/log/oracleasm 


Cleaning any stale ASM disks...
Scanning system for ASM disks...
oracleasm-read-label: Unable to open device "/dev/sda1": No such file or directory
Disk "ASM_VOL1" does not exist or is not instantiated
Instantiating disk "ASM_VOL1"
oracleasm-instantiate-disk: Unable to open manager: No such device or address
Unable to instantiate disk "ASM_VOL1"
Disk "ASM_VOL2" does not exist or is not instantiated
Instantiating disk "ASM_VOL2"
oracleasm-instantiate-disk: Unable to open manager: No such device or address
Unable to instantiate disk "ASM_VOL2"
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
oracleasm-read-label: Unable to open device "/dev/dm-4": No such file or directory
oracleasm-read-label: Unable to open device "/dev/dm-4": No such file or directory
oracleasm-read-label: Unable to open device "/dev/dm-4": No such file or directory
oracleasm-read-label: Unable to open device "/dev/dm-4": No such file or directory
oracleasm-read-label: Unable to open device "/dev/dm-5": No such file or directory
oracleasm-read-label: Unable to open device "/dev/dm-5": No such file or directory
oracleasm-read-label: Unable to open device "/dev/dm-5": No such file or directory
oracleasm-read-label: Unable to open device "/dev/dm-5": No such file or directory
Loading module "oracleasm": failed
Unable to load module "oracleasm"




--再最后可以看到是找不到ASM组件oracleasm.ko
Loading module "oracleasm": failed
Unable to load module "oracleasm"


--在文件系统中查找
[root@rudy rules.d]#  find / -name oracleasm.ko  
/lib/modules/2.6.18-308.el5/kernel/drivers/addon/oracleasm/oracleasm.ko
--手工安装ASM组件
[root@rudy rules.d]# /sbin/insmod /lib/modules/2.6.18-308.el5/kernel/drivers/addon/oracleasm/oracleasm.ko


--重新执行asm使其enable
/etc/init.d/oracleasm enable


--查看资源状态为OFFLINE           
[oracle@rudy ~]$ crs_stat -t
Name           Type           Target    State     Host        
------------------------------------------------------------
ora....DATA.dg ora....up.type ONLINE    OFFLINE               
ora....ER.lsnr ora....er.type ONLINE    ONLINE    rudy        
ora....ER.lsnr ora....er.type ONLINE    ONLINE    rudy        
ora.asm        ora.asm.type   ONLINE    ONLINE    rudy        
ora.cssd       ora.cssd.type  ONLINE    ONLINE    rudy        
ora.diskmon    ora....on.type ONLINE    ONLINE    rudy        
ora.evmd       ora.evm.type   ONLINE    ONLINE    rudy        
ora....prod.db ora....se.type ONLINE    OFFLINE               
ora.ons        ora.ons.type   OFFLINE   OFFLINE   


--停止crs资源            
[oracle@rudy ~]$ crs_stop -all
CRS-2500: Cannot stop resource 'ora.ons' as it is not running
Attempting to stop `ora.PRD_LISTENER.lsnr` on member `rudy`
Attempting to stop `ora.LISTENER.lsnr` on member `rudy`
Attempting to stop `ora.evmd` on member `rudy`
Attempting to stop `ora.diskmon` on member `rudy`
Attempting to stop `ora.asm` on member `rudy`
CRS-5016: Process "/opt/app/oracle/grid/bin/lsnrctl" spawned by agent "/opt/app/oracle/grid/bin/oraagent.bin" for action "stop" failed: details at "(:CLSN00010:)" in "/opt/app/oracle/grid/log/rudy/agent/ohasd/oraagent_oracle/oraagent_oracle.log"
Stop of `ora.LISTENER.lsnr` on member `rudy` succeeded.
Stop of `ora.PRD_LISTENER.lsnr` on member `rudy` succeeded.
Stop of `ora.evmd` on member `rudy` succeeded.
Stop of `ora.diskmon` on member `rudy` succeeded.
Stop of `ora.asm` on member `rudy` succeeded.
Attempting to stop `ora.cssd` on member `rudy`
Stop of `ora.cssd` on member `rudy` succeeded.
CRS-0216: Could not stop resource 'ora.ons'.


--重新启动
[oracle@rudy ~]$ crs_start -all
CRS-2501: Resource 'ora.ons' is disabled
Attempting to start `ora.PRD_LISTENER.lsnr` on member `rudy`
Attempting to start `ora.LISTENER.lsnr` on member `rudy`
Attempting to start `ora.cssd` on member `rudy`
Attempting to start `ora.diskmon` on member `rudy`
Attempting to start `ora.evmd` on member `rudy`
Start of `ora.evmd` on member `rudy` succeeded.
Start of `ora.diskmon` on member `rudy` succeeded.
Start of `ora.LISTENER.lsnr` on member `rudy` succeeded.
Start of `ora.PRD_LISTENER.lsnr` on member `rudy` succeeded.
Start of `ora.cssd` on member `rudy` succeeded.
Attempting to start `ora.asm` on member `rudy`
Start of `ora.asm` on member `rudy` succeeded.
Attempting to start `ora.ASM_DATA.dg` on member `rudy`
Start of `ora.ASM_DATA.dg` on member `rudy` succeeded.
Attempting to stop `ora.labaprod.db` on member `rudy`
Stop of `ora.labaprod.db` on member `rudy` succeeded.
Attempting to start `ora.labaprod.db` on member `rudy`
Start of `ora.labaprod.db` on member `rudy` succeeded.
CRS-2660: Resource 'ora.ons' or all of its instances are disabled


--再次查看资源状态ONLINE
[oracle@rudy ~]$ crs_stat -t
Name           Type           Target    State     Host        
------------------------------------------------------------
ora....DATA.dg ora....up.type ONLINE    ONLINE    rudy        
ora....ER.lsnr ora....er.type ONLINE    ONLINE    rudy        
ora....ER.lsnr ora....er.type ONLINE    ONLINE    rudy        
ora.asm        ora.asm.type   ONLINE    ONLINE    rudy        
ora.cssd       ora.cssd.type  ONLINE    ONLINE    rudy        
ora.diskmon    ora....on.type ONLINE    ONLINE    rudy        
ora.evmd       ora.evm.type   ONLINE    ONLINE    rudy        
ora....prod.db ora....se.type ONLINE    ONLINE    rudy        
ora.ons        ora.ons.type   OFFLINE   OFFLINE 


--而后连接数据库正常      


--一些常用命令

 /etc/init.d/oracleasm start


/etc/init.d/oracleasm status


/etc/init.d/oracleasm restart


cat /etc/sysconfig/oracleasm


 /etc/init.d/oracleasm scandisks


/etc/init.d/oracleasm listdisks


/etc/init.d/oracleasm querydisk /dev/sda1




 tail -19 /var/log/oracleasm  

上一篇:【Java 虚拟机原理】Android 类加载机制 ( 双亲委派机制 | BootClassLoader | PathClassLoader | DexClassLoader )


下一篇:【Unity3D 灵巧小知识点】 ☀️ | 字符串截取,截取某个路径字符串中 末尾文件 的名字