Add new ASM disk on RAC




ASM detect all disk added to the machine on

asm_diskstring path (+ASM database):

SQL>; show parameter asm_diskstring

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------

asm_diskstring                       string      /dev/oraasm/*


But before add any disk to ASM it is highly recommended you validate those disks:

query on ASM cadidate and former disks:

select  INST_ID, NAME, HEADER_STATUS, path , TOTAL_MB, mount_status, OS_MB , GROUP_NUMBER from gV$ASM_DISK where HEADER_STATUS in ('CANDIDATE', 'FORMER');SQL> SQL> SQL>

   INST_ID NAME  HEADER_STATU PATH                                                 TOTAL_MB MOUNT_S      OS_MB GROUP_NUMBER
---------- ----- ------------ ----------------------------------- ---------- ------- ---------- ------------
         1       CANDIDATE    /dev/oraasm/LUN_66E_DG_BBDD       0 CLOSED        1017            0
         1       CANDIDATE    /dev/oraasm/LUN_66F_DG_BBDD       0 CLOSED        1017            0
         1       CANDIDATE    /dev/oraasm/LUN_670_DG_BBDD       0 CLOSED        1017            0
         1       CANDIDATE    /dev/oraasm/LUN_671_DG_BBDD       0 CLOSED        1017            0
         1       CANDIDATE    /dev/oraasm/LUN_672_DG_BBDD       0 CLOSED        1017            0
         2       CANDIDATE    /dev/oraasm/LUN_66E_DG_BBDD       0 CLOSED        1017            0
         2       CANDIDATE    /dev/oraasm/LUN_66F_DG_BBDD       0 CLOSED        1017            0
         2       CANDIDATE    /dev/oraasm/LUN_670_DG_BBDD       0 CLOSED        1017            0
         2       CANDIDATE    /dev/oraasm/LUN_672_DG_BBDD       0 CLOSED        1017            0


Verify on each RAC node that disk can be read en write, so execute in each RAC node for every disk you want to add:

 kfed read /dev/oraasm/LUN_66E_DG_BBDD 
 dd if=/dev/oraasm/LUN_66E_DG_BBDD of=/dev/null count=100 bs=8192   
 dd if=/dev/zero of=/dev/oraasm/LUN_66E_DG_BBDD bs=8192 count=100 
*Last operation will write to disk header, so make sure this disk is CANDIDATE or FORMER, otherwise you will drop disk from ASM diskgroup and left it as CANDIDATE.

Another test you can do to make sure disks are OK is to create a new test diskgroup and mount it. If this is ok, then you can delete it, and add this disk to an existing diskgroup:
CREATE DISKGROUP TEST_DG EXTERNAL REDUNDANCY DISK '/dev/oraasm/LUN_66E_DG_BBDD';
Verify if TEST_DG is mounted on all RAC instances:

SQL> select INST_ID, STATE, NAME from  gv$asm_diskgroup where NAME like 'TEST_DG';

   INST_ID STATE       NAME
---------- ----------- -------------------------------
         2 MOUNTED     TEST_DG
         1 MOUNTED     TEST_DG
If not, try to mount it launching this command in instances that it is in UMOUNT status:

ALTER DISKGROUP TEST_DG MOUNT;

If TEST_DG is successfully mounted, you can drop it and proceed adding this disk to the final diskgroup:

alter diskgroup TEST_DG dismount;

drop diskgroup TEST_DG;

ALTER DISKGROUP ORA_RECO1 ADD DISK '/dev/oraasm/LUN_66E_DG_BBDD';

After this command is executed, you can monitor rebalance operation querying v$asm_operation view:

SQL> select * from v$asm_operation 

GROUP_NUMBER OPERA STAT POWER ACTUAL   SOFAR   EST_WORK   EST_RATE EST_MINUTES ERROR_CODE
------------ ----- ---- ----- ------ ------- ---------- ---------- ----------- ----------
           5 REBAL RUN      9      9 1050869    1050869       8717           0 

-------Extra information:

At storage level disk need to have

reserve_policy=no_reserve o bien reserver_lock=no

Before adding a disk, please

If you work with failure groups, you need to add disk by 2 or by 3 depending if you are using a 2-way mirroring or 3-way mirroring. For example:

ALTER DISKGROUP ORA_RECO1 ADD FAILGROUP USPVM disk
'/dev/USPVM_L01A7_BBDD11',
'/dev/USPVM_L01EE_BBDD11',
'/dev/USPVM_L022A_BBDD11',
'/dev/USPVM_L022B_BBDD11'
FAILGROUP USPVML DISK
'/dev/USPVL_L01A3_BBDD12',
'/dev/USPVL_L01A6_BBDD12',
'/dev/USPVL_L022A_BBDD12',
'/dev/USPVL_L022B_BBDD12'
rebalance power 11
This config is used to write redundant information in separated disk racks, also is good practice to add all disk at once, this way there will be just one rebalance operation.


----Common errors:

In my experience most common error on that operations are not to assign correct rights to disks at operating system level, so make sure correct ownership & permissions are set in all RAC SERVERS.

Comments

Popular posts from this blog

Oracle Historical Session Information with ASH >10g

Purging and archiving Oracle alert.log and listener.log

Check sessions and processes limits in Oracle