DarGridⅡ is an implemented database gird system whose goal is to provide a semantic solution for integrating database resources on the web. Although many algorithms have been proposed for optimizing query-processing in order to minimize costs and/or response time, associated with obtaining the answer to query in a distributed database system, database grid query optimization problem is fundamentally different from distributed query optimization. These differences are shown to be the consequences of autonomy and heterogeneity of databases in database grid. Therefore, more challenges have arisen for query optimization in database grid than traditional distributed database. Following this observation, we present the design of a query optimizer in DartGrid Ⅱ, and a heuristic, dynamic, and parallel query optimization approach for processing query in database grid is proposed.