ASM diskgroups
Aller à la navigation
Aller à la recherche
| Fiche express | |
|---|---|
| Type | Script SQL*Plus de diagnostic |
| Domaine | ASM – diskgroups |
| Voir aussi | ASM disks · ASM disks perfs · ASM clients |
ASM diskgroups fournit une synthèse de tous les diskgroups ASM connus de l'instance : taille des secteurs/blocs, taille de l'unité d'allocation, état, type de redondance et taux d'occupation. C'est le premier script à lancer pour un état des lieux rapide du stockage ASM (espace disponible, diskgroups en cours de montage/démontage, etc.).
Script
-- Rapport ASM : synthèse des diskgroups (v$asm_diskgroup)
SET TERMOUT OFF
COLUMN current_instance NEW_VALUE current_instance NOPRINT
SELECT RPAD(SYS_CONTEXT('USERENV', 'INSTANCE_NAME'), 17) current_instance FROM dual;
SET TERMOUT ON
PROMPT
PROMPT +------------------------------------------------------------------------+
PROMPT | Rapport : ASM Disk Groups |
PROMPT | Instance : ¤t_instance |
PROMPT +------------------------------------------------------------------------+
SET ECHO OFF
SET FEEDBACK 6
SET HEADING ON
SET LINESIZE 180
SET PAGESIZE 50000
SET VERIFY OFF
CLEAR COLUMNS
CLEAR BREAKS
CLEAR COMPUTES
COLUMN group_name FORMAT a25 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
total_mb != 0
ORDER BY
name
/
Colonnes / sortie
- State – état du diskgroup (
MOUNTED,DISMOUNTED, ...). - Type – type de redondance ASM (
EXTERN,NORMAL,HIGH). - Pct. Used – taux d'occupation ; un diskgroup proche de 100% doit être surveillé (extension ou nettoyage à prévoir).
- Le filtre
WHERE total_mb != 0exclut les diskgroups sans taille renseignée (état transitoire).
Voir aussi
- ASM disks — détail par disque physique
- ASM disks perfs — statistiques d'I/O par disque
- ASM clients — bases connectées à chaque diskgroup
- ASM templates — templates d'allocation par diskgroup