0
点赞
收藏
分享

微信扫一扫

How To Migrate ASMLIB devices to Block Devices (non-ASMLIB)


 

       The next example can be used to remove ASMLIB I/O access  and allow ASM to access the block devices directly:

 

<<< Before Continue With The Next Action Plan, Please Make Sure You Have A Full Database Backup Of All The Databases Allocated In Your Diskgroup>>>

 

1) List all the existing ASMLIB disks to obtain the major and minor numbers (for this example I created DISK1 on /dev/sda5):

 

​# /etc/init.d/oracleasm createdisk DISK1 /dev/sda5 ​​​​Marking disk "/dev/sda5" as an ASM disk:                   [  OK  ] ​
​$> ls -l /dev/sda5 ​​​​brw-rw----  1 root disk 8, 5 May  5 22:27 /dev/sda5 ​
​$> oracleasm querydisk DISK1 ​​​​Disk "DISK1" is a valid ASM disk on device [8, 5] ​

 

2) List all the existing diskgroups (for this example I created the TEST diskgroup):

 

​SQL> create diskgroup TEST external redundancy disk 'ORCL:DISK1'; ​​​
​Diskgroup created. ​
​SQL> select name from v$asm_diskgroup; ​
​NAME ​​​​------------------------------ ​​​​TEST ​

3) Check disk header thru kfed associated with all the ASM disks to make sure they are valid:

 

​$> kfed read /dev/oracleasm/disks/DISK1 ​​​​kfbh.endian:                          1 ; 0x000: 0x01 ​​​​kfbh.hard:                          130 ; 0x001: 0x82 ​​​​kfbh.type:                            1 ; 0x002: KFBTYP_DISKHEAD ​​​​kfbh.datfmt:                          1 ; 0x003: 0x01 ​​​​kfbh.block.blk:                       0 ; 0x004: T=0 NUMB=0x0 ​​​​kfbh.block.obj:              2147483648 ; 0x008: TYPE=0x8 NUMB=0x0 ​​​​kfbh.check:                  3723615947 ; 0x00c: 0xddf1decb ​​​​kfbh.fcn.base:                        0 ; 0x010: 0x00000000 ​​​​kfbh.fcn.wrap:                        0 ; 0x014: 0x00000000 ​​​​kfbh.spare1:                          0 ; 0x018: 0x00000000 ​​​​kfbh.spare2:                          0 ; 0x01c: 0x00000000 ​​​​kfdhdb.driver.provstr:    ORCLDISKDISK1 ; 0x000: length=13 ​​​​kfdhdb.driver.reserved[0]:   1263749444 ; 0x008: 0x4b534944 ​​​​kfdhdb.driver.reserved[1]:           49 ; 0x00c: 0x00000031 ​​​​kfdhdb.driver.reserved[2]:            0 ; 0x010: 0x00000000 ​​​​kfdhdb.driver.reserved[3]:            0 ; 0x014: 0x00000000 ​​​​kfdhdb.driver.reserved[4]:            0 ; 0x018: 0x00000000 ​​​​kfdhdb.driver.reserved[5]:            0 ; 0x01c: 0x00000000 ​​​​kfdhdb.compat:                168820736 ; 0x020: 0x0a100000 ​​​​. ​​​​. ​

 

4) Dismount the diskgroups:

 

​SQL> alter diskgroup TEST dismount; ​​​
​Diskgroup altered. ​

 

5) Shutdown the ASM instance(s).

 

​SQL> shutdown immediate ​​​
​ASM instance shutdown ​

 

6) Unload the ASMLIB module and dismount the asmlib filesystem:

 

​root@asmstorage ~]# cd /etc ​​​​[root@asmstorage etc]# cd init.d ​​​​[root@asmstorage init.d]# ./oracleasm stop ​​​​Unmounting ASMlib driver filesystem:                       [  OK  ] ​​​​Unloading module "oracleasm":                              [  OK  ] ​

 

7) Change the ownership for the block devices associated with the ASMLIB disks to oracle:dba:

 

​[root@asmstorage dev]# ls -l  /dev/sda5 ​​​​brw-rw----  1 root disk 8, 5 May  5 22:27 /dev/sda5 ​​​​[root@asmstorage dev]# chown oracle:dba /dev/sda5 ​​​​[root@asmstorage dev]# ls -l  /dev/sda5 ​​​​brw-rw----  1 oracle dba 8, 5 May  5 22:27 /dev/sda5 ​

 

8) Startup the ASM instance(s):

 

​SQL> startup ​​​​ASM instance started ​
​Total System Global Area  284565504 bytes ​​​​Fixed Size                  1299428 bytes ​​​​Variable Size             258100252 bytes ​​​​ASM Cache                  25165824 bytes ​​​​ORA-15110: no diskgroups mounted ​

 

9) Update the asm_diskstring parameter pointing to the block devices:

 

​SQL> alter system set asm_diskstring = '/dev/sda5' scope=memory; ​​​
​System altered. ​
​SQL> show parameter asm_diskstring  ​
​NAME                                 TYPE        VALUE ​​​​------------------------------------ ----------- ------------------------------ ​​​​asm_diskstring                       string      /dev/sda5 ​​​​SQL>  ​

 

10) Finally, mount the diskgroups:

 

​SQL>  alter diskgroup test mount; ​​​
​Diskgroup altered. ​
​SQL>  select name, state from v$asm_diskgroup; ​
​NAME                           STATE ​​​​------------------------------ ----------- ​​​​TEST                           MOUNTED ​

 

 

 

 

  聊天2群:69087192

举报

相关推荐

0 条评论