ASM Healthchecks :

ASM Healthchecks and Scripts:
===================================

To find the free space in an ASM disk : 
select group_number, disk_number, name, failgroup, create_date, path, total_mb,free_mb from v$asm_disk; 

To find the free space in an ASM diskgroup : 
select name, group_number, name, type, state, total_mb, free_mb from v$asm_diskgroup; 

To see the current ASM operations in Progress :
select group_number, operation, state, power, actual, sofar, est_work, est_rate, est_minutes from v$asm_operation;



ASM Healthchecks : 
=================
[oracle@madhu21 ~]$ ps -ef | grep css
root     18864     1  0 Dec09 ?        00:02:25 /app/base/GRID/11.2.0/bin/cssdmonitor
root     18881     1  0 Dec09 ?        00:02:50 /app/base/GRID/11.2.0/bin/cssdagent
oracle   18895     1  1 Dec09 ?        06:27:07 /app/base/GRID/11.2.0/bin/ocssd.bin
oracle   23285 14709  0 23:28 pts/4    00:00:00 grep css
[oracle@madhu21 ~]$

[oracle@madhu21 ~]$ crsctl check crs
CRS-4638: Oracle High Availability Services is online
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online



[oracle@bgadbs21 ~]$ ps -ef | grep asm

ASM_Disk groups
---------------------
SQL> SELECT
  2      name                                     group_name
  , sector_size                              sector_size
  3    4    , block_size                               block_size
  5    , allocation_unit_size                     allocation_unit_size
  6    , state                                    state
  7    , type                                     type
  8    , total_mb                                 total_mb
  9    , (total_mb - free_mb)                     used_mb
 10    , ROUND((1- (free_mb / total_mb))*100, 2)  pct_used
FROM
 11   12      v$asm_diskgroup
 13  WHERE
 14      total_mb != 0
 15  ORDER BY
    name
 16   17  /

Find diskgroup sizes:
======================
SET LINESIZE  145
SET PAGESIZE  9999
SET VERIFY    off

COLUMN group_name             FORMAT a20           HEAD 'Disk Group|Name'
COLUMN sector_size            FORMAT 99,999        HEAD 'Sector|Size'
COLUMN block_size             FORMAT 99,999        HEAD 'Block|Size'
COLUMN allocation_unit_size   FORMAT 999,999,999   HEAD 'Allocation|Unit Size'
COLUMN state                  FORMAT a11           HEAD 'State'
COLUMN type                   FORMAT a6            HEAD 'Type'
COLUMN total_mb               FORMAT 999,999,999   HEAD 'Total Size (MB)'
COLUMN used_mb                FORMAT 999,999,999   HEAD 'Used Size (MB)'
COLUMN pct_used               FORMAT 999.99        HEAD 'Pct. Used'

break on report on disk_group_name skip 1

compute sum label "Grand Total: " of total_mb used_mb on report

SELECT
    name                                     group_name
  , sector_size                              sector_size
  , block_size                               block_size
  , allocation_unit_size                     allocation_unit_size
  , state                                    state
  , type                                     type
  , total_mb                                 total_mb
  , (total_mb - free_mb)                     used_mb
  , ROUND((1- (free_mb / total_mb))*100, 2)  pct_used
FROM
    v$asm_diskgroup
WHERE
    state = 'MOUNTED'
ORDER BY name;

Find ASM-components sizes:
=============================
SET ECHO        OFF
SET FEEDBACK    6
SET HEADING     ON
SET LINESIZE    180
SET PAGESIZE    50000
SET TERMOUT     ON
SET TIMING      OFF
SET TRIMOUT     ON
SET TRIMSPOOL   ON
SET VERIFY      OFF

CLEAR COLUMNS
CLEAR BREAKS
CLEAR COMPUTES

COLUMN component             FORMAT a25              HEAD 'Component Name'
COLUMN current_size          FORMAT 9,999,999,999    HEAD 'Current Size'
COLUMN min_size              FORMAT 9,999,999,999    HEAD 'Min Size'
COLUMN max_size              FORMAT 9,999,999,999    HEAD 'Max Size'
COLUMN user_specified_size   FORMAT 9,999,999,999    HEAD 'User Specified|Size'
COLUMN oper_count            FORMAT 9,999            HEAD 'Oper.|Count'
COLUMN last_oper_type        FORMAT a10              HEAD 'Last Oper.|Type'
COLUMN last_oper_mode        FORMAT a10              HEAD 'Last Oper.|Mode'
COLUMN last_oper_time        FORMAT a20              HEAD 'Last Oper.|Time'
COLUMN granule_size          FORMAT 999,999,999      HEAD 'Granule Size'

SELECT
    component
  , current_size
  , min_size
  , max_size
  , user_specified_size
  , oper_count
  , last_oper_type
  , last_oper_mode
  , TO_CHAR(last_oper_time, 'DD-MON-YYYY HH24:MI:SS') last_oper_time
  , granule_size
FROM
    v$sga_dynamic_components
ORDER BY
    component DESC

No comments: