Sunday, November 17, 2013

ASM 11gr2 Command

Check for free space in ASM disks

---------------------------

set lines 255
col path for a35
col Diskgroup for a15
col DiskName for a20
col disk# for 999
col total_mb for 999,999,999
col free_mb for 999,999,999
compute sum of total_mb on DiskGroup
compute sum of free_mb on DiskGroup
break on DiskGroup skip 1 on report -

set pages 255

select a.name DiskGroup, b.disk_number Disk#, b.name DiskName, b.total_mb, b.free_mb, b.path, b.header_status
from v$asm_disk b, v$asm_diskgroup a
where a.group_number (+) =b.group_number
order by b.group_number, b.disk_number, b.name
/
---------------------------------------

ASM Parameters

*.db_cache_size=64m
*.large_pool_size=12M
*.shared_pool_size=128M
*.processes=300
The equation for the process parameters is:
Processes   =25 +                          (10 + max number of concurrent database file creations, ,                                                                  file extend operations possible) * n.

Where n is the number of databases connecting to ASM.

Check for space on your ASM instance

 

 

Here’s a simple script to see how much space that you have at the disk and disk group level. 

This script should work on all the operating systems but only tested on Linux.

 The only portion that you will have to change is the ‘ps -ef’ line

 -----------------------
export DB=$(ps -ef |grep +ASM |grep -i pmon |awk {'print $8'} |sed -e 's/asm_pmon_//g')
export ORACLE_SID=${DB}
export ORAENV_ASK=NO
. oraenv
sqlplus -s / as sysasm <<!!
col name for a15
col path for a20
set lines 122 pages 66
col AU for 9 hea 'AU|MB'
col state for a12
col compatibility for a10 hea 'ASM|Compat'
col database_compatibility for a10 hea 'Database|Compat'
col pct_Free for 99.99 head 'Pct|Free'
col block_size for 99,999 head 'Block|Size'
col Total_GB for 999,999.99 head 'Total|GB'
col Free_GB for 999,999.99 head 'Free|GB'
col pct_free for 999 hea 'Pct|Free'
select name, path, total_mb, free_mb,
       round(free_mb/total_mb*100,2) pct_Free
from v\$asm_disk
where total_mb >1
order by name;
select name, state, round(total_mb/1024,2) Total_GB, round(free_mb/1024,2) Free_GB,
       round(free_mb/total_mb*100,2) pct_Free,
       allocation_unit_size/1024/1024 AU, compatibility, database_compatibility
from v\$asm_diskgroup
where total_mb > 1;
!!
----------------------

 Following script to check the balance of the data across the disks:
set pages 9999 lines 200
column name format a40
select a.name, b.disk_kffxp disk, count(disk_kffxp) blocks
from
v$asm_alias a
, x$kffxp b
, v$asm_file c
where
a.group_number=b.group_kffxp
and a.group_number=c.group_number
and a.file_number=c.file_number
and a.file_number=b.number_kffxp
and c.type in ('DATAFILE','TEMPFILE','ONLINELOG')
group by a.name, b.disk_kffxp
order by a.name, count(disk_kffxp) desc;

No comments:

Post a Comment