Barium titanate is an important ferroelectric material widely used for electroceramic devices. In general, BaTiO3 is used in a form of sinters so that a technique of grain size control plays an important role to obtain high quality devices. So far, a number of studies were carried out to understand the grain growth behavior of BaTiO$_3$. In particular, considerable efforts were focused on abnormal grain growth which is often observed in BaTiO3. The mechanisms of the abnormal grain growth, however, is still under debate. Recent experimental studies showed the possibility that the abnormal grain growth in BaTiO3 was related to the defect formation and related interface morphology. A change in the type of preferable point defects at annealing conditions affects the grain boundary atomic structure, which is closely related to the grain growth behavior. To clarify this issue, it must be necessary to know the defect energetics in BaTiO3. In this work, we investigated the defect energetics of BaTiO3, including point, partial Schottky, and full Schottky defects by first principles band structure calculations from a viewpoint of their oxygen partial pressure dependency. In addition, the calculated defect formation energies and the atomic relaxations caused by defect formations were compared with those of SrTiO3 previously reported. The two compounds showed different relaxation behaviors due to the different bond strengths of Ba-O and Sr-O, which changed the stable defect species as a a function of oxygen partial pressure. Possible correlation between the defect formation and grain growth behavior was also discussed.