Configure ASM

1. If CSS service is not there, create it by executing the following bat file:

H:\>localconfig add

Step 1: creating new OCR repository

Successfully accumulated necessary OCR keys.

Creating OCR keys for user 'nazmul huda', privgrp ''..

Operation successful.

Step 2: creating new CSS service

successfully created local CSS service

successfully added CSS to home

Automatic Storage Management (ASM) requires the use of Oracle Cluster Synchronization Services (CSS), and as such, CSS must be configured and running before attempting to use ASM. The CSS service is required to enable synchronization between an ASM instance and the database instances that rely on it for database file storage.

2. Creating a dummy disks

I:\>mkdir asmdisks

I:\>asmtool -create I:\asmdisks\disk1 512

I:\>asmtool -create I:\asmdisks\disk2 512

I:\>asmtool -create I:\asmdisks\disk3 512

3. Create Init pfile 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= 'I:\asmdisks\ *'

_ASM_ALLOW_ONLY_RAW_DISKS= FALSE

Note: The undocumented parameter_ASM_ALLOW_ONLY_RAW_DISKS is used to make the instance recognize virtual disks created in previous step.

Of course, in a production database, this parameter is not used.

4. Create the ASM instance service:

I:\>orapwd file=C:\oracle\Product\10.2.0\db_1\database\PWD+ASM.ora password=sys

I:\>oradim -NEW -ASMSID +ASM -STARTMODE auto

Instance created.

5. Startup the Instance

I:\>set oracle_sid=+asm

I:\>SQLPLUS sys/sys as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on Mon Jul 26 19:04:43 2010

Copyright (c) 1982, 2005, Oracle. All rights reserved.

Connected to:

Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production

With the Partitioning, OLAP and Data Mining options

SQL> startup force;

ASM instance started

Total System Global Area 79691776 bytes

Fixed Size 1247396 bytes

Variable Size 53278556 bytes

ASM Cache 25165824 bytes

ORA-15110: no diskgroups mounted

6. Create ASM disk group

a) Create asm disk group

SQL> column path format a25

SQL> column mount_status format a25

SQL> select path, mount_status from v$asm_disk;

PATH MOUNT_STATUS

------------------------- ------------------------

I:\ASMDISKS\DISK1 CLOSED

I:\ASMDISKS\DISK3 CLOSED

I:\ASMDISKS\DISK2 CLOSED

SQL> create diskgroup data external redundancy disk

'I:\ASMDISKS\DISK1',

'I:\ASMDISKS\DISK2',

'I:\ASMDISKS\DISK3';

Diskgroup created.

b) Change PFILE to SPFILE, Add ASM Diskgroup parameter and your all set to go and use ASM.

SQL> create spfile from pfile;

File created.

SQL> startup force;

ASM instance started

Total System Global Area 79691776 bytes

Fixed Size 1247396 bytes

Variable Size 53278556 bytes

ASM Cache 25165824 bytes

ORA-15110: no diskgroups mounted

SQL> alter system set asm_diskgroups= data scope=spfile;

System altered.

SQL> startup force;

ASM instance started

Total System Global Area 79691776 bytes

Fixed Size 1247396 bytes

Variable Size 53278556 bytes

ASM Cache 25165824 bytes

ASM diskgroups mounted

Now you can go ahead and use your DBCA and create a database.

ADD Another Disk:

I:\>asmtool -create I:\asmdisks\disk4 512

SQL>alter diskgroup data add disk

'F:\ASMDISKS\DISK4';

Rebalancing:

SQL> ALTER DISKGROUP data REBALANCE POWER 3;

Drop a Disk:

SQL>select path,name,mount_status from v$asm_disk;

SQL> ALTER DISKGROUP DATA DROP DISK DATA_0003;

SQL> ALTER DISKGROUP data REBALANCE POWER 5;

SQL> select path,name,mount_status from v$asm_disk;

Create a tablespace:

SQL> create tablespace test

datafile '+data' size 5M;

Tablespace created.

SQL> select name from v$datafile;

NAME

----------------------------------------------

+DATA/dba66/datafile/system.256.725716031

+DATA/dba66/datafile/undotbs1.258.725716031

+DATA/dba66/datafile/sysaux.257.725716031

+DATA/dba66/datafile/users.259.725716031

+DATA/dba66/datafile/test.270.725716511