=====================================================================================
How To Add a New Disks to An Existing Diskgroup on RAC Cluster or Standalone ASM Configuration
=====================================================================================
Steps:-
1. scandisks, listdisks, querydisks
2. Confirm the disks are visible at OS level
3. Verify that kfed can read on the candidate disks
4. Check the current disk groups,header_status of disk groups that are available from SQL prompt and Create a dummy diskgroup.
5. Mount it and if mount state is MOUNTED, then drop the created TEST_DG(test disk group)
6. If the header_status = FORMER, then alter the diskgroup to add candidate disks using rebalance. If you validate the TOTAL_GB of diskgroup, then it should increase.
1) AS ORACLE OR GRID OS USER, RUN THE NEXT COMMANDS ON EACH NODE (IF ASMLIB API IS USED):
# /etc/init.d/oracleasm scandisks #(only this command needs to be executed as root user)
$> id
$> /etc/init.d/oracleasm listdisks
$> /etc/init.d/oracleasm querydisk <each disk from previous output>
2) CONFIRM THE DISKS ARE VISIBLE (I/O) AT OS LEVEL (AS ORACLE OR GRID OS USER) FROM EACH NODE:
$> id
$> ls -l <disk name>
$> dd if=<raw/character or block partition device in question> of=/dev/null count=100 bs=8192
Example:
$> dd if=/dev/sda1 of=/dev/null count=100 bs=8192 # raw device
3) VERIFY THAT KFED CAN READ ON THE CANDIDATE DISK(S) AT OS LEVEL (AS ORACLE OR GRID OS USER) FROM EACH NODE:
kfed is an undocumented ASM utility that is used to read and modify ASM metadata blocks.
$> kfed read <raw/character or block partition device in question>
Example:
kfed read /dev/sda1 | more
Note: If the disk is not a FORMER disk, then kfed on new disks will return: kfbh.type: 0 ; 0x002: KFBTYP_INVALID and that is expected.
4. VALIDATE THE DISKS BY CREATING DUMMY DISKGROUP
Before to add any new disk into existing diskgroup or while creating a new diskgroup, we need create a dummy diskgroup with that new disks and check If we are able to mount it successfully if we don't get any issue then the is no issue with these disk and it can be added into diskgroup.
=====================================================================================
i) CHECK THE DISKGROUPS THAT ARE AVAILABLE
=====================================================================================
oracle:+ASM@nmdc01 /oracle > sqlplus / as sysasm
SQL>select name Diskgroup,round(total_mb/1024,2) "Total_TB",round(free_mb/1024,2) "Free_GB",round(((free_mb/total_mb)*100),2) "Available%" from v$asm_diskgroup;
DISKGROUP Total_GB Free_GB Available%
---------- ---------- ---------- ----------
ARCHLOG 50 49.88 99.76
LOG2 10 9.68 96.87
LOG1 10 9.68 96.87
DATAFILE 299.98 41.17 13.73
=====================================================================================
ii) CHECK THE CONSISTENCY OF THAT NEW DISK, KNOW THE HEADER_STATUS AND ITS VALUE
SQL>select path,os_mb/1024,header_Status from v$asm_Disk where header_Status!='MEMBER';
PATH OS_MB/1024 HEADER_STATU
-------------------------------------------------- ---------- ------------
/dev/rdsk/c5t600601606F402D00C01B9579B244E211d0s0 99.9941406 CANDIDATE
/dev/rdsk/c5t600601606F402D00BE1B9579B244E211d0s0 99.9941406 CANDIDATE
HEADER_STATUS
--------------
CANDIDATE - Disk is not part of a disk group and may be added to a disk group with the ALTER DISKGROUP statement.
UNKNOWN - Automatic Storage Management disk header has not been read.
INCOMPATIBLE - Version number in the disk header is not compatible with the Automatic Storage Management software version.
PROVISIONED - Disk is not part of a disk group and may be added to a disk group with the ALTER DISKGROUP statement. The PROVISIONED header status is different from the CANDIDATE header status in that PROVISIONED implies that an additional platform-specific action has been taken by an administrator to make the disk available for Automatic Storage Management.
MEMBER - Disk is a member of an existing disk group. No attempt should be made to add the disk to a different disk group. The ALTER DISKGROUP statement will reject such an addition unless overridden with the FORCE option.
FORMER - Disk was once part of a disk group but has been dropped cleanly from the group. It may be added to a new disk group with the ALTER DISKGROUP statement.
CONFLICT - Automatic Storage Management disk was not mounted due to a conflict.
FOREIGN - Disk contains data created by an Oracle product other than ASM. This includes datafiles, logfiles, and OCR disks.
=====================================================================================
c) CREATE A DUMMY DISKGROUP WITH THAT NEW DISKS
=====================================================================================
SQL> CREATE DISKGROUP TEST_DG EXTERNAL REDUNDANCY DISK '<YOUR CANDIDATE DISK>';
Example:-
SQL> create diskgroup TEST_DG external redundancy disk '/dev/rdsk/c5t600601606F402D00C01B9579B244E211d0s0','/dev/rdsk/c5t600601606F402D00BE1B9579B244E211d0s0';
Diskgroup created.
5) Now, manually mount it on the other ASM Diskgroup(s):
SQL> ALTER DISKGROUP TEST_DG MOUNT;
SQL> select name,state from v$asm_Diskgroup;
NAME STATE
------------- --------
ARCHLOG MOUNTED
LOG2 MOUNTED
LOG1 MOUNTED
DATAFILE MOUNTED
TEST_DG MOUNTED
SQL> drop diskgroup TEST_DG;
Diskgroup dropped.
SQL> select path,os_mb/1024,header_Status from v$asm_Disk where header_Status!='MEMBER';
PATH OS_MB/1024 HEADER_STATU
-------------------------------------------------- ---------- ------------
/dev/rdsk/c5t600601606F402D00C01B9579B244E211d0s0 99.9941406 FORMER
/dev/rdsk/c5t600601606F402D00BE1B9579B244E211d0s0 99.9941406 FORMER
FORMER -> indicates that those disk were already part of the diskgroup and now it can be added into existing diskgroup or New diskgroup.
=====================================================================================
6) ADD THAT NEW DISK INTO EXISTING DISKGROUP WITH APPROPRIATE REBALANCE POWER LIMIT
=====================================================================================
REBALANCE - should be given based on number of CPU available on the host
SQL> alter diskgroup DATAFILE add disk '/dev/rdsk/c5t600601606F402D00C01B9579B244E211d0s0' rebalance power 6;
Diskgroup altered.
After we issued above command we can monitor the rebalance operation by queriyng v$asm_operation view.
SQL> Select operation, state, power, est_rate, est_minutes, round((sofar/EST_WORK)*100,2) pct_comp From v$asm_operation;
OPERA STAT POWER EST_RATE EST_MINUTES PCT_COMP
----- ---- ---------- ---------- ----------- ----------
REBAL RUN 6 4912 2 16.72
When it returns "no rows selected" re-balance activity currently in completed.
SQL>select name Diskgroup,round(total_mb/1024,2) "Total_TB",round(free_mb/1024,2) "Free_GB",round(((free_mb/total_mb)*100),2) "Available%" from v$asm_diskgroup;
DISKGROUP Total_GB Free_GB Available%
---------- ---------- ---------- ----------
ARCHLOG 50 49.88 99.76
LOG2 10 9.68 96.87
LOG1 10 9.68 96.87
DATAFILE 399.97 141.16 35.29
After we add the new disk DATAFILE diskgroup capacity got increased and header_status of that new disk also got changed to MEMBER.
References:-
(Doc ID 557348.1)
No comments:
Post a Comment