0% found this document useful (0 votes)
570 views5 pages

ASM-Cheat-sheet: Oracle

This document contains Oracle ASM cheat sheet commands for displaying and managing disk groups, disks, and operations. It includes SQL commands for showing disk group information and space usage, creating and modifying disk groups by adding or dropping disks, checking disk group status, and mounting/dismounting disk groups. A note explains that a disk with a group number of zero indicates an available disk not yet assigned to a group.

Uploaded by

Ma Godfrey
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
570 views5 pages

ASM-Cheat-sheet: Oracle

This document contains Oracle ASM cheat sheet commands for displaying and managing disk groups, disks, and operations. It includes SQL commands for showing disk group information and space usage, creating and modifying disk groups by adding or dropping disks, checking disk group status, and mounting/dismounting disk groups. A note explains that a disk with a group number of zero indicates an available disk not yet assigned to a group.

Uploaded by

Ma Godfrey
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

ASM-Cheat-sheet

Filed under: oracle sunilbugger @ 10:51 am


Display disk-groups
set lines 100
col name format a10
col path format a30
select name
, group_number
, disk_number
, mount_status
, state
, path
from v$asm_disk
order by group_number
/
set lines 100
col name format a10
col path format a30
select name
, group_number
, disk_number
, mount_status
, state
, path
from v$asm_disk
order by group_number
/

note. A group number of zero his indicates that a disk is available but hasnt yet been assigned
to a disk group.

Show disk space usage


select name
,

group_number

disk_number

total_mb

free_mb

from

v$asm_disk

order

by group_number

/
select name
,

group_number

disk_number

total_mb

free_mb

from

v$asm_disk

order

by group_number

Create a disk group


create diskgroup data1
external redundancy
disk /dev/raw/raw1
/
create diskgroup data1
external redundancy
disk /dev/raw/raw1
/

or with multiple raw partitions


multiple disks
create diskgroup data2
external redundancy

disk /dev/raw/raw2
, /dev/raw/raw3
/
multiple disks
create diskgroup data2
external redundancy
disk /dev/raw/raw2
, /dev/raw/raw3
/

or with multiple fail groups


create diskgroup data3
normal redundancy
failgroup controller1 disk /dev/raw/raw4
failgroup controller2 disk /dev/raw/raw6
/
create diskgroup data3
normal redundancy
failgroup controller1 disk /dev/raw/raw4
failgroup controller2 disk /dev/raw/raw6
/

Add a disk to a group


alter diskgroup data1
add disk /dev/raw/raw4
/
alter diskgroup data1
add disk /dev/raw/raw4
/

Wildcards can be used for raw device names (eg. raw*)

Drop a disk group


drop diskgroup <name>
/
drop diskgroup <name>
/

Is ASM performing a balancing operation


select *
from v$asm_operation
/
select *
from v$asm_operation
/

Mount/dismount disk groups


alter diskgroup all mount
/
alter diskgroup all mount
/

alter diskgroup data1 mount


/
alter diskgroup data1 mount
/

alter diskgroup all dismount


/
alter diskgroup all dismount
/

alter diskgroup data1 dismount


/

alter diskgroup data1 dismount


/

Check the internal consistency of a diskgroup


alter diskgroup data1 check all
/

You might also like