ASM Basic

Posted on Posted in Uncategorized

ASM Login and Check Space:

set the environment
. oraenv +ASM1

shadb@sha01:~$ asmcmd -p 
ASMCMD [+] > ls
SHAPROD_DATA01/
SHAPROD_RECO/

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 4194304 29491200 13181264 614400 6283432 0 Y SHAPROD_DATA01/
MOUNTED NORMAL N 512 4096 4194304 32356352 24457704 874496 11791604 0 N SHAPROD_RECO/

SQL(+ASM1)>select name,total_mb,free_mb, (free_mb/total_mb)*100 "%Free" from v$asm_diskgroup;

NAME TOTAL_MB FREE_MB %Free
------------------------------ ------------ ------------ ----------
SHASQL(+ASM1)>select name,total_mb,free_mb, (free_mb/total_mb)*100 "%Free" from v$asm_diskgroup;

NAME TOTAL_MB FREE_MB %Free
------------------------------ ------------ ------------ ----------
SHAPROD_DATA01 29,491,200 13,181,264 44.6955838
SHAPROD_RECO 32,356,352 24,474,116 75.6392933

SQL(+ASM1)>
select
name,decode(type,'NORMAL',2,'HIGH',3,'EXTERN',1) Redundancy,
(total_mb/decode(type,'NORMAL',2,'HIGH',3,'EXTERN',1)) Total_MB,
(free_mb/decode(type,'NORMAL',2,'HIGH',3,'EXTERN',1)) Free_MB,
((free_mb/decode(type,'NORMAL',2,'HIGH',3,'EXTERN',1))/(total_mb/decode(type,'NORMAL',2,'HIGH',3,'EXTERN',1)))*100 "%Free"
from v$asm_diskgroup;

NAME           REDUNDANCY      TOTAL_MB      FREE_MB     %Free
-------------- -----------   -------------  ---------- ------------ 
SHAPROD_DATA01   2             14,745,600   6,590,632   44.6955838
SHAPROD_RECO     2             16,178,176   12,237,058  75.6392933

 

Creating and Adding Disk in Diskgroup : (Making redundancy as External, because ASM will depend on OS redundancy like RAID, otherwise in case of Normal redundancy we must have two Disk available to make Failover Disk)

CREATE DISKGROUP TESTDATA EXTERNAL REDUNDANCY DISK '/dev/mapper/disk1';
SELECT MOUNT_STATUS,HEADER_STATUS,MODE_STATUS,STATE,TOTAL_MB,FREE_MB,NAME,PATH,LABEL FROM V$ASM_DISK;

Adding multiple Disk to existing Diskgroup :

alter DISKGROUP TESTDATA add disk '/dev/mapper/disk2','/dev/mapper/OneTM_ODS_disk3','/dev/mapper/disk4';

 

Leave a Reply

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

× 1 = 5