The present invention provides a glucokinase activator containing a compound represented by the formula (I):wherein each symbol is as defined in the specification, or a salt thereof or a prodrug thereof. According to the present invention, a glucokinase activator useful as a pharmaceutical agent such as agent for the prophylaxis or treatment of diabetes, obesity and the like, and the like can be provided.