Fixes for db_domain and db_exception

Rename db_domain to db_type
Add "use" permission to db_domain and db_type