AMAP – ASM Mapping Utility

I’ve done a small improvement over my asm_info.sql script. Now it’s called amap. The ideia behind this script is helping DBAs to easily maps files, extents and allocation units. You can track the extents of a specified file.

Usage is simple:

1) @amap list returns all asm files (not directories) available for mapping extents and allocation units in +ASM. It also contains the DG (also GroupNumber), FileNumber after the filename alias.

SQL> @amap list
== ASM FILE ALIAS LIST ==
NAME: REGISTRY.253.783250057 [DG=+DATA;FN=253;GN=1]
NAME: thread_1_seq_1.257.802604171 [DG=+DATA;FN=257;GN=1]
NAME: thread_1_seq_53.300.794778461 [DG=+DATA;FN=300;GN=1]
NAME: thread_1_seq_49.286.789019619 [DG=+DATA;FN=286;GN=1]
NAME: thread_1_seq_52.301.789088533 [DG=+DATA;FN=301;GN=1]
... NAME: EXAMPLE.262.796669057 [DG=+DATA;FN=262;GN=1]
NAME: SYSAUX.261.796668997 [DG=+DATA;FN=261;GN=1]
NAME: SYSTEM.260.796668997 [DG=+DATA;FN=260;GN=1]
NAME: USERS.268.796668997 [DG=+DATA;FN=268;GN=1]
NAME: UNDOTBS1.270.796668997 [DG=+DATA;FN=270;GN=1]
NAME: spfile.318.796669181 [DG=+DATA;FN=318;GN=1]
NAME: spfilefenix.ora [DG=+DATA;FN=318;GN=1]

2) @amap <asm file name> provides the actual mapping between the the files, the file extents and the relative position of the allocation unit from the beggining of the disk.

SQL> @amap USERS.268.796668997
[GROUP_NUMBER ; DISKNUMBER ; FILENUMBER ; FILE_EXTENT_NUMBER ; RELATIVE_AU_POS]
[1 ; 1 ; 268 ; 0 ; PRIMARY EXTENT ; 641]
[1 ; 0 ; 268 ; 1 ; PRIMARY EXTENT ; 641]
[1 ; 1 ; 268 ; 2 ; PRIMARY EXTENT ; 642]
[1 ; 0 ; 268 ; 3 ; PRIMARY EXTENT ; 642]
[1 ; 1 ; 268 ; 4 ; PRIMARY EXTENT ; 643]
...
[1 ; 0 ; 268 ; 145 ; PRIMARY EXTENT ; 1051]
[1 ; 0 ; 268 ; 147 ; PRIMARY EXTENT ; 1052]
[1 ; 0 ; 268 ; 149 ; PRIMARY EXTENT ; 1053]
[1 ; 0 ; 268 ; 151 ; PRIMARY EXTENT ; 1054]
[1 ; 0 ; 268 ; 153 ; PRIMARY EXTENT ; 1055]
[1 ; 0 ; 268 ; 155 ; PRIMARY EXTENT ; 1056]

Script is here: https://raw.github.com/lcmarques/amap/master/amap.sql

Update:
You have to run it inside your +ASM instance.

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