Adding and removing disks in ASM

A first for me. I had seen asm in the past but never had hands on experience with it. A client needed some disks moved from 1 diskgroup to the other and so started my journey into ASM. :)

The client was using grid control for management of the RAC an ASM instances, the point and click interface is really intuitif and makes these actions childplay. HOWEVER, not all clients have grid control and in my case I didn’t have the sys password to connect with the asm instance. A local connection was the only possible solution and that meant… fun :)

I was glad Grid control didn’t work so I could get to know the command line interface. The folowing is my procedure.

1. detect the group number from the source and Dest group :

SQL> select group_number,name from v$asm_diskgroup;

GROUP_NUMBER NAME
———— ——————————
3 DG_SRC_DF
5 DG_DEST_DF

2. Get an overview of the disks from that diskgroup :

SQL> select DISK_NUMBER, name, failgroup, group_number from v$asm_disk where group_number=3 order by name;

0 asmdiskA17                    FailgroupA                                  3
1 asmdiskA18                    FailgroupA                                  3
2 asmdiskA19                    FailgroupA                                  3
3 asmdiskA22                    FailgroupA                                  3
4 asmdiskA23                    FailgroupA                                  3
5 asmdiskA24                    FailgroupA                                  3
6 asmdiskA25                    FailgroupA                                  3
7 asmdiskA26                    FailgroupA                                  3
8 asmdiskA27                    FailgroupA                                  3
9 asmdiskA28                    FailgroupA                                  3
10 asmdiskB39                    FailgroupB                                  3
11 asmdiskB40                    FailgroupB                                  3
12 asmdiskB41                    FailgroupB                                  3
13 asmdiskB42                    FailgroupB                                  3
14 asmdiskB43                    FailgroupB                                  3
15 asmdiskB44                    FailgroupB                                  3
16 asmdiskB45                    FailgroupB                                  3
17 asmdiskB48                    FailgroupB                                  3
18 asmdiskB49                    FailgroupB                                  3
19 asmdiskB50                    FailgroupB                                  3

3. Remove 7 disks of each failgroup = 14 :

alter diskgroup DG_SRC_DF drop disk asmdiskA28;
alter diskgroup DG_SRC_DF drop disk asmdiskA27;
alter diskgroup DG_SRC_DF drop disk asmdiskA26;
alter diskgroup DG_SRC_DF drop disk asmdiskA25;
alter diskgroup DG_SRC_DF drop disk asmdiskA24;
alter diskgroup DG_SRC_DF drop disk asmdiskA23;
alter diskgroup DG_SRC_DF drop disk asmdiskA22;
alter diskgroup DG_SRC_DF drop disk asmdiskB50;
alter diskgroup DG_SRC_DF drop disk asmdiskB49;
alter diskgroup DG_SRC_DF drop disk asmdiskB48;
alter diskgroup DG_SRC_DF drop disk asmdiskB45;
alter diskgroup DG_SRC_DF drop disk asmdiskB44;
alter diskgroup DG_SRC_DF drop disk asmdiskB43;
alter diskgroup DG_SRC_DF drop disk asmdiskB42;

4. check if the rebalancing is done :

SQL> select * from v$asm_operation;

GROUP_NUMBER OPERA STAT      POWER     ACTUAL      SOFAR   EST_WORK   EST_RATE EST_MINUTES
———— —– —- ———- ———- ———- ———- ———- ———–
3 REBAL RUN           1          1      18652      69864        722          70

5. when done , check if the disks are gone with query from point 2.
6. add the disks to the new diskgroup

alter diskgroup DG_DEST_DF add FAILGROUP FailgroupA disk ‘/asmdisks/asmdiskA28′;
alter diskgroup DG_DEST_DF add FAILGROUP FailgroupA disk ‘/asmdisks/asmdiskA27′;
alter diskgroup DG_DEST_DF add FAILGROUP FailgroupA disk ‘/asmdisks/asmdiskA26′;
alter diskgroup DG_DEST_DF add FAILGROUP FailgroupA disk ‘/asmdisks/asmdiskA25′;
alter diskgroup DG_DEST_DF add FAILGROUP FailgroupA disk ‘/asmdisks/asmdiskA24′;
alter diskgroup DG_DEST_DF add FAILGROUP FailgroupA disk ‘/asmdisks/asmdiskA23′;
alter diskgroup DG_DEST_DF add FAILGROUP FailgroupA disk ‘/asmdisks/asmdiskA22′;
alter diskgroup DG_DEST_DF add FAILGROUP FailgroupB disk ‘/asmdisks/asmdiskB50′;
alter diskgroup DG_DEST_DF add FAILGROUP FailgroupB disk ‘/asmdisks/asmdiskB49′;
alter diskgroup DG_DEST_DF add FAILGROUP FailgroupB disk ‘/asmdisks/asmdiskB48′;
alter diskgroup DG_DEST_DF add FAILGROUP FailgroupB disk ‘/asmdisks/asmdiskB45′;
alter diskgroup DG_DEST_DF add FAILGROUP FailgroupB disk ‘/asmdisks/asmdiskB44′;
alter diskgroup DG_DEST_DF add FAILGROUP FailgroupB disk ‘/asmdisks/asmdiskB43′;
alter diskgroup DG_DEST_DF add FAILGROUP FailgroupB disk ‘/asmdisks/asmdiskB42′;

7. Disks are added and ASM will rebalance the load over al the disks in background  :

SQL> select * from v$asm_operation;

GROUP_NUMBER OPERA STAT      POWER     ACTUAL      SOFAR   EST_WORK   EST_RATE EST_MINUTES
———— —– —- ———- ———- ———- ———- ———- ———–
5 REBAL RUN           1          1      18652      69864        722          70

After  searching and trying  it was really quite a good learning case to get to know ASM a bit better.  And know i can add ASM knowledge to my resumé ;)

About these ads

4 responses to “Adding and removing disks in ASM

  1. Hi, Your notes are very useful and looks easy enough, but when I run the drop, I got the following error message:

    ERROR at line 1:
    ORA-15000: command disallowed by current instance type

    What could be the problem?

    Thanks.

    James

  2. Hi,

    It looks to me that either

    a. you are not connected with the +ASM instance when you try to execute the command

    or

    b. you are placing + signs in front of your diskgroups.

    for a : check if you can access the filesystem with asmcmd and see the diskgroups with a ls.

    for b : don’t use + inside sql statements in ASM.

    These are the only 2 options I know that cause the ora-15000

    Keep me informaed what the problem was :)

  3. hi,

    disks should be added by connecting to ASM instance

    export OARCLE_SID=+ASM1;
    sqlpls ‘/as sysbda’
    and then perform your operations

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s