Difference between revisions of "ASM"
From dbawiki
(→Restart ASM) |
(→Check free space in ASM diskgroups) |
||
| Line 36: | Line 36: | ||
REDO 763120 687700 | REDO 763120 687700 | ||
DATA 14745600 2930908 | DATA 14745600 2930908 | ||
| + | </pre> | ||
| + | or | ||
| + | <pre> | ||
| + | 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 | ||
| + | order by name | ||
</pre> | </pre> | ||
Revision as of 17:04, 20 January 2017
Restart ASM
cat /opt/oracle/oak/onecmd/tmp/restartasm.sh
/u01/app/11.2.0.4/grid/bin/crsctl stop res ora.crsd -init /u01/app/11.2.0.4/grid/bin/crsctl stop res ora.asm -init /u01/app/11.2.0.4/grid/bin/crsctl start res ora.asm -init ps -ef | grep -v grep | grep -q smon_+ASM if [ $? -ne 0 ] then echo 'asm instance did not start in 1st attempt, sleeping for 30 secs and retrying' sleep 30 /u01/app/11.2.0.4/grid/bin/crsctl start res ora.asm -init fi /u01/app/11.2.0.4/grid/bin/crsctl start res ora.crsd -init
Check free space in ASM diskgroups
cat /opt/oracle/oak/onecmd/tmp/chekDGSpaceSql.sh
#! /bin/sh export ORACLE_HOME=/u01/app/12.1.0.2/grid export ORACLE_SID=+ASM1 $ORACLE_HOME/bin/sqlplus '/as sysasm' <<EOF column path format a40 column name format a35 set linesize 200 select name, total_mb,free_mb from v\$asm_diskgroup; quit EOF
gives
NAME TOTAL_MB FREE_MB ----------------------------------- ---------- ---------- RECO 2424000 2379084 REDO 763120 687700 DATA 14745600 2930908
or
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 order by name