Tuesday, December 29, 2009

Configuring ASM on Windows environment

1) With asmtool

Follow below steps and create a ASM diskgroup on your local m/c

1) Creating a disks with asmtool

D:\>mkdir asmdisks
D:\>cd asmdisks
D:\asmdisks>asmtool -create D:\asmdisks\disk1 1024
D:\asmdisks>asmtool -create D:\asmdisks\disk2 1024
D:\asmdisks>asmtool -create D:\asmdisks\disk3 1024

Note: - size should be in MB’s

Now you have 3 disks of 1024mb each which can be used to create a ASM disk group.

2) Create ASM instance: -

a) Configure Cluster Synchronization Service: -

C:\oracle\product\10.2.0\db_1\BIN>localconfig add

Step 1: stopping local CSS stack
Step 2: deleting OCR repository
Step 3: creating new OCR repository
successfully accumulated necessary OCR keys.
Creating OCR keys for user 'hostname', privgrp ' ' . .
Operation successful.
Step 4: creating new CSS service
successfully created local CSS service
successfully reset location of CSS setup

b) Create init file: -

Open notepad edit the following parameters and save file as "C:\oracle\product\ 10.2.0\db_ 1\database\ init+ASM. ora"
INSTANCE_TYPE= ASM
DB_UNIQUE_NAME= +ASM
LARGE_POOL_SIZE= 8M
ASM_DISKSTRING= 'D:\asmdisks\ *'
_ASM_ALLOW_ONLY_ RAW_DISKS= FALSE

c) Create service and password file
oradim will create an ASM instance and start it automatically.
D:\> orapwd file=C:\oracle\ product\10. 2.0\db_1\ database\ PWD+ASM.ora password=asm
D:\> oradim -NEW -ASMSID +ASM -STARTMODE auto

3) Starting ASM instance: -

a) Change PFILE to SPFILE, Add ASM Diskgroup parameter and your all set to go and use ASM.
SQL> create spfile from pfile;
SQL> startup nomount;

Create asm disk group: -

SQL> select path, mount_status from v$asm_disk;
PATH MOUNT_STATUS
----------------------- -------------------
D:\ASMDISKS\ DISK1 CLOSED
D:\ASMDISKS\ DISK3 CLOSED
D:\ASMDISKS\ DISK2 CLOSED

SQL> create diskgroup data external redundancy disk
2 'D:\ASMDISKS\DISK1',
3 'D:\ASMDISKS\DISK2',
4 'D:\ASMDISKS\DISK3'
5 /
Diskgroup created.

SQL> alter system set asm_diskgroups= data scope=spfile;
SQL> shutdown immediate
SQL> startup

ASM instance started
Total System Global Area 83886080 bytes
Fixed Size 1247420 bytes
Variable Size 57472836 bytes
ASM Cache 25165824 bytes
ASM diskgroups mounted

Now you can go ahead and use your DBCA and create a database and on step 6 of 13, you can use Automatic Storage management as your Filesystem.