view id is different from item id. View ids are required for items that become visible on the character like weapons, headgears, garments.
For headgear by default the client only accepts till value 1000 which is why we need to diff it to accept a larger number - in your case it is 5000
The 20000 you mentioned is the item id which as far as i know there is no definite upper limit for that now (though i think it might be limited to 32767 or 65535 - integer limit).You can start with any item id in item_db2 there is now issue about that.
item_db2 is supposed to be outside since it is meant for custom item addition. Just check your map server console first when you start up the server. If there is any syntax issues in item_db2 it will show up there before the maps are loaded.