You are on page 1of 13

ASM documentation:

http://download.oracle.com/docs/cd/B28359_01/server.111/b31107/asminst.htm

IN CASE CREATING ASM INSTANCE MANNUALLY, THESE ARE THE CONTENTS OF THE init+ASM.ora

######################## BEGIN #######################

###########################################

# Automatic Storage Management

###########################################

# _asm_allow_only_raw_disks=false

INSTANCE_TYPE=ASM

DB_UNIQUE_NAME=+ASM1

ASM_POWER_LIMIT=1

ASM_DISKGROUPS='dgroupA','dgroupB'

LARGE_POOL_SIZE=12M

ASM_DISKSTRING='\\.\ORCLDISK*'

###########################################

# Miscellaneous

###########################################

instance_type=asm

compatible=11.1.0.7.0

###########################################

# Pools

###########################################

large_pool_size=12M

###########################################

# Security and Auditing


###########################################

remote_login_passwordfile=exclusive

##########################END #######################

1. At DOS prompt, issue command:

C:\>diskpart

2. Navigate to:

Control Pannel => Computer Management => Storage => Disk Management

[Control Panel => All Control Panel Items => Administrative Tools] => Storage => Disk Management

If the Disk is not initialized, right click on the disk an initialize it.

3. Identity the Disk Number for the raw/Unformatted Hard Disk Drive(s) – (currently unallocated) to
allocate to ASM.

Example: If you have only one Hard Disk Drive assigned Disk Number 1, Issue the following
Diskpart command:

DISKPART> select disk 1

RESPONSE:

Disk 1 is now the selected disk.

4. Create some Primary Partitions, each 2 GB in size. In this example, we shall create FOUR partitions:

DISKPART> select disk 1

Disk 1 is now the selected disk.

DISKPART> create partition primary size=2000

DiskPart succeeded in creating the specified partition.

DISKPART> select disk 2

Disk 2 is now the selected disk.

DISKPART> create partition primary size=2000

DiskPart succeeded in creating the specified partition.

DISKPART> select disk 4


Disk 4 is now the selected disk.

DISKPART> create partition primary size=2000

DiskPart succeeded in creating the specified partition.

DISKPART> select disk 5

Disk 5 is now the selected disk.

DISKPART> create partition primary size=2000

DiskPart succeeded in creating the specified partition.

DISKPART> exit

Leaving DiskPart...

The Computer Management … Disk Management console now looks like below:
In this case, Disk3 was taken up by the USB Port splitter device as the HDD drives were attached via USB
ports.

6. Invoke asmtoolg (asmtoolg (ENSURE YOU INVOKED CMD AS ADMINISTRATOR TO AVOID “AN ACCESS
DENIED” ERROR ASSOCIATED WITH OS PERMISSIONS ) is the GUI version. The CLI version is asmtool):

C:\>asmtoolg

7. Select the first option,

‘Add or change label’

8. Click Next and the screen below will appear, showing the partitions created in step 4 above as
‘Candidate devices’ which are available for allocation to ASM.
9. Stamp the four partitions:

\Device\Harddisk1\Partition1

\Device\Harddisk1\Partition2

With the ‘DISKGROUPA’ AND ‘DISKGROUPB’ ASM stamp. This stamping of partitions by the asmtoolg
initializes the drive headers and marks those drives for use by ASM. This assists in reducing the risk of
overwriting a usable drive that is being used for normal operating system files.

10. Click Next and the following Window will pop up:
Rename as appropriate.

11. Click Next and the following Window will appear:


12. Click Finish

13. Create pfile and use oradim to create +ASM service

14. C:\Documents and Settings\lmwangi>localconfig add

Step 1: creating new OCR repository

Successfully accumulated necessary OCR keys.

Creating OCR keys for user 'lmwangi', privgrp ''..

Operation successful.

Step 2: creating new CSS service

Failed to create the new CSS service, err(1073)

failed to create CSS services

ABOVE ERROR RESOLVED BY RUNNING localconfig delete AND RERUNNING localconfig add AS BELOW:
C:\Documents and Settings\lmwangi>localconfig delete

Step 1: stopping local CSS stack

Step 2: deleting OCR repository

successfully deleted local CSS setup

C:\Documents and Settings\lmwangi>localconfig add

Step 1: creating new OCR repository

Successfully accumulated necessary OCR keys.

Creating OCR keys for user 'lmwangi', privgrp ''..

Operation successful.

Step 2: creating new CSS service

successfully created local CSS service

successfully added CSS to home

TO START CSS, USE ISSUE THE COMMAND:

C:\Documents and Settings\lmwangi>localconfig reset

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 'lmwangi', privgrp ''..

Operation successful.

Step 4: creating new CSS service

successfully created local CSS service

successfully reset location of CSS setup


