Friday, October 30, 2020

ORA-15039 and ORA-15001 while Dropping an ASM disk group

I was trying to drop a diskgroup and failed with ORA-15039 and ORA-15000. Following is what was returned.

SQL> drop diskgroup oradata;
drop diskgroup oradata
*

ERROR at line 1:
ORA-15039: diskgroup not dropped
ORA-15001: diskgroup "ORADATA" does not exist or is not mounted

Alert log file had a warning similar to the following which actually meant that spfile of ASM is also present in this diskgroup for which I am trying to drop the disk.

WARNING: Disk Group ORADATA containing spfile for this instance is not mounted

We can check location of spfile on this diskgroup

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
spfile                                    string         +ORADATA/asm/asmparameterfile/                                                                                                     registry.253.947435109

ORA-15040 and ORA-15042

I tried to mount this diskgroup, and it returned following.

SQL> alter diskgroup oradata mount;
alter diskgroup oradata mount

*

ERROR at line 1:
ORA-15032: not all alterations performed
ORA-15040: diskgroup is incomplete
ORA-15042: ASM disk "6" is missing from group number "1"
ORA-15042: ASM disk "2" is missing from group number "1"

Apparently it seemed to be a disk problem. If this kind of issue arises, there is no way other than dropping the diskgroup and then recreating with the correct disks. If this is production, you would need to restore the database from backup as well.

Since this diskgroup also contained spfile which is no longer accessible now, and ASM instance is still running, we can create a pfile from memory so that we can use it for ASM startup next time. Create pfile using “FROM MEMORY” clause because spfile is not accessible. To know about ORA-15052 (Also provide link to the previous document for ORA-15042 errors)

SQL> create pfile='/u01/app/initasm.ora' from memory;

File created.

Now we can drop this diskgroup but only by using FORCE option as follows.

SQL> drop diskgroup oradata;
drop diskgroup oradata

*

ERROR at line 1:
ORA-15039: diskgroup not dropped
ORA-15001: diskgroup "ORADATA" does not exist or is not mounted
 

SQL>  drop diskgroup oradata force including contents;
Diskgroup dropped.

After fixing your disk, you can create ASM diskgroup again. After diskgroup is created, you can copy back the spfile on this diskgroup and update ASM configuration. Before you do this, open the pfile created above and double check ASM_DISKGROUP parameter and confirm if all diskgroups are listed in this parameter.

Create directory location for spfile in this new diskgroup, same as it was in previous diskgroup

[grid]$ asmcmd
ASMCMD> cd +ORADATA
ASMCMD> mkdir ASM
ASMCMD> cd ASM
ASMCMD> mkdir asmparameterfile
ASMCMD> exit

Create spfile on again on this diskgroup

SQL> create spfile='+ORADATA'  from  pfile='/u01/app/initasm.ora';
File created.

Check the name of this spfile and then check if GI configuration contains the same spfile name, if not, update GI configuration.

[grid]$ asmcmd
ASMCMD> cd oradata/asm/asmparameterfile
ASMCMD> ls
REGISTRY.253.968070509


Check ASM configuration

[grid]$ srvctl config asm
ASM home: /u01/app/11204/grid
ASM listener: LISTENER
Spfile: +ORADATA/asm/asmparameterfile/registry.253.968070509
ASM diskgroup discovery string: ORCL:*

Following is the method to update GI configurations with the new ASM spfile if name of spfile is somehow changed.

[grid]$ srvctl modify asm -p +ORADATA/asm/asmparameterfile/REGISTRY.253.968070509


No comments:

Post a Comment

Popular Posts - All Times