签到成功

知道了

CNDBA社区CNDBA社区

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

2016-11-25 15:50 1551 0 原创 Oracle 11g
作者: dave

 

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

http://www.cndba.cn/Dave/article/805

 

<<< 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):

http://www.cndba.cn/Dave/article/805

 

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:http://www.cndba.cn/Dave/article/805

 


$> 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
.

 http://www.cndba.cn/Dave/article/805

4) Dismount the diskgroups:

http://www.cndba.cn/Dave/article/805

 


SQL> alter diskgroup TEST dismount;

Diskgroup altered.
http://www.cndba.cn/Dave/article/805http://www.cndba.cn/Dave/article/805

 

5) Shutdown the ASM instance(s).

 

SQL> shutdown immediate

ASM instance shutdown

 

http://www.cndba.cn/Dave/article/805

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:http://www.cndba.cn/Dave/article/805

 

[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:

 

http://www.cndba.cn/Dave/article/805

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

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

Blog http://blog.csdn.net/tianlesoftware

Email: dvd.dba@gmail.com

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

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

聊天 群:40132017   聊天2群:69087192

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

版权声明:本文为博主原创文章,未经博主允许不得转载。

oracle 11g

用户评论
* 以下用户言论只代表其个人观点,不代表CNDBA社区的观点或立场
dave

dave

关注

人的一生应该是这样度过的:当他回首往事的时候,他不会因为虚度年华而悔恨,也不会因为碌碌无为而羞耻;这样,在临死的时候,他就能够说:“我的整个生命和全部精力,都已经献给世界上最壮丽的事业....."

  • 2284
    原创
  • 3
    翻译
  • 580
    转载
  • 197
    评论
  • 访问:8216302次
  • 积分:4433
  • 等级:核心会员
  • 排名:第1名
精华文章
    最新问题
    查看更多+
    热门文章
      热门用户
      推荐用户
        Copyright © 2016 All Rights Reserved. Powered by CNDBA · 皖ICP备2022006297号-1·

        QQ交流群

        注册联系QQ