Windows 平台下,使用OS files 代替raw devices,步骤如下:
1) If the ASM instance was not created, then create an ASM instance thru the DBCA .
2) Update the initialization parameter file with the next hidden parameter:
Connectedto:
OracleDatabase10gEnterpriseEditionRelease10.2.0.3.0-Production
WiththePartitioning,OracleLabelSecurity,OLAPandDataMiningoptions
INSTANCE_NAME
----------------
+asm
SQL>altersystemset"_asm_allow_only_raw_disks"=falsescope=spfile;
Systemaltered.
3) If you have real raw devices you will see them after create the ASM instance:
SQL>selectpathfromv$asm_disk;
PATH
--------------------------------------------------------------------------------
//./ORCLDISKDG0
//./ORCLDISKDG1
//./ORCLDISKDATA0
//./ORCLDISKDATA1
//./ORCLDISKDATA2
//./ORCLDISKDATA3
//./ORCLDISKFRA0
//./ORCLDISKFRA1
8rowsselected.
4) Create the new directory to allocate the fake files/disks:
SQL>hostmkdird:/asmfake
5) Update the ASM instance with the new path associated with the fake directory:
SQL>altersystemsetasm_diskstring='//./ORCLDISK*','d:/asmfake/*'scope=both;
Systemaltered.
6) Shutdown and startup the ASM instance to apply the changes:
SQL>shutdown
ASMdiskgroupsdismounted
ASMinstanceshutdown
SQL>startup
ASMinstancestarted
TotalSystemGlobalArea83886080bytes
FixedSize1289028bytes
VariableSize57431228bytes
ASMCache25165824bytes
ASMdiskgroupsmounted
SQL>showparameterasm
NAMETYPEVALUE
-----------------------------------------------------------------------------
_asm_allow_only_raw_disksbooleanFALSE
asm_diskgroupsstringDATADG,FRADG
asm_diskstringstring//./ORCLDISK*,d:/asmfake/*
asm_power_limitinteger1
7) In order to create fake files to be used as ASM disks you will need to create them thru the dd command, therefore please install the dd command for windows, you can download it from:
http://www.chrysocome.net/dd
8) Then create the desired fake disks/files on the fake directory:
SQL>hostddif=/dev/zeroof=d:/asmfake/fakeasm1bs=1kcount=1000000
1000000+0recordsin
1000000+0recordsout
SQL>hostddif=/dev/zeroof=d:/asmfake/fakeasm2bs=1kcount=1000000
1000000+0recordsin
1000000+0recordsout
SQL>hostddif=/dev/zeroof=d:/asmfake/fakeasm3bs=1kcount=1000000
1000000+0recordsin
1000000+0recordsout
SQL>hostddif=/dev/zeroof=d:/asmfake/fakeasm4bs=1kcount=1000000
1000000+0recordsin
1000000+0recordsout
SQL>hostdird:/asmfake/*
VolumeindriveDisNewVolume
VolumeSerialNumberis94B6-1FC7
Directoryofd:/asmfake
06/11/200803:00PM<DIR>.
06/11/200803:00PM<DIR>..
06/11/200802:58PM1,024,000,000fakeasm1
06/11/200802:59PM1,024,000,000fakeasm2
06/11/200803:00PM1,024,000,000fakeasm3
06/11/200803:01PM1,024,000,000fakeasm4
4File(s)4,096,000,000bytes
2Dir(s)19,148,734,464bytesfree
9) Connect to the ASM instance and make sure the fake disks are visible:
SQL>selectpathfromv$asm_disk;
PATH
----------------------------------------------------------
D:/ASMFAKE/FAKEASM1
D:/ASMFAKE/FAKEASM2
D:/ASMFAKE/FAKEASM3
D:/ASMFAKE/FAKEASM4
//./ORCLDISKDG0
//./ORCLDISKDG1
//./ORCLDISKDATA0
//./ORCLDISKDATA1
//./ORCLDISKDATA2
//./ORCLDISKDATA3
//./ORCLDISKFRA0
//./ORCLDISKFRA1
12rowsselected.
10) Then create diskgroup(s) using the fake disks:
SQL>creatediskgroupTESTexternalredundancydisk'D:/ASMFAKE/FAKEASM1',
2'D:/ASMFAKE/FAKEASM2',
3'D:/ASMFAKE/FAKEASM3',
4'D:/ASMFAKE/FAKEASM4';
Diskgroupcreated.
SQL>selectname,statefromv$asm_diskgroup;
NAMESTATE
-----------------------------------------
DATADGMOUNTED
FRADGMOUNTED
TESTMOUNTED
SQL>selectname,pathfromv$asm_diskwheregroup_number=3;
NAMEPATH
----------------------------------------------------------------
TEST_0000D:/ASMFAKE/FAKEASM1
TEST_0001D:/ASMFAKE/FAKEASM2
TEST_0002D:/ASMFAKE/FAKEASM3
TEST_0003D:/ASMFAKE/FAKEASM4
11) Now your new diskgroup was created using OS files.
From Oracle
-------------------------------------------------------------------------------------------------------
Blog: http://blog.youkuaiyun.com/tianlesoftware
Email: dvd.dba@gmail.com
DBA1 群:62697716(满); DBA2 群:62697977(满) DBA3 群:62697850(满)
DBA 超级群:63306533(满); DBA4 群: 83829929 DBA5群: 142216823
聊天 群:40132017 聊天2群:69087192
--加群需要在备注说明Oracle表空间和数据文件的关系,否则拒绝申请