Tuesday, January 11, 2011

ASM Essentials

  • Basic Commands
  • Add disk to ASM
    • Change the owner to oracle:oinstall
      • chown oracle:oinstall /dev/rdsk/c1t0d2s*
    • Change permission to 660
      • chmod 660 /dev/rdsk/c1t0d2s*
  • Create:
create diskgroup <test> external redundancy disk '/dev/rdsk' , '/dev/rdsk'  ;
  • Alter diskgroup (add or drop disk; mount diskgroup):
alter diskgroup <test> add disk '/dev/rdsk/' , '/dev/'
alter diskgroup all mount ; to mount all diskgroups
alter diskgroup <test> drop disk < pathname as obtained below>
SQL> select group_number,name from v$asm_diskgroup;

GROUP_NUMBER NAME

1 DGNORMAL

SQL> select path,name from v$asm_disk where group_number=1;


PATH NAME
/dev/raw/raw5 DGNORMAL_0000
/dev/raw/raw6 DGNORMAL_0001
/dev/raw/raw7 DGNORMAL_0004
/dev/raw/raw8 DGNORMAL_0005
SQL> alter diskgroup dgnormal drop disk dgnormal_0005;


Diskgroup altered.



  • Add greater than 2 TB disk on Oracle Database 12c


Creating diskgroup with slices with more than 2TB space works fine with the attribute:
ATTRIBUTE 'compatible.asm' = '12.1.0.2', 'compatible.rdbms' = '11.2.0.4'

  • Drop diskgroup
drop diskgroup <test> including contents ;if disk is mounted
drop diskgroup <test> force including contents; if diskgroup is not mounted
Extreme case
if last diskgroup and you do not need to save asm parameter file
alter diskgroup <test>  dismount force
drop diskgroup <test> force including contents
  • If you can dd on the disk and ASM still gives I/O error
 Asm Is not Discovering Disks On Solaris: ORA-15025 ORA-27041 SVR4 Error: 5: I/O error (Doc ID 1300393.1)'
If you are running ASM in local container, zero out the VTOC table in global container and reparition the disks. Then reboot the local container and recreate the diskgroup
First zero out the VTOC table so you can re-label as per the above document:
 dd if=/dev/zero of=/dev/rdsk/c2t8d10s2 count=10000 (then format ;select disk and label)

You cannot use the entire disk (s2) partition on Solaris as it contains sector 0 .....
  • Zero the contents of disk header
    • dd if=/dev/zero of=<diskpath> bs=4096 count=100
  • See if any asm operation is currently active  (after modifying diskgroup)
    • select * from v$asm_operation
  • Find the list of disks in a disk group:
    • Get the group number of diskgroup from v$ASM_DISKGROUP
      • select group_number,name from V$ASM_DISKGROUP;
    • Get the list of all the disk in that group number from v$ASM_disk
      • select substr(name,1,10) name, substr(path,1,20) path from v$ASM_disk where group_number=x;
  • Find the asm disk header status
  • select GROUP_NUMBER,DISK_NUMBER,MOUNT_STATUS,HEADER_STATUS,NAME,PATH from v$asm_disk;
    • FORMER - Disk was once part of a disk group but has been dropped cleanly from the group. It may be added to a new disk group with the ALTER DISKGROUP statement.
    • UNKNOWN - ASM disk header has not been read
    •  CANDIDATE - Disk is not part of a disk group and may be added to a disk group with the ALTER DISKGROUP statement
    •  INCOMPATIBLE - Version number in the disk header is not compatible with the ASM software version.
    •  PROVISIONED - Disk is not part of a disk group and may be added to a disk group with the ALTER DISKGROUP statement. The PROVISIONED header status is different from the CANDIDATE header status in that PROVISIONED implies that an additional platform-specific action has been taken by an administrator to make the disk available for ASM.
    •  MEMBER (default) - Disk is a member of an existing disk group. No attempt should be made to add the disk to a different disk group. The ALTER DISKGROUP statement will reject such an addition unless overridden with the FORCE option
    • · FORMER - Disk was once part of a disk group but has been dropped cleanly from the group. It may be added to a new disk group with the ALTER DISKGROUP statement.
    •  CONFLICT - ASM disk was not mounted due to a conflict
    •  FOREIGN - Disk contains data created by an Oracle product other than ASM. This includes datafiles,logfiles, and OCR disks.
  • Find which disk is not working in ASM diskgroup
      • Look at the alert log to see which physical disks are allocated to diskgroup  when the disk group was created:
        SQL> CREATE DISKGROUP TPCC1 EXTERNAL REDUNDANCY  DISK '/dev/rdsk/c6t20030003BA4E
        8829d0s6' SIZE 378884M ,
        '/dev/rdsk/c6t20030003BA4E8829d1s6' SIZE 382877M ,
        '/dev/rdsk/c6t20030003BACCC8FAd0s6' SIZE 906256M ,
        '/dev/rdsk/c6t20030003BACCC902d0s6' SIZE 488460M ,
        '/dev/rdsk/c6t20030003BACCC902d1s6' SIZE 203777M ,
        '/dev/rdsk/c6t20030003BACCC902d2s6' SIZE 283654M  ATTRIBUTE 'compatible.asm'='11
        .2.0.0.0','au_size'='1M' /* ASMCA */
        NOTE: Assigning number (2,0) to disk (/dev/rdsk/c6t20030003BA4E8829d0s6)
        NOTE: Assigning number (2,1) to disk (/dev/rdsk/c6t20030003BA4E8829d1s6)
        NOTE: Assigning number (2,2) to disk (/dev/rdsk/c6t20030003BACCC8FAd0s6)
        NOTE: Assigning number (2,3) to disk (/dev/rdsk/c6t20030003BACCC902d0s6)
        NOTE: Assigning number (2,4) to disk (/dev/rdsk/c6t20030003BACCC902d1s6)
        NOTE: Assigning number (2,5) to disk (/dev/rdsk/c6t20030003BACCC902d2s6)
        Compare it with the alert log output when you issue the mount command to mount the diskgroup:
        SQL> alter diskgroup TPCC1 MOUNT /* ASMCA */
        NOTE: cache registered group TPCC1 number=2 incarn=0x6a1b1a64
        NOTE: cache began mount (first) of group TPCC1 number=2 incarn=0x6a1b1a64
        NOTE: Assigning number (2,5) to disk (/dev/rdsk/c6t20030003BACCC902d2s6)
        NOTE: Assigning number (2,4) to disk (/dev/rdsk/c6t20030003BACCC902d1s6)
        NOTE: Assigning number (2,3) to disk (/dev/rdsk/c6t20030003BACCC902d0s6)
        ERROR: no PST quorum in group: required 1, found 0
                            This means ASM was able to see disk 3,4 and 5 for diskgroup number 2 (ie TPCC1 diskgroup). It has problems seeing disk 0,1 and 2

No comments:

Post a Comment