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

The next example can be used to remove ASMLIB I/O accessand 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/oracleasmcreatediskDISK1/dev/sda5
Markingdisk"/dev/sda5"asanASMdisk:[OK]

$>ls-l/dev/sda5
brw-rw----1rootdisk8,5May522:27/dev/sda5

$>oracleasmquerydiskDISK1
Disk"DISK1"isavalidASMdiskondevice[8,5]

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

SQL>creatediskgroupTESTexternalredundancydisk'ORCL:DISK1';

Diskgroupcreated.

SQL>selectnamefromv$asm_diskgroup;

NAME
------------------------------
TEST

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


$>kfedread/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=0NUMB=0x0
kfbh.block.obj:2147483648;0x008:TYPE=0x8NUMB=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>alterdiskgroupTESTdismount;

Diskgroupaltered.

5) Shutdown the ASM instance(s).

SQL>shutdownimmediate

ASMinstanceshutdown

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

root@asmstorage~]#cd/etc
[root@asmstorageetc]#cdinit.d
[[email protected]]#./oracleasmstop
UnmountingASMlibdriverfilesystem:[OK]
Unloadingmodule"oracleasm":[OK]

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

[root@asmstoragedev]#ls-l/dev/sda5
brw-rw----1rootdisk8,5May522:27/dev/sda5
[root@asmstoragedev]#chownoracle:dba/dev/sda5
[root@asmstoragedev]#ls-l/dev/sda5
brw-rw----1oracledba8,5May522:27/dev/sda5

8) Startup the ASM instance(s):

SQL>startup
ASMinstancestarted

TotalSystemGlobalArea284565504bytes
FixedSize1299428bytes
VariableSize258100252bytes
ASMCache25165824bytes
ORA-15110:nodiskgroupsmounted

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

SQL>altersystemsetasm_diskstring='/dev/sda5'scope=memory;

Systemaltered.

SQL>showparameterasm_diskstring

NAMETYPEVALUE
-----------------------------------------------------------------------------
asm_diskstringstring/dev/sda5
SQL>

10) Finally, mount the diskgroups:

SQL>alterdiskgrouptestmount;

Diskgroupaltered.

SQL>selectname,statefromv$asm_diskgroup;

NAMESTATE
-----------------------------------------
TESTMOUNTED

From Oracle

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

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

Email: [email protected]

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

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

聊天 群:40132017 聊天2群:69087192

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

你可能感兴趣的:(device)