___________________________________________________________________________________

To stop the Oracle Cluster Services Synchronization (CSS) daemon, run the following
command:

On AIX:

/etc/init.cssd stop
On other platforms:

/etc/init.d/init.cssd stop
To start the CSS daemon, run the following command:

$ORACLE_HOME/bin/localconfig reset
This command stops the Oracle CSS daemon and then restarts it.

_____________________________________________________________________________________

ERROR ENCOUNTERED:

SQL> startup pfile=C:\Oracle\11gR1\db_1\database\init+ASM.ora

ASM instance started

Total System Global Area 535662592 bytes

Fixed Size 1348508 bytes

Variable Size 509148260 bytes

ASM Cache 25165824 bytes

ORA-15032: not all alterations performed

ORA-15063: ASM discovered an insufficient number of disks for diskgroup "DGROUPB"

ORA-15063: ASM discovered an insufficient number of disks for diskgroup "DGROUPA"

SELECT GROUP_NUMBER,DISK_NUMBER,MOUNT_STATUS,HEADER_STATUS,STATE,NAME,PATH FROM


V$ASM_DISK;
-----------------------------------------

SQL> startup pfile=C:\Oracle\11gR1\db_1\database\init+ASM.ora

ORA-29701: unable to connect to Cluster Manager

ACTION: START CSS

NOTE:

ASM can discover up to 10,000 disks. That is, if more than 10,000 disks match
the ASM_DISKSTRING initialization parameter, then ASM discovers only the first 10,000.

ASM only discovers disks that contain a partition table.

Note: ASM does not discover a disk that contains an operating system partition table, even if the disk
is in an ASM disk string search path and ASM has read and write permission for the disk.

DROPPING A DISK GROUP

SQL> select group_number,name from v$asm_diskgroup;

GROUP_NUMBER NAME

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

1 DGROUPB

SQL> select path,name from v$asm_disk where group_number=1;

PATH NAME

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

\\.\ORCLDISKDGROUPB2 DGROUPB_0002

\\.\ORCLDISKDGROUPB3 DGROUPB_0003
\\.\ORCLDISKDGROUPA2 DGROUPB_0000

\\.\ORCLDISKDGROUPA3 DGROUPB_0001

SQL> alter diskgroup DGROUPB drop disk DGROUPB_0002;

Diskgroup altered.

AFTER CREATING DISK GROUPS USING DBCA AND ASSIGNING DISKS TO THE DISK GROUP DGROUPA:

SQL> select path,name from v$asm_disk where group_number=1;

PATH NAME

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

\\.\ORCLDISKDGROUPA0 DGROUPA_0000

\\.\ORCLDISKDGROUPA1 DGROUPA_0001

QUERY TO VIEW THE CREATED DISKGROUPS

SELECT name, type, total_mb, free_mb, required_mirror_free_mb, usable_file_mb FROM


V$ASM_DISKGROUP;

TO MOUNT A DISK GROUP;

ALTER DISKGROUP DGROUPB MOUNT;

Or use DBCA to mount on the GUI

MOUNT/DISMOUNT COMMANDS:
Disk groups are mounted at ASM instance startup and unmounted at ASM instance shutdown. Manual
mounting and dismounting can be accomplished using the ALTER DISKGROUP statement as seen below.

ALTER DISKGROUP ALL DISMOUNT;


ALTER DISKGROUP ALL MOUNT;
ALTER DISKGROUP DGROUPA DISMOUNT;
ALTER DISKGROUP DGROUPA MOUNT;

TO DROP A DISKGROUP

SQL> DROP DISKGROUP DGROUPB FORCE INCLUDING CONTENTS;

Diskgroup dropped.

Recreate the disk group using DBCA and add disks (re-stamp them using asmtoolg). Then confirm the
new disk group (DGROUPB) has been created successfully as follows:

SELECT name, type, total_mb, free_mb, required_mirror_free_mb,usable_file_mb

from v$ASM_DISKGROUP;

UTILISING THE ASM VOLUME MANAGER FROM A DATABASE

SQL> CREATE TABLESPACE USER_DATA DATAFILE '+DGROUPA' SIZE 100M AUTOEXTEND ON;

Tablespace created.

SQL> CREATE TEMPORARY TABLESPACE TEMP_DATA TEMPFILE '+DGROUPA' SIZE 200M;

Tablespace created.
1 CREATE USER lenny identified by lenny default tablespace user_data temporary tablespace
temp_data

2* quota unlimited on user_data

SQL> /

User created.

TO CREATE A DIRCTORY UTILISING ASM, ISSUE THE FOLLOWING SYNTAX FROM THE ASM INSTANCE:

SQL> ALTER DISKGROUP DGROUPA ADD DIRECTORY '+dgroupa/data1';

Diskgroup altered.

You might also like