Wednesday 16 October 2013

How to recreate ASM spfile after dropping the associated diskgroup

Disclaimer: This post lacks any scientific value whatsoever, and no one can hold the writer accountable for that! It merely came to existence just to serve as a warning.

I do feel like a 5 years old kid; It seems like the most efficient way of learning for me has been learning through making mistakes and correcting them afterwards!

After installing Clusterware for a single node instance, I noticed I have not created the DiskGroups I needed; so out goes the default "Data" diskgroup (despite Oracle begging me to reconsider, but as usual the FORCE option is ever so tempting) and in come two new diskgroups.

The diskgroups were supposed to be used for a duplicate database, so -obviously- when I started the active duplication process failures began to show.

I noticed on the recently created ASM instance that "sho parameter dummy" would return a bold scary "TRUE".

If you're as naive as I am, the rest is for you:

1. Shutdown the "Dummy" ASM instance.
2. Create a pfile, in which you'd explicitly name your existing Diskgroups. (e.g. "*.asm_diskgroups='BACKUP_01','DATA_01'")

The next two steps are for my amazement, actually, and for you to truly understand that you'd need to think twice before making silly prompt decisions.
3. Startup the ASM instance using the pfile you've just created
4. Create an spfile from the available pfile.
create spfile from pfile='/home/oracle/initASM.ora';
You should get something like this:

ERROR at line 1:
ORA-00349: failure obtaining block size for
'+DATA/asm/asmparameterfile/registry.253.828460173'

ORA-15001: diskgroup "DATA" does not exist or is not mounted
4. (Again, and using a more logical approach) Create an spfile, in one of the existing diskgroups, from the available pfile.
create spfile='+DATA_01' from pfile='/home/oracle/initASM.ora'
And this time:
ERROR at line 1: ORA-17502: ksfdcre:4 Failed to create file +DATA_01 ORA-15221: ASM operation requires compatible.asm of 11.2.0.0.0 or higher
I hope you're filled with regret and remorse from your actions on the night before! If not, do refrain from reading the rest of the post! So we go back a step: 3.9. Change the "compatible.asm" -obviously!
alter diskgroup DATA_01 set attribute 'compatible.asm'='11.2.0.0.0';
4. Create an spfile, in one of the existing diskgroups, from the available pfile.
create spfile='+DATA_01' from pfile='/home/oracle/initASM.ora'
Which would result in:

File created.
You can restart the ASM instance like a normal and decent human being now!

Final Thoughts: My dear God! Why?! Why did you put an ape's brain in my skull?! Do I have to make an attempt to put EVERY rectangular object into round holes to understand that the two shapes are different?! WHY?!

No comments:

Post a Comment