Databases Reference
In-Depth Information
ASM Instance Setup
Next, we will create some cooked files for ASM storage. ASM will use these files instead of raw
disks. On Windows, the undocumented switch
-create
of the
asmtool
command is used to
create cooked files for use by ASM. The syntax is as follows:
asmtool -create <file_name> <file_size_mb>
We will use the
asmtool
command to create four files which will serve as “disks”. Each file
has a size of 512 MB.
C:\> mkdir C:\oradata
C:\> asmtool -create C:\oradata\ARRAY1_DISK1 512
Repeat the
asmtool
command with the file names
ARRAY1_DISK2
,
ARRAY2_DISK1
, and
ARRAY2_DISK2
to create three more files. On UNIX, the
dd
command is available to accomplish
the same task as
asmtool
-create
. Following is an example for creating a file with a size of 512 MB:
$ dd if=/dev/zero bs=1048576 count=512 of=ARRAY1_DISK1
The above
dd
command reads 512 blocks with a size of 1 MB each from the device special
file
/dev/zero
. Since reading from
/dev/zero
returns nothing but binary zeros, the resulting file
is zeroed out as required by ASM. The
dd
command is available for Windows systems by installing
used to zero out a section within a file to simulate a failure or induce a block corruption.
The four files will be used to simulate two disk arrays (ARRAY1 and ARRAY2) with two
logical units (LUNs) each. We will then set up ASM to mirror across the two arrays. Striping
occurs within the array boundaries.
C:\oradata>ls -l
total 2463840
-rw-rw-rw- 1 ndebes mkpasswd 536870912 Nov 2 13:34 ARRAY1_DISK1
-rw-rw-rw- 1 ndebes mkpasswd 536870912 Nov 2 13:38 ARRAY1_DISK2
-rw-rw-rw- 1 ndebes mkpasswd 536870912 Nov 2 13:40 ARRAY2_DISK1
-rw-rw-rw- 1 ndebes mkpasswd 536870912 Nov 2 13:38 ARRAY2_DISK2
To start an ASM instance, a parameter file that contains
INSTANCE_TYPE=ASM
is required.
The parameter
ASM_DISKSTRING
is used to indicate where ASM should search for disks. Create a
file called
pfile+ASM.ora
with the following contents in
%ORACLE_HOME%\database
:
instance_type = ASM
asm_diskstring = 'c:\oradata\*'
Next, create a Windows service for the ORACLE ASM instance with
oradim
:
C:> oradim -new -asmsid +ASM -syspwd secret -startmode manual -srvcstart demand
Instance created.
The command
oradim
creates and starts a Windows service called OracleASMService+ASM.
You may verify that the service is running with
net
start
.
C:> net start | grep -i asm
OracleASMService+ASM
Now we are ready to start the ASM instance.