We report a site-separated $^{17}$O-NMR study of the layered perovskite ruthenate Sr$_3$Ru$_2$O$_7$, which exhibits nearly two-dimensional transport properties and itinerant metamagnetism at low temperatures. The local hole occupancies and the spin densities in the oxygen $2p$ orbitals are obtained by means of tight-binding analyses of electric field gradients and anisotropic Knight shifts. These quantities are compared with two other layered perovskite ruthenates: the two-dimensional paramagnet Sr$_2$RuO$_4$ and the three-dimensional ferromagnet SrRuO$_3$. The hole occupancies at the oxygen sites are very large, about one hole per ruthenium atom. This is due to the strong covalent character of the Ru-O bonding in this compound. The magnitude of the hole occupancy might be related to the rotation or tilt of the RuO$_6$ octahedra. The spin densities at the oxygen sites are also large, 20-40% of the bulk susceptibilities, but in contrast to the hole occupancies, the spin densities strongly depend on the dimensionality. This result suggests that the density-of-states at the oxygen sites plays an essential role for the understanding of the complex magnetism found in the layered perovskite ruthenates.