Recover ASM pfile reading DiskGroup metadata

DBAs have a lot of know ways to read ASM pfile. The most common way is to recreate the pfile from your spfile as you do in a normal database instance:

SQL> create pfile='/home/oracle/init+ASM.ora' from spfile;

But this one is a little different. Diskgroup metadata actually contains a copy of your ASM pfile, so it might be helpful as last resort since you can use dd to read it. File #253 contains the ASM pfile and you can get a copy of it, if you can read ASM internal tables, or in the “fashion way” using my amap utility.
Let me give you an example. Look at “METADATA DESC” column and you will see ASM SPFILE row. Just pick the RELATIVE AU POSITION of it as well as disk number.

SQL> @amap metadata DATA
DISKNUMBER FILENUMBER FILE EXTENT NUMBER	  METADATA DESC 	EXTENT MIRRORING RELATIVE AU POSITION
---------- ---------- ------------------ ------------------------------ ---------------- --------------------
	 0 1	      0 		 FILE DIRECTORY 		PRIMARY EXT	 2
	 1 1	      1 		 FILE DIRECTORY 		PRIMARY EXT	 31
	 1 2	      0 		 DISK DIRECTORY 		PRIMARY EXT	 2
	 0 3	      0 		 ACTIVE CHG DIRECTORY (ACD)	PRIMARY EXT	 3
	 1 9	      0 		 ATTRIBUTE DIRECTORY		PRIMARY EXT	 25
	 1 253	      0 		 ASM SPFILE 			PRIMARY EXT	 30

File #253 is on position 30 on disk 1 inside DiskGroup DATA. To read it use dd:

[oracle@phoenix code]$ dd if=/dev/oracleasm/disks/DATA2 bs=1024k count=1 skip=30|strings|more
1+0 records in
1+0 records out
1048576 bytes (1.0 MB) copied, 0.0544034 s, 19.3 MB/s
*.asm_diskstring='/dev/oracleasm/disks'
*.asm_power_limit=1
*.diagnostic_dest='/u01/app/oracle'
*.instance_type='asm'
*.large_pool_size=12M
*.remote_login_passwordfile='EXCLUSIVE'

Now if you _ever_ need this, just copy-paste the contents from dd and create a pfile that you can use to start your +ASM instance.

Note: I’ve update amap to version 0.3.1 to include some bug fixes and some more diskgroup metadata description.

Have a nice weekend 🙂

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s