Put your tips and tricks online - Share your knowledge! Login | Register
 
 
  Search     Advanced search
 

Home | Ask Question | Add tip | My tips | Recent tips & tricks | Suggest a category | FAQ | Forums

 
 
 
 Category : Home > Databases > Oracle > ASM     

Handy ASM commands in SQLPLUS


-- list disks that belong to disk groups
col name format a20
col path format a20

select b.NAME, a.NAME, a.PATH, a.TOTAL_MB, a.FREE_MB
from V$ASM_DISK a, V$ASM_DISKGROUP b
where a.GROUP_NUMBER = b.GROUP_NUMBER
order by a.NAME asc, a.PATH asc;

-- or list all disks, including candidates
col name format a20
col path format a20

select a.NAME, a.PATH, a.TOTAL_MB, a.FREE_MB
from V$ASM_DISK a
order by a.NAME asc, a.PATH asc;


-- add disk
ALTER DISKGROUP DATA01 ADD DISK '/dev/asm-disk03';

-- drop disk
ALTER DISKGROUP DATA01 DROP DISK 'DATA01_0001';

-- check the status of rebalance operation
select * from v$asm_operation;

-- generate a script to drop multiple disks
col path format a20

select 'ALTER DISKGROUP ' || b.NAME || ' DROP DISK ' || '''' || a.NAME || '''' || ';'
from V$ASM_DISK a, V$ASM_DISKGROUP b
where a.GROUP_NUMBER = b.GROUP_NUMBER
and PATH in (
'/dev/asm-disk01',
'/dev/asm-disk23',
'/dev/asm-disk22',
'/dev/asm-disk02',
'/dev/asm-disk03',
'/dev/asm-disk04',
'/dev/asm-disk05',
'/dev/asm-disk06',
'/dev/asm-disk07',
'/dev/asm-disk08',
'/dev/asm-disk09',
'/dev/asm-disk10',
'/dev/asm-disk11',
'/dev/asm-disk12',
'/dev/asm-disk14',
'/dev/asm-disk24',
'/dev/asm-disk26',
'/dev/asm-disk25',
'/dev/asm-disk27',
'/dev/asm-disk13',
'/dev/asm-disk15',
'/dev/asm-disk16',
'/dev/asm-disk17',
'/dev/asm-disk18',
'/dev/asm-disk19',
'/dev/asm-disk20',
'/dev/asm-disk32',
'/dev/asm-disk31',
'/dev/asm-disk30',
'/dev/asm-disk29',
'/dev/asm-disk21',
'/dev/asm-disk33'
)
order by a.NAME asc, a.PATH asc;


  Options
 
   del.icio.us  |  newsvine  |  digg  |  furl  |  google  |  yahoo  |  Ma.gnolia  |  vigillar  |  reddit  |  technorati  |  icerocket  |  pubsub

       Rate this tip:    

Start discussion or add comment to this tip

  Details
Tip reference : #308
views : 2263
Added on : 01/07/15
Submited by : h8dk97
 
Send a message Send a message Printer friendly output Printer friendly output
Display this member's tips Display this member's tips (219)
 
 
Next >>
 Most viewed tips 
  Databases > Oracle > Security : How to unlock Oracle user account  
  Databases > Oracle > Performance Tuning : How to enable trace in Oracle  
  Databases > Oracle > DR : Adding new datafiles to standby database  
  Operating Systems > Unix : How to kill Unix user session  
   
  All categories
Databases | Programming | Hardware | Operating Systems | Networking | Internet | ERP / CRM | Games & Multimedia | Graphics & Design | Miscellaneous | Mobile Phones / Tablets | Office Software
 
 

Home |  FAQ |  Terms of Use |  Privacy Policy

© 2005 tiplib.com