Wednesday, August 29, 2012

Manually configure ASM Instance on Windows


Steps to create ASM instance on windows.

Step 1:  Create New Partition for Device Files
Create partitions for device files like E:\, F:\

Step 2: Create CSS service if it is not there; Cluster Synchronization Services (CSS) is required to enable synchronization between an Automatic Storage Management (ASM) instance and the database instances.
Create this service by running the following batch file
D:\oracle\product\10.2.0\db_1\BIN>localconfig add   -- it will give the following output
            Step 1:  creating new OCR repository
            Successfully accumulated necessary OCR keys.
            Creating OCR keys for user 'mohe\inam', privgrp ''..
            Operation successful.
            Step 2:  creating new CSS service
            successfully created local CSS service
            successfully added CSS to home

Step 3: Building the ASM Candidate "disks" using asmtool. Asmtool  helps to stamp the new disks on windows for using as ASM Disks. You can use asmtoolg (GUI version) also. Execute Following Command on Command Prompt.

D:\oracle\product\10.2.0\db_1\BIN>asmtool -create d:\ASMTEST\DISK1 1024
D:\oracle\product\10.2.0\db_1\BIN>asmtool -create d:\ASMTEST\DISK2 1024
D:\oracle\product\10.2.0\db_1\BIN>asmtool -create d:\ASMTEST\DISK3 1024

Step 4: Create Admin Directories for your new ASM instance

D:\ASMTEST\DATABASE\admin\+ASM\bdump
D:\ASMTEST\DATABASE\admin\+ASM\cdump
D:\ASMTEST\DATABASE\admin\+ASM\hdump
D:\ASMTEST\DATABASE\admin\+ASM\pfile
D:\ASMTEST\DATABASE\admin\+ASM\udump

Step 5: Create ASM Instance Parameter File

filenam>>   D:\ASMTEST\DATABASE\admin\+ASM\pfile\init.ora

INSTANCE_TYPE=ASM
_ASM_ALLOW_ONLY_RAW_DISKS = FALSE
DB_UNIQUE_NAME = +ASM
ASM_DISKSTRING ='D:\ASMTEST\DISK*'
LARGE_POOL_SIZE = 16M
BACKGROUND_DUMP_DEST = 'D:\ASMTEST\DATABASE\admin\+ASM\bdump'
USER_DUMP_DEST = 'D:\ASMTEST\DATABASE\admin\+ASM\udump'
CORE_DUMP_DEST = 'D:\ASMTEST\DATABASE\admin\+ASM\cdump'
ASM_DISKGROUPS='DB_DATA' ,'DB_ARCHIVELOG'

Step 6: Creating ASM Instance
D:\oracle\product\10.2.0\db_1\BIN>oradim -new -asmsid +ASM -syspwd asm123 -pfile d:\asmtest\database\admin\+ASM\pfile\init.ora -startmode a
Instance created.

Step 7: Starting the ASM Instance
D:\oracle\product\10.2.0\db_1\BIN>set ORACLE_SID=+ASM
D:\oracle\product\10.2.0\db_1\BIN>sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Tue Oct 26 10:42:13 2010
Copyright (c) 1982, 2005, Oracle.  All rights reserved.
Connected to an idle instance.
SQL> startup nomount pfile='D:\ASMTEST\DATABASE\admin\+ASM\pfile\init.ora'
ASM instance started
Total System Global Area   88080384 bytes
Fixed Size                  1247444 bytes
Variable Size              61667116 bytes
ASM Cache                  25165824 bytes

Step 8: Create ASM Disk Groups
Check the asm disk status
SQL> SELECT group_number, disk_number, mount_status, header_status, state, path FROM v$asm_disk
  2  /

GROUP_NUMBER DISK_NUMBER MOUNT_S HEADER_STATU STATE
------------ ----------- ------- ------------ --------
PATH
--------------------------------------------------------------------------------
           0           0 CLOSED  CANDIDATE    NORMAL
D:\ASMTEST\DISK1
           0           2 CLOSED  CANDIDATE    NORMAL
D:\ASMTEST\DISK3
           0           1 CLOSED  CANDIDATE    NORMAL
D:\ASMTEST\DISK2

The value of zero in the GROUP_NUMBER column for all four disks. This indicates that a disk is available but hasn't yet been assigned to a disk group.
 SQL> CREATE DISKGROUP DB_DATA NORMAL REDUNDANCY FAILGROUP controller1 DISK 'D:\ASMTEST\DISK1', 'D:\ASMTEST\DISK2'
  2    FAILGROUP controller2 DISK 'D:\ASMTEST\DISK3', 'D:\ASMTEST\DISK4';

Diskgroup created.

Step 9: Mount diskgroup
SQL> shutdown immediate;
ASM diskgroups dismounted
ASM instance shutdown
SQL> startup nomount pfile='D:\ASMTEST\DATABASE\admin\+ASM\pfile\init.ora'
ASM instance started

Total System Global Area   88080384 bytes
Fixed Size                  1247444 bytes
Variable Size              61667116 bytes
ASM Cache                  25165824 bytes
SQL> SELECT group_number, disk_number, mount_status, header_status, state, path FROM v$asm_disk;
GROUP_NUMBER DISK_NUMBER MOUNT_S HEADER_STATU STATE
------------ ----------- ------- ------------ --------
PATH
--------------------------------------------------------------------------------
           0           0 CLOSED  MEMBER       NORMAL
D:\ASMTEST\DISK1
           0           3 CLOSED  MEMBER       NORMAL
D:\ASMTEST\DISK4
           0           2 CLOSED  MEMBER       NORMAL
D:\ASMTEST\DISK3

GROUP_NUMBER DISK_NUMBER MOUNT_S HEADER_STATU STATE
------------ ----------- ------- ------------ --------
PATH
--------------------------------------------------------------------------------
           0           1 CLOSED  MEMBER       NORMAL
D:\ASMTEST\DISK2

SQL> alter diskgroup DB_DATA mount;
Diskgroup altered.


SQL> SELECT group_number, disk_number, mount_status, header_status, state, path FROM v$asm_disk;
GROUP_NUMBER DISK_NUMBER MOUNT_S HEADER_STATU STATE
------------ ----------- ------- ------------ --------
PATH
--------------------------------------------------------------------------------
           1           0 CACHED  MEMBER       NORMAL
D:\ASMTEST\DISK1
           1           1 CACHED  MEMBER       NORMAL
D:\ASMTEST\DISK2
          1           2 CACHED  MEMBER       NORMAL
D:\ASMTEST\DISK3

GROUP_NUMBER DISK_NUMBER MOUNT_S HEADER_STATU STATE
------------ ----------- ------- ------------ --------
PATH
--------------------------------------------------------------------------------
           1           3 CACHED  MEMBER       NORMAL
D:\ASMTEST\DISK4

Step 10: Test ASM Instance (some admin task)
C:\Documents and Settings\inam> sqlplus / as sysdba
SQL> ALTER DISKGROUP DB_DATA ADD DIRECTORY '+DB_DATA/my_dir';

Diskgroup altered.
ALTER DISKGROUP DB_DATA RENAME DIRECTORY '+DB_DATA/my_dir' TO '+DB_DATA/my_dir_2';

1 comment: