Search

Join this Blog for direct reference of any post into your inbox. To join just click on "Join this Site" under "Follower" then Login with your Email.*** DECLARATION: I Maintain this Blog for Helping Myself While at Work and Welcome any body Needing Help!!!.*** CAUTION: Using any of the script from this Blog may contain at Own Risk. These scripts May or May not have been Tested.***

Wednesday, 11 July 2012

Manually Configure ASM on Windows

Database: Oracle 10.2.0.1.0
OS: Windows 2003
Methodology: Not Raw/Logical Disk
Interface: Command line
Before starting the actual process I am going to discuss some other possibilities in my knowledge to create the ASM instance on the same environment.
We can Configure ASM instance DISK environment either using RAW/logical DISK drive or not using RAW device or logical DISK drive.
RAW/Logical DISK
If we are choosing to RAW/local DISK in this way we cannot see the disks.
First we need to create some logical drive not formatted by NTFS or not assign any drive letters.
Go to My computer >right click> Manage> Disk Management or run Diskpart.Exe on command line.
After successful creation of partition use the Asmtoolg.exe, AsmtoolG.exe (Graphical) utility to stamp each partition with an ASM label so that oracle can recognize these partitions as a candidate disks for the ASM instance.
Not Using - RAW/Logical DISK
You can also able to choose not using RAW/Logical DISK on windows, in that case you have to set this parameter: _ASM_ALLOW_ONLY_RAW_DISKS=false
SQL> alter system set "_ASM_ALLOW_ONLY_RAW_DISKS" = FALSE scope=spfile;
Setting this parameter to false will not discover the RAW/Logical DISK. We can view the ASM DISKS. This is an undocumented parameter DONOT use it without the permission of oracle.
Note: Set this parameter after creating the instance. It didn’t work if you tried before. Use this concept only for test environment please.
You can create ASM instance either with DBCA or Manual
DBCA:
  1. Launch Oracle DBCA
  2. Choose 'Configure Automatic Storage Management' and click Next.
  3. Give SYS password to be created for new ASM instance
  4. Oracle creates and ASM instance and a new window pops up for creating disk groups. You can choose disk group creation or finish to complete the ASM installation
For step by step details Please follow the link:
COMMAND LINE:
C:\>oradim -new -asmsid +ASMSHAAN -startmode manual
Instance created.
C:\>oradim -edit -asmsid + ASMSHAAN -startmode a
C:\>oradim -edit -asmsid + ASMSHAAN -syspwd sys
C:\>SET ORACLE_SID=+ ASMSHAAN
C:\>
C:\>sqlplus /nolog
SQL*Plus: Release 10.2.0.1.0 - Production on Tue Jul 10 13:30:14 2012
Copyright (c) 1982, 2005, Oracle. All rights reserved.
SQL>
SQL> conn / as sysdba
Connected to an idle instance.
SQL>
Now create the simple pfile for ASM. Here for the example I created a text file name "initasm.ora" in location 'D:\oracle1\asmshaan\'
background_dump_dest=' D:\oracle1\asmshaan\bdump'
core_dump_dest=' D:\oracle1\asmshaan\cdump'
instance_type=asm
large_pool_size=100M
remote_login_passwordfile='SHARED'
user_dump_dest=' D:\oracle1\asmshaan\udump'
_ASM_ALLOW_ONLY_RAW_DISKS=false
asm_diskstring=' D:\oracle1\asmshaan\asm_disks\*'

