其中主要的两步是:
1. 创建文件来模拟磁盘
Perl 脚本如下:
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; }
exit |
并运行:
perl CreateTextFiles.pl
2. 指定ASM 隐含参数,使之支持模拟文件方式:
SQL> alter system set "_asm_allow_only_raw_disks"=false scope=spfile;
SQL> alter system set asm_diskstring='c:\asmdisks\_file*' scope=both;
重启ASM实例后,使用DBCA 进行配置后,就可以发现候选磁盘组。
需要注意的是,如果在虚拟机中测试,如果不能再候选磁盘组中找到磁盘,有可能是文件所在的磁盘没有自动装载,因此还需在diskpart 命令下运行 automount enable
其实还是使用VMware好用。使用文件模拟磁盘,还需打开隐藏函数。
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/9036/viewspace-493951/,如需转载,请注明出处,否则将追究法律责任。