add new database SQL
fix some bugs
add physical manage