To check ASM status using srvctl...
srvctl status asm
To check that ASM is running and to see which user owns it...
ps -ef | grep -i ASM
All further commands on this page assume you are logged in to the OS as this userasmcmd
lsdg
exit
sqlplus as sysasm
@/u01/dba/asm/asm_diskgroups.sql
https://github.com/windwiny/Oracle-DBA-tips-scripts/blob/master/sql/asm_diskgroups.sqlsqlplus / as sysdba
SET LINESIZE 132
SELECT state AS "State",
type AS "Type",
NULL AS "Rebal",
sector_size AS "Sector",
logical_sector_size AS "Logical_Sector",
block_size AS "Block",
allocation_unit_size AS "AU",
total_mb AS "Total_MB",
free_mb AS "Free_MB",
required_mirror_free_mb AS "Req_mir_free_MB",
usable_file_mb AS "Usable_file_MB",
offline_disks AS "Offline_disks",
voting_files AS "Voting_files",
name AS "Name"
FROM v$asm_diskgroup;
EXIT
The SQL script on the right does not currently include the Rebal information.See Note: 470211.1
sqlplus / as sysdba
@asm_first.sql
@asm_second.sql
sqlplus / as sysasm
@/u01/dba/asm/asm_disks.sql
https://github.com/windwiny/Oracle-DBA-tips-scripts/blob/master/sql/asm_disks.sqlsqlplus / as sysasm
@/u01/dba/asm/asm_disks1.sql
As above, but with the STATE column added to the outputsqlplus / as sysasm
@/u01/dba/asm/asm_disks_perf.sql
https://github.com/windwiny/Oracle-DBA-tips-scripts/blob/master/sql/asm_disks_perf.sqlsqlplus / as sysasm
@/u01/dba/asm/asm_alias.sql
https://github.com/windwiny/Oracle-DBA-tips-scripts/blob/master/sql/asm_alias.sql@/u01/dba/asm/asm_clients.sql
https://github.com/windwiny/Oracle-DBA-tips-scripts/blob/master/sql/asm_clients.sql@/u01/dba/asm/asm_files.sql
https://github.com/windwiny/Oracle-DBA-tips-scripts/blob/master/sql/asm_files.sql@/u01/dba/asm/asm_files2.sql
https://github.com/windwiny/Oracle-DBA-tips-scripts/blob/master/sql/asm_files2.sql@/u01/dba/asm/asm_templates.sql
https://github.com/windwiny/Oracle-DBA-tips-scripts/blob/master/sql/asm_templates.sqlsrvctl start asm
srvctl stop asm
ALTER SYSTEM SET ASM_DISKSTRING = '/dev/rhdisk2*' , '/dev/asm*' SCOPE=BOTH;
CREATE DISKGROUP oradata2 EXTERNAL REDUNDANCY DISK '/dev/asm69','/dev/asm70','/dev/asm103','/dev/asm104','/dev/asm105';
ALTER DISKGROUP oradata REBALANCE POWER 10;
ALTER DISKGROUP oradata ADD DISK '/dev/rhdisk28';
To add a disk to a specific failgroup...
ALTER DISKGROUP oradata ADD FAILGROUP controller2 DISK '/dev/rhdisk28';
If you don't specify a failgroup then per disk failgroups are usedYou should run a rebalance after adding a disk...
ALTER DISKGROUP oradata REBALANCE;
You can track rebalance progress using...
SELECT * FROM v$asm_operation;
See the section on v$asm_operatioon later on this page for more informationALTER DISKGROUP oradata DROP DISK oradata1_0004;
ALTER DISKGROUP oradata DROP DISKS IN FAILGROUP controller1;
For RAC, shutdown ASM instances on other nodes, leaving just one instance, then:
DROP DISKGROUP oradata INCLUDING CONTENTS;
ASM_DISKGROUPS
ASM_DISKSTRING
ASM_PREFREERD_READ_FAILURE_GROUPS
Sets the default rebalance power. Permitted value from 0 to 11, where 0 stops the rebalance operation and 11 permits Automatic Storage Management to execute the rebalance as fast as possible
Displays a row for each alias in every disk group mounted by ASM
Displays a row for each database instance using a disk group managed by ASM.
Displays a row for each disk discovered by the ASM instance
Same as V$ASM_DISK without performing discovery of new disks
Displays a row for each disk group discovered by the ASM instance.
Same as V$ASM_DISKGROUP without performing discovery of new diskgroups
Displays a row for each file for each disk group mounted by ASM
Displays a row for each file for each long running operation executing in ASM
SELECT *
FROM v$asm_operation;
Cluster wide implementation of V$ASM_OPERATION
Displays a row for each template present in each disk group mounted by ASM