How to Create and Modify Disk Group
1. Create New Disk Group
create diskgroup DATA external redundancy disk '/dev/oracleasm/disks/ASMDATA01'
ATTRIBUTE 'compatible.rdbms' = '11.1', 'compatible.asm' = '11.1';
alter diskgroup DATA check all;
If RAC then on second ASM Instance (Example ASM2):
alter diskgroup DATA mount;
2. Add new disk in exiting diskgroup
alter diskgroup DATA add disk '/dev/oracleasm/disks/ASMDATA02';
3. Add several disks with a wildcard:
alter diskgroup DATA add disk '/dev/oracleasm/disks/ASMDATA*';
4. Remove a disk from a diskgroup:
alter diskgroup DATA drop disk 'DATA_0001';
5. Drop the entire DiskGroup
drop diskgroup DATA including contents;
6. How to DROP the entire DiskGroup when it is in NOMOUNT Status
Generate the dd command which will reset the header of all the disks belong the GROUP_NUMBER=0!!!!
select 'dd if=/dev/zero of=''' ||PATH||''' bs=8192 count=100' from v$asm_disk
where GROUP_NUMBER=0;
select * from v$asm_operation;
7. After adding new disk or dropping an existing disk, rebalance the data across the all disks by below command.
alter diskgroup DATA rebalance power 10;
--When a new diskgroup is created, it is only mounted on the local instance,
--and only the instance-specific entry for the asm_diskgroups parameter is updated.
--By manually mounting the diskgroup on other instances, the asm_diskgroups parameter
--on those instances are updated.
--on +ASM1 :
create diskgroup FRA1 external redundancy disk '/dev/vx/rdsk/fradg/fra1'
ATTRIBUTE 'compatible.rdbms' = '11.1', 'compatible.asm' = '11.1';
--on +ASM2 :
alter diskgroup FRA1 mount;
No comments:
Post a Comment