Chinaunix首页 | 论坛 | 博客
  • 博客访问: 3903498
  • 博文数量: 534
  • 博客积分: 10470
  • 博客等级: 上将
  • 技术积分: 4800
  • 用 户 组: 普通用户
  • 注册时间: 2006-05-26 14:08
文章分类

全部博文(534)

文章存档

2021年(1)

2019年(1)

2017年(1)

2016年(2)

2013年(2)

2012年(10)

2011年(43)

2010年(10)

2009年(17)

2008年(121)

2007年(253)

2006年(73)

分类: 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

  1. Overview
  2. Creating Files for use by ASM
  3. Create ASM Disk Groups



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".

  1. As already mentioned, I have an ASM instance already running on the node named "+ASM". We need to set the following initialization parameters in the ASM instance to allow ASM to use a device rather than a RAW / Logical disk (in our case, a blank text file) and to discover from a non-default location:

    
    
    

  2. 
    
    

  3. 
    
    

  4. 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;
    }

    exit

    Now, 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*'










阅读(3042) | 评论(0) | 转发(0) |
0

上一篇:Move ASM file

下一篇:ASM in Oracle 10g

给主人留下些什么吧!~~