AMAP – ASM Mapping Utility v0.2

Hi everyone,

I’ve made some improvements on my amap utility. Changelog is the following:

- New output formatting (table-like)
- New options for list option (all diskgroups or a specified diskgroup)
- New feature: Check free and used allocation units for a particular diskgroup or all diskgroups.
- Bug fixes
- New logo :-) and credits for Luca Canali ASM internals work.

Usage:

First, you need to set your ORACLE_SID to +ASM (or +ASMx on RAC) and login with sqlplus as SYSDBA/SYSASM

1) @amap list <diskgroup> returns all asm files (not directories) available for mapping extents and allocation units in +ASM. Now it is possible to specify only a diskgroup name or use “*” for all diskgroups. Example:

SQL> @amap list DATA
     ASM FILE NAME		     DISKGROUP	    FILENUMBER GROUPNUMBER
------------------------------ -------------------- ---------- ------------
	REGISTRY.253.783250057 DATA		    253        1
  thread_1_seq_1.257.802604171 DATA		    257        1
 thread_1_seq_53.300.794778461 DATA		    300        1
	    TEMP.263.796669055 DATA		    263        1
	 group_6.259.802551909 DATA		    259        1
	 group_3.264.796669055 DATA		    264        1
	 group_4.271.802551871 DATA		    271        1
	       stby_redo01.log DATA		    271        1
	 group_5.269.802551901 DATA		    269        1
	 group_1.266.796669053 DATA		    266        1
	       stby_redo04.log DATA		    258        1
	       stby_redo03.log DATA		    259        1
	 group_7.258.802551925 DATA		    258        1
	 group_2.265.796669053 DATA		    265        1
	       stby_redo02.log DATA		    269        1
	 Current.267.796669051 DATA		    267        1
	 EXAMPLE.262.796669057 DATA		    262        1
	  SYSAUX.261.796668997 DATA		    261        1
	  SYSTEM.260.796668997 DATA		    260        1
	   USERS.268.796668997 DATA		    268        1
	UNDOTBS1.270.796668997 DATA		    270        1
	  spfile.318.796669181 DATA		    318        1
	       spfilefenix.ora DATA		    318        1
 thread_1_seq_54.299.794780277 DATA		    299        1

2) @amap list *  list all asm filenames for all diskgroups. Same output as the last example.

3) @amap free DATA will give you the number of free and used allocation units present on a particular diskgroup. You can actually (if you know your AU size) get your free and used space on a particular diskgroup or disk.

SQL> @amap free DATA
     DISKGROUP	     DISKNUMBER AU STATUS   AU COUNT
-------------------- ---------- --------- ------------
		DATA 0		FREE AU   3249
		DATA 0		USED AU   2127
		DATA 1		FREE AU   3243
		DATA 1		USED AU   2133

4) @amap free * will list the free and used allocation units for all diskgroups.

5) @amap will now display in table format for easy reading.

SQL> @amap stby_redo01.log
GROUPNUMBER DISKNUMBER FILENUMBER FILE EXTENT NUMBER EXTENT MIRRORING RELATIVE AU POSITION
----------- ---------- ---------- ------------------ ---------------- --------------------
	  1 0	       271	  23		    PRIMARY EXT      1344
	  1 1	       271	  46		    PRIMARY EXT      1344
	  1 0	       271	  25		    PRIMARY EXT      1345
	  1 1	       271	  48		    PRIMARY EXT      1345
	  1 0	       271	  27		    PRIMARY EXT      1346
	  1 1	       271	  50		    PRIMARY EXT      1346
	  1 0	       271	  29		    PRIMARY EXT      1347
	  1 0	       271	  31		    PRIMARY EXT      1348
	  1 0	       271	  33		    PRIMARY EXT      1349

That is all folks. The download location is the same (github) and i will continue to improve this little tool: https://raw.github.com/lcmarques/amap/master/amap.sql

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