Based on the new cosmic microwave background (CMB) temperature data from the Planck satellite, the 9 year polarization data from the Wilkinson Microwave Anisotropy Probe (WMAP), and the baryon acoustic oscillation (BAO) distance ratio data from the Sloan Digital Sky Survey (SDSS) and 6 Degree field (6dF) surveys, we place a new constraint on the Brans-Dicke theory. We adopt a parametrization ζ = ln(1 + 1 ω ), where the general relativity (GR) limit corresponds to ζ = 0. We find no evidence of deviation from general relativity. At 95% probability, −0.00246 < ζ < 0.00567, correspondingly, the region −407.0 < ω < 175.87 is excluded. If we restrict ourselves to the ζ > 0 (i.e. ω > 0) case, then the 95% probability interval is ζ < 0.00549, corresponding to ω > 181.65. We can also translate this result to a constraint on the variation of gravitational constant, and find the variation rate today asĠ = −1.42 +2.48 −2.27 × 10 −13 yr −1 ( 1σ error bar), the integrated change since the epoch of recombination is δG/G = 0.0104 +0.0186 −0.0067 (1σ error bar). These limits on the variation of gravitational constant are comparable with the precision of solar system experiments.