cannot connect to database as it needs to be compiled.

During the one IDM upgradation from 8.1.1 to 8.1.14 getting error while connecting - cannot connect to database as it needs to be compiled. since we couldn't connect the DB how to compile it?