DOYENSYS Knowledge Portal




We Welcome you to visit our DOYENSYS KNOWLEDGE PORTAL : Doyensys Knowledge Portal




Wednesday, September 30, 2015

ASM Disk Corruption Resolution


ASM Disk Corruption Resolution

Disk Group information:

SQL> select group_number, name, state, type from v$asm_diskgroup;
GROUP_NUMBER NAME                STATE    TYPE
———— —————————— ———– ——
       1 DATA                
MOUNTED    EXTERN

Disk Information:
SQL> select group_number, name, mount_status, header_status, state from v$asm_disk;
GROUP_NUMBER NAME                MOUNT_S HEADER_STATU STATE
———— —————————— ——- ———— ——–
       1 DATA_0001                CACHED  MEMBER     NORMAL
       1 DATA_0000                CACHED  MEMBER     NORMAL

To Read the Content In the Disk:

[grid@a1 dbs]$ kfed read /dev/oracleasm/disks/ASMDISK1
kfbh.endian:                          1 ; 0×000: 0×01
kfbh.hard:                          130 ; 0×001: 0×82
kfbh.type:                            1 ; 0×002: 
KFBTYP_DISKHEAD
kfbh.datfmt:                          1 ; 0×003: 0×01
kfbh.block.blk:                       0 ; 0×004: blk=0
kfbh.block.obj:              2147483648 ; 0×008: 
disk=0
kfbh.check:                   298064398 ; 0x00c: 0x11c41a0e
kfbh.fcn.base:                        0 ; 0×010: 0×00000000

kfbh.fcn.wrap:                        0 ; 0×014: 0×00000000
kfbh.spare1:                          0 ; 0×018: 0×00000000
kfbh.spare2:                          0 ; 0x01c: 0×00000000
kfdhdb.driver.provstr: 
ORCLDISKASMDISK1 ; 0×000: length=16
kfdhdb.driver.reserved[0]:   1145918273 ; 0×008: 0x444d5341
kfdhdb.driver.reserved[1]:    827020105 ; 0x00c: 0x314b5349
kfdhdb.driver.reserved[2]:            0 ; 0×010: 0×00000000
kfdhdb.driver.reserved[3]:            0 ; 0×014: 0×00000000
kfdhdb.driver.reserved[4]:            0 ; 0×018: 0×00000000
kfdhdb.driver.reserved[5]:            0 ; 0x01c: 0×00000000
kfdhdb.compat:                168820736 ; 0×020: 0x0a100000
kfdhdb.dsknum:                        0 ; 0×024: 0×0000
kfdhdb.grptyp:                        1 ; 0×026: KFDGTP_EXTERNAL
kfdhdb.hdrsts:                        3 ; 0×027: KFDHDR_MEMBER
kfdhdb.dskname:               
DATA_0000 ; 0×028: length=9
kfdhdb.grpname:                    
DATA ; 0×048: length=4
kfdhdb.fgname:               
 DATA_0000 ; 0×068: length=9


./home/oracle/.bash_profile
orcl
sqlplus / as sysdba

SQL> create table a(id number primary key, value varchar2(20));

Table created.

SQL> insert into a values (1,'ss');

1 row created.

SQL> insert into a values (2,'yy');

1 row created.

SQL> commit;

Commit complete.

SQL> select * from a.a;

        ID VALUE
———- ——————–
         1 ss
         2 yy
2 rows selected.
Corrupt the Disk:
[grid@a1 dbs]$ dd if=/dev/zero of= /dev/asm-disk1
bs=4096 count=1
1+0 records in
1+0 records out
4096 bytes (4.1 kB) copied, 0.000505259 seconds, 8.1 MB/s

Dismount and Mount the diskgroup:

oracle@a1 ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Sun Jun 15 12:52:21 2014
Copyright (c) 1982, 2013, Oracle.  All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 – 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> 
[oracle@rac1 dbs]$ sqlplus / as sysasm

SQL*Plus: Release 12.1.0.2.0 Production on Wed Sep 30 00:48:59 2015

Copyright (c) 1982, 2014, Oracle.  All rights reserved.


Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Real Application Clusters and Automatic Storage Management options

SQL> alter diskgroup data dismount;
Diskgroup altered.

SQL> alter diskgroup data mount;
alter diskgroup data mount
*
ERROR at line 1:
ORA-15032: not all alterations performed
ORA-15017: diskgroup "DATA" cannot be mounted
ORA-15063: ASM discovered an insufficient number of disks for diskgroup "DATA"


SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 – 64bit Production
With the Automatic Storage Management option
Recover the disk using kfed command line utility.
[grid@a1 ~]$ kfed repair /dev/oracleasm/disks/ASMDISK1
[grid@a1 ~]$ sqlplus / as sysasm
SQL*Plus: Release 11.2.0.4.0 Production on Sun Jun 15 17:54:13 2014
Copyright (c) 1982, 2013, Oracle.  All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 – 64bit Production
With the Automatic Storage Management option

Remount the Disk group:

SQL> alter diskgroup data mount;
Diskgroup altered.

SQL> select group_number, name, state, type from v$asm_diskgroup;
GROUP_NUMBER NAME                STATE    TYPE
———— —————————— ———– ——
       1 DATA                
MOUNTED    EXTERN

SQL> select group_number, name, mount_status, header_status, state from v$asm_disk;
GROUP_NUMBER NAME                MOUNT_S HEADER_STATU STATE
———— —————————— ——- ———— ——–
       1 DATA_0001                CACHED  MEMBER     NORMAL
       1 DATA_0000                CACHED  MEMBER     NORMAL

No comments: