Using cooked files with ASM on Windows

Today I needed to setup a small test Oracle database on Windows with Oracle ASM storage. Because I didn’t have unused disk partitions that I could spare for Oracle ASM, I decided to use cooked files instead.

Note: Using cooked files instead of raw disks is unsupported by Oracle and should not be used on development and production systems! I needed a quick (and dirty) way to do some testing with ASM, I would never use cooked files in development and/or production.

You’ll need dd port for Windows for creating fake ASM disk files. I used dd version 0.5. For a complete explanation of the procedure refer to Metalink Note:602620.1 “ASM Using OS Files Instead of Real Raw Devices On Windows”.

sql> connect / as sysdba
-- Turn on cooked files support in addition to raw disks
sql> alter system set "_asm_allow_only_raw_disks"=false scope=spfile;
-- Let's see what I have on the system
sql> select path from v$asm_disk; 

no rows selected
-- I'll store asm cooked files in C:\ORADATA\ASMDATA so I need to
-- add appropriate disk string for ASM instance to recognize those files
-- as "disk" candidates.
sql> alter system set asm_diskstring='C:\ORADATA\ASMDATA\*' scope=both;
-- At this point restart the ASM instance for parameters to take effect...
-- Let's create a couple of disks, I chose 4 x 500MB files...
cmd> dd if=/dev/zero of=c:\oradata\asmdata\asmdisk01 bs=1k count=500000 
cmd> dd if=/dev/zero of=c:\oradata\asmdata\asmdisk02 bs=1k count=500000
cmd> dd if=/dev/zero of=c:\oradata\asmdata\asmdisk03 bs=1k count=500000
cmd> dd if=/dev/zero of=c:\oradata\asmdata\asmdisk04 bs=1k count=500000
-- Let's check if I see those "disks"...
SQL> select path from v$asm_disk;

--- Now we can create diskgroup with fake ASM disks...
SQL> create diskgroup DGROUP1 external redundancy disk

Diskgroup created.
-- And final check...
SQL> select group_number, name, total_mb, state, 
     database_compatibility from v$asm_diskgroup;

------------ --------------- ---------- ----------- ---------------
           1 DGROUP1               1952 MOUNTED

Posted on 14.01.2008, in Oracle and tagged . Bookmark the permalink. Comments Off on Using cooked files with ASM on Windows.

Comments are closed.