SQL> startup pfile='D:\oracle1\asmshaan\initasm.ora';
ORA-29701: unable to connect to Cluster Manager
Note: If you find the above error then go to cmd prompt and set the oracle_sid and delete localconfig.
C:\>set oracle_sid=+ASMSHAAN
C:\> localconfig delete
Step 1: stopping local CSS stack
Step 2: deleting OCR repository
failed to open the OCR subkey, err(1060)
failed to cleanup local OCR repository
successfully deleted local CSS setup
C:\>localconfig add
Step 1: creating new OCR repository
Successfully accumulated necessary OCR keys.
Creating OCR keys for user 'administrator', privgrp ''..
Operation successful.
Step 2: creating new CSS service
successfully created local CSS service
successfully added CSS to home
C:\>sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Tue Jul 10 13:30:14 2012
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to an idle instance
SQL> startup pfile='D:\oracle1\asmshaan\initasm.ora';
ASM instance started
Total System Global Area 186180778 bytes
Fixed Size 1257847 bytes
Variable Size 159846986 bytes
ASM Cache 25264828 bytes
ORA-15110: no diskgroups mounted
SQL> create spfile from pfile=''D:\oracle1\asmshaan\initasm.ora';
File created.
After successful creation of ASM instance. You have to create some disks. This can be done by using asmtool.
C:\>asmtool -create \\.\E:\oracle\asmshaan\ASMDISK\asmdisk1.asm 100m
C:\>asmtool -create \\.\E:\oracle\asmshaan\ASMDISK\asmdisk2.asm 100m
C:\>asmtool -create \\.\E:\oracle\asmshaan\ASMDISK\asmdisk3.asm 100m
C:\>asmtool -create \\.\E:\oracle\asmshaan\ASMDISK\asmdisk4.asm 100m
C:\>SQLPLUS /nolog
SQL*Plus: Release 10.2.0.1.0 - Production on Tue Jul 10 13:30:14 2012
Copyright (c) 1982, 2005, Oracle. All rights reserved.

SQL> connect / as sysdba
Connected.
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 CANDIDATE NORMAL E:\ORACLE\ASMSHAAN\ASMDISK\ASMDISK1.ASM
0 3 CLOSED CANDIDATE NORMAL E:\ORACLE\ASMSHAAN\ASMDISK\ASMDISK4.ASM
0 2 CLOSED CANDIDATE NORMAL E:\ORACLE\ASMSHAAN\ASMDISK\ASMDISK3.ASM
0 1 CLOSED CANDIDATE NORMAL E:\ORACLE\ASMSHAAN\ASMDISK\ASMDISK2.ASM
Creating diskgroup
CREATE DISKGROUP disk_group_1 NORMAL REDUNDANCY
  FAILGROUP failure_group_1 DISK
    'E:\ORACLE\ASMSHAAN\ASMDISK\ASMDISK1.ASM' NAME diska1,
    'E:\ORACLE\ASMSHAAN\ASMDISK\ASMDISK1.ASM' NAME diska2
  FAILGROUP failure_group_2 DISK
    'E:\ORACLE\ASMSHAAN\ASMDISK\ASMDISK1.ASM' NAME diska3,
    'E:\ORACLE\ASMSHAAN\ASMDISK\ASMDISK1.ASM' NAME diska4;
Diskgroup created.
SQL>SELECT group_number, name, type, total_mb, free_mb from v$asm_diskgroup;
For more details about creating or adding disk group follow the link: Creating or Adding DiskGroup Description

3 comments:

  1. Hello Shahid Sir,

    While i tried to create ASM instance having some issues as follows.
    1) DBCA ddo not have option to create ASM and ASMCA is unable to launch.
    "Please provide tutorial about ASMCA"
    2)During manual configuration instance is not starting up using
    >startup pfile='G:\ASMmarfi\initasm.ora'

    having below error
    LRM-00109: could not open parameter file 'G:\ASMmarfi\initasm.ora'
    ORA-01078: failure in processing system parameters

    For LRM issue i have checked permissions and file is accessible to everyone still having issue.
    Please help.
    Thank you

    ReplyDelete
  2. One more thing i like to bring into your notice.
    command "localconfig delete/add" is also not working.Batch is showing unrecognized command.

    ReplyDelete
  3. Dear,
    It may be issue of quotation conversion due to word format file is uploaded
    as i already displaying on my web page retype the same command. Regarding tutorial i will provide you soon. I will check it after the EID holiday.

    ReplyDelete