分类: Oracle
2009-09-22 10:52:30
How to use Files in place of Real Disk Devices for ASM - (Windows)
by Jeff Hunter, Sr. Database Administrator
Contents
This article provides the steps to create and configure blank files (instead of real disk devices) for use in testing Oracle's Automatic Storage Manager (ASM) on the Windows platform. This is a handy trick that can be used when the DBA needs to test ASM on a machine that has no free disk partitions or no free disk devices available. Please note that this is intended for testing purposes only!
The first step is to identify an already partitioned and formatted hard disk that contains enough space to contain the blank files to be used as ASM disk devices.
For a detailed article on configuring ASM, see my article: "Manually Creating an ASM Instance".
Here is the Perl script:
CreateTextFiles.pl my $s='0' x 2**20;
open(DF1,">C:/asmdisks/_file_disk1") || die "Cannot create file - $!\n";
open(DF2,">C:/asmdisks/_file_disk2") || die "Cannot create file - $!\n";
open(DF3,">C:/asmdisks/_file_disk3") || die "Cannot create file - $!\n";
open(DF4,">C:/asmdisks/_file_disk4") || die "Cannot create file - $!\n";
for (my $i=1; $i<100; $i++) {
print DF1 $s;
print DF2 $s;
print DF3 $s;
print DF4 $s;
}
exitNow, run the Perl script using your favorite Perl interpreter:
C:\oracle\product\10.1.0\db_1\perl\5.6.1\bin\MSWin32-x86\perl CreateTextFiles.pl
Ok, so now that we have devices that can be seen by the O/S, we can now discover these disks within ASM and then create our ASM disk group.
The following assumes you have the initialization parameter asm_diskstring set properly for the ASM instance. For the purpose of this example, my asm_diskstring parameter is set as follows: *.asm_diskstring='C:\ASMDISKS\_FILE*'