Drop/Add ASM disk ( RAC 12.1 )

Check ASM disk group layout
ASMCMD> lsdg
State    Type    Rebal  Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB  Offline_disks  Voting_files  Name
MOUNTED  NORMAL  N         512   4096  1048576     20456    12878             5114            3882              0             Y  DATA/

Check space for a certain directory 
ASMCMD>  du _MGMTDB/
Used_MB      Mirror_used_MB
   3407                6838

Check ASM disk usage:
ASMCMD> lsdsk -k
Total_MB  Free_MB  OS_MB  Name       Failgroup  Failgroup_Type  Library  Label  UDID  Product  Redund   Path
    5114     3212   5114  DATA_0000  DATA_0000  REGULAR         System                         UNKNOWN  /dev/oracleasm/disks/DATA1
    5114     3207   5114  DATA_0001  DATA_0001  REGULAR         System                         UNKNOWN  /dev/oracleasm/disks/DATA2
    5114     3216   5114  DATA_0002  DATA_0002  REGULAR         System                         UNKNOWN  /dev/oracleasm/disks/DATA3
    5114     3243   5114  DATA_0003  DATA_0003  REGULAR         System                         UNKNOWN  /dev/oracleasm/disks/DATA4

Drop disk 5 GByte  DATA_0003 and create 2 new disks DATA_0003 and DATA_0004 with 10GByte each
Drop disk delete ASMlib entry
SQL> alter diskgroup data drop disk DATA_0003;
Diskgroup altered.
Now run on grac121 and grac122
# /etc/init.d/oracleasm deletedisk  DATA4
Removing ASM disk "DATA4":                                 [  OK  ]
# /etc/init.d/oracleasm listdisks
DATA1
DATA2
DATA3

Create ASM disks format and add them to our DATA diskgroup
$ /etc/init.d/oracleasm createdisk data1 /dev/sde1
Marking disk "data1" as an ASM disk:                       [  OK  ]
$ /etc/init.d/oracleasm createdisk data1 /dev/sdf1
Marking disk "data1" as an ASM disk:                       [  OK  ]

Use asmca and add the disk to our disk DATA disk group .
Verify the  new disk group layout
$ asmcmd lsdsk -k
Total_MB  Free_MB  OS_MB  Name       Failgroup  Failgroup_Type  Library  Label  UDID  Product  Redund   Path
    5114     2112   5114  DATA_0000  DATA_0000  REGULAR         System                         UNKNOWN  /dev/oracleasm/disks/DATA1
   10236     9444  10236  DATA_0003  DATA_0003  REGULAR         System                         UNKNOWN  /dev/oracleasm/disks/DATA10G_1
   10236     9475  10236  DATA_0004  DATA_0004  REGULAR         System                         UNKNOWN  /dev/oracleasm/disks/DATA10G_2
    5114     2113   5114  DATA_0001  DATA_0001  REGULAR         System                         UNKNOWN  /dev/oracleasm/disks/DATA2
    5114     5111   5114  DATA_0002  DATA_0002  REGULAR         System                         UNKNOWN  /dev/oracleasm/disks/DATA3

$ asmcmd lsdg
State    Type    Rebal  Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB  Offline_disks  Voting_files  Name
MOUNTED  NORMAL  Y         512   4096  1048576     30700    23140            10236            6452              0             Y  DATA/

$ /etc/init.d/oracleasm listdisks
DATA1
DATA10G_1
DATA10G_2
DATA2
DATA3

 

Leave a Reply

Your email address will not be published. Required fields are marked *