" ... practice makes perfect "      - stellentpmp aka Andrew
stellentpmp.blogspot.comContent Server

Wednesday, May 18, 2011

mdaw Directory Explained!

The mdaw folders are created based on the 'dispersion rule' of the your FileStore (Administration » Providers » FileStore Info » Edit FileStore » Edit [default] Storage Rule). Basically this rule helps separate your content by storing them into multiple directories.

The default rule is $dRevClassID[-9:-6:0:b]/$dRevClassID[-6:-3:0:b], which basically takes two 3-digit substrings of dRevClassID and encodes it into a Base64 string.

The first substring will always map to '000' (the 9th, 8th, and 7th digit) until you reach 1 million records. The second substring will map to the next three digits (the 6th, 5th, and 4th digits, or the 100-thousands', 10-thousands', thousands' place) of your dRevClassID. This will be always be '000' until you reach 1000 records, in which case it will be '001'. Once you hit 2000, it will be '002', 3000 is '003', etc.

If you encode the substring, '000' becomes 'MDAw', '001' becomes 'MDAx', '002' becomes 'MDAy', etc. Therefore, if you have < 1000 records, the dispersion rule will use '000' and '000' to store the content, mapping it to MDAw/MDAw. Once you hit 1000 records, it will store them in MDAw/MDAx. Once you hit 1 million records, it will start using '001' as the first directory. Thus, the 1,000,000th document will be stored in MDAx/MDAw. Even though they have capital letters, I imagine Oracle just takes the value and performs a .toLowerCase() transformation on it to give the infamous mdaw.

So you can say that, by default, your documents are stored in groups of 1000 and bigger groups of a million.

Naturally, you can create your own dispersion rule (say only groups of 10,000 documents), or even get rid of it completely. If you "go back" to the 10gR3 vault/weblayout structure, you'll need to edit the "Vault Path" of your Storage Rule or edit the [install directory]/data/providers/[filestore]/provider.hda directly, and remove the $dispersion$ variable. However, you'll need to go the second route if you want to change the Web-viewable Path because Oracle made that read-only (for some strange reason) on the Store Rule page.

You can read a little bit more about this in section 4.3.5.5.3 Limiting the Number Files in a Directory of the System Administrator's Guide.

Good luck.

No comments:

Post a Comment