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

 

 

 

 

From Oracle

-------------------------------------------------------------------------------------------------------

QQ: 492913789
Email: ahdba@qq.com
Blog: http://www.cndba.cn/dave

DBA1 群:62697716();   DBA2 群:62697977()   DBA3 群:62697850()  

DBA 超级群:63306533();  DBA4 群: 83829929  DBA5群: 142216823   

聊天 群:40132017   聊天2群:69087192

--加群需要在备注说明Oracle表空间和数据文件的关系,否则拒绝申请

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值