Some useful function & scripts for general database related problems